ch.elca.dependency.util
Interface Queue

All Known Implementing Classes:
ArrayQueue

public interface Queue

Definition of the standard Queue interface.

Version:
1.0-beta
Author:
Christoph Trutmann

Method Summary
 java.lang.Object dequeue()
          Remove and return from the queue the object at the front.
 void enqueue(java.lang.Object o)
          Insert object o at the rear of the queue.
 java.lang.Object front()
          Return, but do not remove, the front object in the queue.
 boolean isEmpty()
          Return a boolean value that indicates whether the queue is empty.
 int size()
          Return the number of objects in the queue.
 

Method Detail

enqueue

public void enqueue(java.lang.Object o)
             throws QueueFullException
Insert object o at the rear of the queue.

Parameters:
o - Object to be inserted at the rear of the queue.
Throws:
QueueFullException - If the queue is full.

dequeue

public java.lang.Object dequeue()
                         throws QueueEmptyException
Remove and return from the queue the object at the front.

Returns:
Object removed from the front of the queue.
Throws:
QueueEmptyException - If the queue is empty.

size

public int size()
Return the number of objects in the queue.

Returns:
Number of objects in the queue.

isEmpty

public boolean isEmpty()
Return a boolean value that indicates whether the queue is empty.

Returns:
True if the queue is empty.

front

public java.lang.Object front()
                       throws QueueEmptyException
Return, but do not remove, the front object in the queue. An error occurs if the qeue is empty.

Returns:
Object in front of the queue.
Throws:
QueueEmptyException - If the queue is empty.


Copyright © 2003 ELCA Informatique SA. All Rights Reserved.