stack
Class StackStatico<E>

java.lang.Object
  extended by stack.StackStatico<E>
All Implemented Interfaces:
Stack<E>

public class StackStatico<E>
extends java.lang.Object
implements Stack<E>


Constructor Summary
StackStatico()
          Creates an empty Stack of max 10 ints.
StackStatico(int n)
          Creates an empty Stack of max N ints.
 
Method Summary
 boolean empty()
          Tests if this stack is empty.
 int howMany()
          Returns the number of elements inside the Stack.
 E peek()
          Looks at the object at the top of this stack without removing it from the stack.
 E pop()
          Removes the object at the top of this stack and returns that object as the value of this function.
 E push(E item)
          Pushes an item onto the top of this stack.
 int search(E o)
          Returns the 1-based position where an object is on this stack.
 java.lang.String toString()
          Return a String representation of the Stack and its content.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

StackStatico

public StackStatico()
Creates an empty Stack of max 10 ints.


StackStatico

public StackStatico(int n)
Creates an empty Stack of max N ints.

Method Detail

empty

public boolean empty()
Tests if this stack is empty.

Specified by:
empty in interface Stack<E>

peek

public E peek()
Looks at the object at the top of this stack without removing it from the stack.

Specified by:
peek in interface Stack<E>

pop

public E pop()
Removes the object at the top of this stack and returns that object as the value of this function.

Specified by:
pop in interface Stack<E>

push

public E push(E item)
Pushes an item onto the top of this stack.

Specified by:
push in interface Stack<E>

search

public int search(E o)
Returns the 1-based position where an object is on this stack.

Specified by:
search in interface Stack<E>

howMany

public int howMany()
Returns the number of elements inside the Stack.

Specified by:
howMany in interface Stack<E>

toString

public java.lang.String toString()
Return a String representation of the Stack and its content.

Overrides:
toString in class java.lang.Object