| Modifier and Type | Method and Description |
|---|---|
static <E> int |
blockingDrain(BlockingQueue<E> queue,
Collection<? super E> buffer)
Perform the
BlockingQueue.drainTo(Collection) operation, but
block indefinitely until at least one element is available. |
static <E> int |
blockingDrain(BlockingQueue<E> queue,
Collection<? super E> buffer,
long timeout,
TimeUnit unit)
Perform the
BlockingQueue.drainTo(Collection) operation, but
block for the specified timeout until at least one element is
available. |
static <T> Queue<T> |
newSingleThreadedQueue()
Return a simple
Queue that can be used in a single thread. |
public static <T> Queue<T> newSingleThreadedQueue()
Queue that can be used in a single thread.Queuepublic static <E> int blockingDrain(BlockingQueue<E> queue, Collection<? super E> buffer) throws InterruptedException
BlockingQueue.drainTo(Collection) operation, but
block indefinitely until at least one element is available.queue - the BlockingQueue in which to perform the
drainTo methodbuffer - the collection into which the elements are drainedInterruptedExceptionpublic static <E> int blockingDrain(BlockingQueue<E> queue, Collection<? super E> buffer, long timeout, TimeUnit unit)
BlockingQueue.drainTo(Collection) operation, but
block for the specified timeout until at least one element is
available.queue - the BlockingQueue in which to perform the
drainTo methodbuffer - the collection into which the elements are drained