maze.storage
Class PushPop

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

public abstract class PushPop
extends java.util.Vector

A common abstraction for Stack and Queue to allow them to be used interchangably for depth-first and breadth-first maze filling. This predates the formalized Collections Framework and isn't really necessary.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class java.util.Vector
capacityIncrement, elementCount, elementData
 
Fields inherited from class java.util.AbstractList
modCount
 
Constructor Summary
PushPop()
           
 
Method Summary
abstract  boolean empty()
          Returns true if the PushPop is empty.
abstract  java.lang.Object pop()
          Remove an object from the PushPop structure.
abstract  void push(java.lang.Object o)
          Push a new object into the PushPop structure.
 
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
 

Constructor Detail

PushPop

public PushPop()
Method Detail

push

public abstract void push(java.lang.Object o)
Push a new object into the PushPop structure.

Parameters:
o - Object to be pushed into the PushPop.

pop

public abstract java.lang.Object pop()
Remove an object from the PushPop structure. If this is a FIFO queue, it is the first item pushed. If this is a LIFO stack, it is the last item pushed.

Returns:
Object removed from the PushPop.

empty

public abstract boolean empty()
Returns true if the PushPop is empty.

Returns:
boolean True if the PushPop is empty.