public class DelegatingBlockingQueue<T> extends java.lang.Object implements BlockingQueue4<T>
| Constructor and Description |
|---|
DelegatingBlockingQueue(BlockingQueue4<T> queue) |
| Modifier and Type | Method and Description |
|---|---|
void |
add(T obj) |
int |
drainTo(Collection4<T> list)
Removes all the available elements in the queue to the colletion passed
as argument.
|
boolean |
hasNext() |
Iterator4 |
iterator() |
T |
next() |
T |
next(long timeout)
Returns the next queued item or waits for it to be available for the
maximum of
timeout miliseconds. |
T |
nextMatching(Predicate4<T> condition)
Returns the next object in the queue that matches the specified condition.
|
void |
stop() |
public DelegatingBlockingQueue(BlockingQueue4<T> queue)
public T next(long timeout) throws BlockingQueueStoppedException
BlockingQueue4
Returns the next queued item or waits for it to be available for the
maximum of timeout miliseconds.
next in interface BlockingQueue4<T>timeout - maximum time to wait for the next avilable item in milisecondsnull if timeout is
reachedBlockingQueueStoppedException - if the BlockingQueue4.stop() is called.public T nextMatching(Predicate4<T> condition)
Queue4nextMatching in interface Queue4<T>condition - the object must satisfy to be returnedpublic void stop()
stop in interface BlockingQueue4<T>public int drainTo(Collection4<T> list)
BlockingQueue4Removes all the available elements in the queue to the colletion passed as argument.
It will block until at least one element is available.
drainTo in interface BlockingQueue4<T>