@ThreadSafe public class ConcurrentLoadingQueue<E> extends ConcurrentLinkedQueue<E>
ConcurrentLinkedQueue that uses a specified supplier
Callable to dynamically load elements into the queue when a read
request is made and the queue is empty.| Modifier and Type | Method and Description |
|---|---|
static <E> ConcurrentLoadingQueue<E> |
create(Callable<E> supplier)
Return a new
ConcurrentLoadingQueue that uses the
supplier to populate the queue on demand. |
static <E> ConcurrentLoadingQueue<E> |
create(Collection<E> collection,
Callable<E> supplier)
Return a new
ConcurrentLoadingQueue that initially contains the
elements of the given collection in traversal order of the
collection's iterator and uses the supplier to populate the queue
on demand. |
E |
peek() |
E |
poll() |
add, addAll, contains, isEmpty, iterator, offer, remove, size, spliterator, toArray, toArrayclear, element, removecontainsAll, removeAll, retainAll, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitclear, containsAll, equals, hashCode, parallelStream, removeAll, removeIf, retainAll, streampublic static <E> ConcurrentLoadingQueue<E> create(Callable<E> supplier)
ConcurrentLoadingQueue that uses the
supplier to populate the queue on demand.supplier - public static <E> ConcurrentLoadingQueue<E> create(Collection<E> collection, Callable<E> supplier)
ConcurrentLoadingQueue that initially contains the
elements of the given collection in traversal order of the
collection's iterator and uses the supplier to populate the queue
on demand.collection - supplier - public E peek()