class BlockingQueueExtensions extends Object
Extensions to the BlockingQueue interface.
| Constructor and description |
|---|
BlockingQueueExtensions() |
| Type Params | Return Type | Name and description |
|---|---|---|
<E> |
static List<E> |
drain(BlockingQueue<E> self, List<E> target)Drains all available elements, either to a new list or a supplied one, which is also returned. |
<E> |
static List<E> |
drain(BlockingQueue<E> self, List<E> target, int maxElements)Drain at most the given number of elements, either to a new list or a supplied one, which is also returned. |
Drains all available elements, either to a new list or a supplied one, which is also returned.
Drain at most the given number of elements, either to a new list or a supplied one, which is also returned.