weiss.nonstandard
Interface Queue<AnyType>

All Known Implementing Classes:
ArrayQueue, ListQueue

public interface Queue<AnyType>

Protocol for queues.


Method Summary
 AnyType dequeue()
          Return and remove the least recently inserted item from the queue.
 void enqueue(AnyType x)
          Insert a new item into the queue.
 AnyType 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

void enqueue(AnyType x)
Insert a new item into the queue.

Parameters:
x - the item to insert.

getFront

AnyType 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

AnyType 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

boolean isEmpty()
Test if the queue is logically empty.

Returns:
true if empty, false otherwise.

makeEmpty

void makeEmpty()
Make the queue logically empty.