maze.storage
Class Stack

java.lang.Object
  extended byjava.util.AbstractCollection
      extended byjava.util.AbstractList
          extended byjava.util.Vector
              extended bymaze.storage.PushPop
                  extended bymaze.storage.Stack
All Implemented Interfaces:
java.lang.Cloneable, java.util.Collection, java.util.List, java.util.RandomAccess, java.io.Serializable

public class Stack
extends PushPop

A PushPop that implements a LIFO Stack.

See Also:
Serialized Form

Field Summary
protected  java.util.Vector theStack
          The Vector used to keep elements in the Stack.
 
Fields inherited from class java.util.Vector
capacityIncrement, elementCount, elementData
 
Fields inherited from class java.util.AbstractList
modCount
 
Constructor Summary
Stack()
          Creates an empty Stack.
Stack(int size)
          Creates an empty Stack of the given size.
Stack(int size, int incr)
          Creates an empty Stack with the giving sizing parameters.
 
Method Summary
 boolean empty()
          Returns true if the Stack is empty.
 java.lang.Object pop()
          Pop an element from the top of the Stack.
 void push(java.lang.Object o)
          Push a new element on the top of the Stack.
 
Methods inherited from class java.util.Vector
add, add, addAll, addAll, addElement, capacity, clear, clone, contains, containsAll, copyInto, elementAt, elements, ensureCapacity, equals, firstElement, get, hashCode, indexOf, indexOf, insertElementAt, isEmpty, lastElement, lastIndexOf, lastIndexOf, remove, remove, removeAll, removeAllElements, removeElement, removeElementAt, removeRange, retainAll, set, setElementAt, setSize, size, subList, toArray, toArray, toString, trimToSize
 
Methods inherited from class java.util.AbstractList
iterator, listIterator, listIterator
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.List
iterator, listIterator, listIterator
 

Field Detail

theStack

protected java.util.Vector theStack
The Vector used to keep elements in the Stack.

Constructor Detail

Stack

public Stack()
Creates an empty Stack.


Stack

public Stack(int size)
Creates an empty Stack of the given size.

Parameters:
size - int initial size.

Stack

public Stack(int size,
             int incr)
Creates an empty Stack with the giving sizing parameters.

Parameters:
size - int initial size.
incr - the structure when the Stack is full.
Method Detail

empty

public boolean empty()
Returns true if the Stack is empty.

Specified by:
empty in class PushPop
Returns:
True if the Stack is empty.

push

public void push(java.lang.Object o)
Push a new element on the top of the Stack.

Specified by:
push in class PushPop
Parameters:
o - Object to push on the top of the Stack.

pop

public java.lang.Object pop()
Pop an element from the top of the Stack.

Specified by:
pop in class PushPop
Returns:
Object popped from the top of the Stack.