CITS2200
Interface Queue


public interface Queue

Queue interface.


Method Summary
 Object dequeue()
          remove the item at the front of the queue
 void enqueue(Object a)
          insert an item at the back of the queue
 Object examine()
          examine the item at the front of the queue
 boolean isEmpty()
          test whether the queue is empty
 

Method Detail

isEmpty

boolean isEmpty()
test whether the queue is empty

Returns:
true if the queue is empty, false otherwise

enqueue

void enqueue(Object a)
insert an item at the back of the queue

Parameters:
a - the item to insert

examine

Object examine()
               throws Underflow
examine the item at the front of the queue

Returns:
the first item
Throws:
Underflow - if the queue is empty

dequeue

Object dequeue()
               throws Underflow
remove the item at the front of the queue

Returns:
the removed item
Throws:
Underflow - if the queue is empty