java.lang.Object
org.altara.util.Queue
- public class Queue
- extends java.lang.Object
Queue is a wrapper around a LinkedList providing a queue-oriented
view.
|
Constructor Summary |
Queue()
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
list
java.util.LinkedList list
isLocked
boolean isLocked
Queue
public Queue()
lock
public void lock()
- Lock the queue. A locked queue may not be dequeued from - i.e. it
will block as if it is empty even when it is full. Locking has
no effect on nb_dequeue().
unlock
public void unlock()
- Unlock the queue. Reverses the effect of a previous lock().
flush
public void flush()
- Flush the queue. Removes all elements from the queue.
enqueue
public void enqueue(java.lang.Object obj)
- Enqueue an object. This will place the object into the queue for
later in-order dequeueing.
dequeue
public java.lang.Object dequeue()
throws java.lang.InterruptedException
- Retrieve the next object from the queue. This method will
block if the queue is empty.
nb_dequeue
public java.lang.Object nb_dequeue()
- Retrieve the next object from the queue. This method will return null
if the queue is empty.
size
public int size()
- Return this queue's size.