|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectbrahms.base.util.Queue<E>
public class Queue<E>
The Queue is a generic queue used to enqueue and dequeue Objects in a thread safe way. One or more threads can add new Objects to the queue and one or more other threads can dequeue Objects from the queue.
| Constructor Summary | |
|---|---|
Queue()
Constructor, creates a new Queue. |
|
| Method Summary | |
|---|---|
java.util.List<E> |
close()
Closes the queue and releases all threads waiting for new data. |
E |
dequeue()
Removes the first element from the queue and blocks the calling thread if no data is queued. |
E |
dequeue(boolean block)
Removes the first element from the queue and blocks the calling thread if no data is queued and block = true or returns null if block = false. |
void |
enqueue(E data)
Adds the specified element to the end of the queue. |
long |
getQueueSize()
Returns the number of Objects in the queue. |
void |
open()
Opens the queue for data elements. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Queue()
| Method Detail |
|---|
public void enqueue(E data)
throws QueueException
data - the element to be queued.
QueueException - if the queue is closed.
public E dequeue()
throws QueueException
QueueException - if the queue was closed while waiting
for new objects.
public E dequeue(boolean block)
throws QueueException
block - true to have the method block until an element is enqueued,
false to not block and return null if no elements are present
QueueException - if the queue was closed while waiting
for new objects.public long getQueueSize()
public void open()
public java.util.List<E> close()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||