netwar.utils
Interface Queue

All Known Implementing Classes:
AQueue

public interface Queue

A Queue ADT

Author:
Kyle Kakligian

Method Summary
 void clear()
          Clears the queue.
 java.lang.Object dequeue()
          Dequeues an Object.
 void enqueue(java.lang.Object it)
          Enqueues an Object.
 boolean isEmpty()
          Returns whether or not the queue is empty.
 java.lang.Object peek()
          Peeks at the next Object to dequeue.
 void resize(int sz)
          Internally resizes the queue to hold at least the given number of items
 void shrink()
          Internally shrinks the memory footprint.
 

Method Detail

clear

public void clear()
Clears the queue.

enqueue

public void enqueue(java.lang.Object it)
Enqueues an Object.
Parameters:
it - The Object to enqueue.

dequeue

public java.lang.Object dequeue()
Dequeues an Object.
Returns:
The dequeued Object.

peek

public java.lang.Object peek()
Peeks at the next Object to dequeue.
Returns:
The next Object to dequeue.

isEmpty

public boolean isEmpty()
Returns whether or not the queue is empty.
Returns:
true if empty.

shrink

public void shrink()
Internally shrinks the memory footprint.

resize

public void resize(int sz)
Internally resizes the queue to hold at least the given number of items
Parameters:
sz - The minimun number of Objects for the queue.