org.apache.java.util
Class SimpleQueue

java.lang.Object
  |
  +--org.apache.java.util.SimpleQueue

public class SimpleQueue
extends java.lang.Object

Implements single queue.

Extremely simplified queue implementation, cut to fit into the background logging.

Version:
$Revision: 1.7 $ $Date: 1999/09/08 22:02:52 $

Field Summary
private  java.util.Vector theQueue
          Data holder.
 
Constructor Summary
SimpleQueue()
          Default constructor.
 
Method Summary
 java.lang.Object get()
          Get the object waiting in the queue.
 boolean isEmpty()
          Find out if the queue is empty.
 java.lang.Object peekAtHead()
          Get the object at the head of the queue.
 void put(java.lang.Object toPut)
          Put the object into the queue.
 int size()
          Get the number of elements in the queue.
 java.lang.Object waitObject()
          Wait until the object appears in the queue, then return it.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

theQueue

private java.util.Vector theQueue
Data holder.
Constructor Detail

SimpleQueue

public SimpleQueue()
Default constructor.
Method Detail

put

public void put(java.lang.Object toPut)
Put the object into the queue.
Parameters:
toPut - the object to put

get

public java.lang.Object get()
Get the object waiting in the queue. Asynchronous.
Returns:
null if the queue is empty.

waitObject

public java.lang.Object waitObject()
                            throws java.lang.InterruptedException
Wait until the object appears in the queue, then return it.
Returns:
The object from the queue.
Throws:
java.lang.InterruptedException - if this thread was interrupted by another thread.
See Also:
get()

peekAtHead

public java.lang.Object peekAtHead()
Get the object at the head of the queue.
Returns:
null if the queue is empty.

isEmpty

public boolean isEmpty()
Find out if the queue is empty.

size

public int size()
Get the number of elements in the queue.