All Packages Class Hierarchy This Package Previous Next Index
Class semper.util.queue.Queue
java.lang.Object
|
+----semper.util.queue.Queue
- public class Queue
- extends Object
Implements a FIFO queue.
- Version:
- beta-1.0, 26.7.96
- Author:
- Mehdi Nassehi
-
Queue()
- Constructs a queue.
-
dequeue()
- Dequeues an item from the queue.
-
enqueue(Object)
- Enqueues an item into the queue.
-
inspect()
- Returns the value at the head of the queue without dequeueing it.
-
isEmpty()
- Returns true if the queue is empty.
Queue
public Queue()
- Constructs a queue.
enqueue
public synchronized void enqueue(Object item)
- Enqueues an item into the queue.
- Parameters:
- item - item to be enqueued
inspect
public Object inspect()
- Returns the value at the head of the queue without dequeueing it.
- Returns:
- the item at the head of the queue
- Throws: EmptyQueueException
- If the queue is empty.
dequeue
public synchronized Object dequeue()
- Dequeues an item from the queue.
- Returns:
- the item at the head of the queue
- Throws: EmptyQueueException
- If the queue is empty.
isEmpty
public boolean isEmpty()
- Returns true if the queue is empty.
All Packages Class Hierarchy This Package Previous Next Index