java.util
Class Queue

java.lang.Object
  extended by java.util.Vector
      extended by java.util.Queue

public class Queue
extends Vector

A FIFO Queue of objects.


Field Summary
 
Fields inherited from class java.util.Vector
capacityIncrement, elementCount, elementData
 
Constructor Summary
Queue()
          creates a new Queue instance
 
Method Summary
 boolean empty()
          is this Queue empty?
 Object peek()
          fetches an object from the start of the Queue
does not remove it!
 Object pop()
          fetches an object from the start of the Queue and removes it
 Object push(Object anObject)
          pushes an object onto the Queue
 
Methods inherited from class java.util.Vector
addElement, capacity, clear, elementAt, elements, ensureCapacity, equals, indexOf, indexOf, insertElementAt, isEmpty, lastIndexOf, lastIndexOf, removeAllElements, removeElement, removeElementAt, setElementAt, setSize, size, toArray, trimToSize
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Queue

public Queue()
creates a new Queue instance

Method Detail

push

public Object push(Object anObject)
pushes an object onto the Queue

Parameters:
anObject - the object
Returns:
Object the object pushed onto the Queue

pop

public Object pop()
           throws EmptyQueueException
fetches an object from the start of the Queue and removes it

Returns:
Object the object removed from the start of the stock
Throws:
EmptyQueueException

peek

public Object peek()
            throws EmptyQueueException
fetches an object from the start of the Queue
does not remove it!

Returns:
Object the object at the start of the Queue
Throws:
EmptyQueueException

empty

public boolean empty()
is this Queue empty?

Returns:
boolean true, if the Queue is empty