Interface Queue

All Known Implementing Classes:
SLQueue

interface Queue

A Queue is a repository for Objects maintained in first-in first-out order. Objects are inserted using enqueue and removed using dequeue. Objects are removed in the same order in which they are inserted.


Method Summary
 java.lang.Object dequeue()
          Remove an Object from the queue.
 void enqueue(java.lang.Object item)
          Insert an Object in the queue.
 boolean isEmpty()
          Indicate whether or not the Queue is empty
 

Method Detail

enqueue

public void enqueue(java.lang.Object item)
Insert an Object in the queue.

Parameters:
item - the Object to be inserted

dequeue

public java.lang.Object dequeue()
                         throws EmptyQueueException
Remove an Object from the queue.

Returns:
the Object removed
Throws:
EmptyQueueException - if the Queue is empty

isEmpty

public boolean isEmpty()
Indicate whether or not the Queue is empty

Returns:
boolean indicating whether or not the Queue is empty