DataStructures
Interface Queue<E>

Type Parameters:
E - the type of elements held in this queue
All Known Implementing Classes:
QueueArray, QueueList

public interface Queue<E>

A first-in-first-out (FIFO) queue of objects.

Author:
Peter Williams

Method Summary
 E dequeue()
          Detaches an item from the queue.
 void enqueue(E item)
          Attaches an item to the queue.
 boolean isEmpty()
          Indicates the status of the queue.
 

Method Detail

isEmpty

boolean isEmpty()
Indicates the status of the queue.

Returns:
true if the queue is empty.

enqueue

void enqueue(E item)
Attaches an item to the queue.

Parameters:
item - the item of type E to be queued.

dequeue

E dequeue()
Detaches an item from the queue.

Returns:
the item least recently queued.
Throws:
NoSuchElementException - if the queue is empty.