All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class magician.Node.SchedQueue

java.lang.Object
   |
   +----magician.Node.SchedQueue

public class SchedQueue
extends Object
SchedQueue implements a simple queue mechanism. Allows for enumeration of the elements.


Variable Index

 o head
 o length
 o tail

Constructor Index

 o SchedQueue()

Method Index

 o dequeue()
Dequeue the oldest object on the queue.
 o dequeue(long)
Dequeue the oldest object on the queue.
 o dump(String)
writes objects to output with message
 o elements()
Returns an enumeration of the elements in Last-In, First-Out order.
 o enqueue(Object)
Enqueue an object.
 o isEmpty()
Is the queue empty?
 o reverseElements()
Returns an enumeration of the elements in First-In, First-Out order.

Variables

 o length
 int length
 o head
 QueueElement head
 o tail
 QueueElement tail

Constructors

 o SchedQueue
 public SchedQueue()

Methods

 o enqueue
 public synchronized void enqueue(Object obj)
Enqueue an object.

Parameters:
obj - object to be queued
 o dequeue
 public Object dequeue() throws InterruptedException
Dequeue the oldest object on the queue. Will wait indefinitely.

Returns:
the oldest object on the queue.
Throws: InterruptedException
if operation is interrupted
 o dequeue
 public synchronized Object dequeue(long timeOut) throws InterruptedException
Dequeue the oldest object on the queue.

Parameters:
timeOut - the number of milliseconds to wait for something to arrive.
Returns:
the oldest object on the queue.
Throws: InterruptedException
if operation is interrupted
 o isEmpty
 public boolean isEmpty()
Is the queue empty?

Returns:
true if the queue is empty.
 o elements
 public final synchronized Enumeration elements()
Returns an enumeration of the elements in Last-In, First-Out order. Use the Enumeration methods on the returned object to fetch the elements sequentially.

Returns:
an enumeration of objects in the queue
 o reverseElements
 public final synchronized Enumeration reverseElements()
Returns an enumeration of the elements in First-In, First-Out order. Use the Enumeration methods on the returned object to fetch the elements sequentially.

Returns:
an enumeration of objects in the queue
 o dump
 public synchronized void dump(String msg)
writes objects to output with message

Parameters:
msg - the message to prepended to output

All Packages  Class Hierarchy  This Package  Previous  Next  Index
1