Opus5
Interface Queue

All Superinterfaces:
Comparable, Container
All Known Implementing Classes:
QueueAsLinkedList, QueueAsArray

public interface Queue
extends Container

Encapsulates methods common to all (single-ended, FIFO) queues.

Version:
$Id: Queue.java,v 3.1 1998/07/28 01:32:17 brpreiss Exp $
Author:
Bruno R. Preiss, P.Eng.

Field Summary
static java.lang.String copyright
           
 
Method Summary
 java.lang.Object dequeue()
          Dequeues and returns the object at the head of the queue.
 void enqueue(java.lang.Object object)
          Enqueues the object at the tail of the queue.
 java.lang.Object getHead()
          Returns the object at the head of the queue.
 
Methods inherited from interface Opus5.Container
accept, getCount, getEnumeration, isEmpty, isFull, purge
 
Methods inherited from interface Opus5.Comparable
compare, isEQ, isGE, isGT, isLE, isLT, isNE
 

Field Detail

copyright

public static final java.lang.String copyright
Method Detail

getHead

public java.lang.Object getHead()
Returns the object at the head of the queue.
Returns:
The object at the head of the queue.
Throws:
ContainerEmptyException - If the queue is empty.

enqueue

public void enqueue(java.lang.Object object)
Enqueues the object at the tail of the queue.
Parameters:
object - The object to be enqueued.
Throws:
ContainerFullException - If the queue is full.

dequeue

public java.lang.Object dequeue()
Dequeues and returns the object at the head of the queue.
Returns:
The object at the head of the queue.
Throws:
ContainerEmptyException - If the queue is empty.