weiss.nonstandard
Interface Queue

All Known Implementing Classes:
ArrayQueue, ListQueue

public interface Queue

Protocol for queues.


Method Summary
 java.lang.Object dequeue()
          Return and remove the least recently inserted item from the queue.
 void enqueue(java.lang.Object x)
          Insert a new item into the queue.
 java.lang.Object getFront()
          Get the least recently inserted item in the queue.
 boolean isEmpty()
          Test if the queue is logically empty.
 void makeEmpty()
          Make the queue logically empty.
 

Method Detail

enqueue

public void enqueue(java.lang.Object x)
Insert a new item into the queue.
Parameters:
x - the item to insert.

getFront

public java.lang.Object getFront()
Get the least recently inserted item in the queue. Does not alter the queue.
Returns:
the least recently inserted item in the queue.
Throws:
UnderflowException - if the queue is empty.

dequeue

public java.lang.Object dequeue()
Return and remove the least recently inserted item from the queue.
Returns:
the least recently inserted item in the queue.
Throws:
UnderflowException - if the queue is empty.

isEmpty

public boolean isEmpty()
Test if the queue is logically empty.
Returns:
true if empty, false otherwise.

makeEmpty

public void makeEmpty()
Make the queue logically empty.