edu.trinity.cs.bmassing.adt1
Interface SimpleQueue<E>

All Known Implementing Classes:
FixedArrayQueue

public interface SimpleQueue<E>

Interface for queues. (This provides a common interface for potentially different implementations, but you could certainly write a stack class without it.)


Method Summary
 E dequeue()
          Removes an element from the queue.
 boolean empty()
          Tells whether queue is empty.
 void enqueue(E x)
          Adds an element to the end of the queue.
 E front()
          Gets the front element of the queue (but does not remove it).
 

Method Detail

empty

boolean empty()
Tells whether queue is empty.

Returns:
true if queue is empty, false otherwise

enqueue

void enqueue(E x)
             throws QueueFullException
Adds an element to the end of the queue.

Parameters:
x - element to add
Throws:
QueueFullException - if queue is already full

dequeue

E dequeue()
          throws QueueEmptyException
Removes an element from the queue.

Returns:
(former) front element of queue
Throws:
QueueEmptyException - if queue is empty

front

E front()
        throws QueueEmptyException
Gets the front element of the queue (but does not remove it).

Returns:
front element of queue
Throws:
QueueEmptyException - if queue is empty