E
- The type of objects in this queuepublic class PackingQueue<E> extends LinkedList<E>
LinkedList
,
Serialized FormmodCount
Constructor and Description |
---|
PackingQueue(int maxSize,
Consumer<E> onConsume)
Initializes this
PackingQueue for use |
PackingQueue(int maxSize,
Consumer<E> onConsume,
boolean threaded)
Initializes this
PackingQueue for use |
Modifier and Type | Method and Description |
---|---|
boolean |
add(E e) |
void |
addFirst(E e) |
void |
addLast(E e) |
void |
flush()
Flushes the contents of this
PackingQueue and calls upon the
Consumer passed in upon the construction of this queue. |
add, addAll, addAll, clear, clone, contains, descendingIterator, element, get, getFirst, getLast, indexOf, lastIndexOf, listIterator, offer, offerFirst, offerLast, peek, peekFirst, peekLast, poll, pollFirst, pollLast, pop, push, remove, remove, remove, removeFirst, removeFirstOccurrence, removeLast, removeLastOccurrence, set, size, spliterator, toArray, toArray
iterator
equals, hashCode, listIterator, removeRange, subList
containsAll, isEmpty, removeAll, retainAll, toString
finalize, getClass, notify, notifyAll, wait, wait, wait
containsAll, equals, hashCode, isEmpty, iterator, listIterator, removeAll, replaceAll, retainAll, sort, subList
parallelStream, removeIf, stream
public PackingQueue(int maxSize, Consumer<E> onConsume)
PackingQueue
for usemaxSize
- The maximum size before flushing elementsonConsume
- How to handle each element before removing itPackingQueue(int, Consumer, boolean)
public PackingQueue(int maxSize, Consumer<E> onConsume, boolean threaded)
PackingQueue
for usemaxSize
- The maximum size before flushing elementsonConsume
- How to handle each element before removing itthreaded
- true
to execute the element flushing on another
threadpublic boolean add(E e)
public void addFirst(E e)
public void addLast(E e)
public void flush()
PackingQueue
and calls upon the
Consumer
passed in upon the construction of this queue. This
method is safe to call from multiple threadsCopyright © 2015. All rights reserved.