maze.storage
Class Queue

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

public class Queue
extends PushPop

A PushPop that implements a FIFO Queue.

See Also:
Serialized Form

Field Summary
protected  java.util.Vector theQueue
          The Vector used to keep elements in the Queue.
 
Fields inherited from class java.util.Vector
capacityIncrement, elementCount, elementData
 
Fields inherited from class java.util.AbstractList
modCount
 
Constructor Summary
Queue()
          Creates an empty Queue.
Queue(int size)
          Creates an empty Queue of the given size.
Queue(int size, int incr)
          Creates an empty Queue with the giving sizing parameters.
 
Method Summary
 boolean empty()
          Returns true if the Queue is empty.
 java.lang.Object pop()
          Pop an element from the top of the Queue.
 void push(java.lang.Object o)
          Push a new element on the bottom of the Queue.
 
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

theQueue

protected java.util.Vector theQueue
The Vector used to keep elements in the Queue.

Constructor Detail

Queue

public Queue()
Creates an empty Queue.


Queue

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

Parameters:
size - int initial size.

Queue

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

Parameters:
size - int initial size.
incr - int increment used to extend the structure when the Queue is full.
Method Detail

empty

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

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

push

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

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

pop

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

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