|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
A Sink implements the side of an event queue where QueueElements are dequeued operations only.
Method Summary | |
QueueElement |
dequeue()
Dequeues the next element, or returns null if there is
nothing left on the queue. |
QueueElement[] |
dequeue(int num)
Dequeues at most num available elements, or returns
null if there is nothing left on the queue. |
QueueElement[] |
dequeueAll()
Dequeues all available elements, or returns null if there is
nothing left on the queue. |
void |
setTimeout(long millis)
Sets the timeout on a blocking Sink. |
int |
size()
Returns the number of elements waiting in this queue. |
Method Detail |
public void setTimeout(long millis)
1
will
force all dequeue
operations to block for up to that number
of milliseconds waiting for new elements. Values below 1
will turn off blocking for Sink. This is intentional because a Sink should
never block indefinitely.public QueueElement dequeue()
null
if there is
nothing left on the queue.QueueElement
on the queuepublic QueueElement[] dequeueAll()
null
if there is
nothing left on the queue.QueueElement
s on the queuepublic QueueElement[] dequeue(int num)
num
available elements, or returns
null
if there is nothing left on the queue.num
QueueElement
s on the queuepublic int size()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |