E
- the type of the elements in the queuepublic abstract class AbstractQueueDecorator<E> extends AbstractCollectionDecorator<E> implements Queue<E>
Queue
to provide additional behaviour.
Methods are forwarded directly to the decorated queue.
This implementation does not forward the hashCode and equals methods through to the backing object, but relies on Object's implementation. This is necessary as some Queue implementations, e.g. LinkedList, have custom a equals implementation for which symmetry can not be preserved. See class javadoc of AbstractCollectionDecorator for more information.
Modifier | Constructor and Description |
---|---|
protected |
AbstractQueueDecorator()
Constructor only used in deserialization, do not use otherwise.
|
protected |
AbstractQueueDecorator(Queue<E> queue)
Constructor that wraps (not copies).
|
Modifier and Type | Method and Description |
---|---|
protected Queue<E> |
decorated()
Gets the queue being decorated.
|
E |
element() |
boolean |
offer(E obj) |
E |
peek() |
E |
poll() |
E |
remove() |
add, addAll, clear, contains, containsAll, isEmpty, iterator, remove, removeAll, retainAll, setCollection, size, toArray, toArray, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
addAll, clear, contains, containsAll, equals, hashCode, isEmpty, iterator, parallelStream, remove, removeAll, removeIf, retainAll, size, spliterator, stream, toArray, toArray
protected AbstractQueueDecorator()
protected AbstractQueueDecorator(Queue<E> queue)
queue
- the queue to decorate, must not be nullNullPointerException
- if queue is nullCopyright © 2001–2018 The Apache Software Foundation. All rights reserved.