Class AbstractQueueDecorator<E>
java.lang.Object
org.apache.commons.collections4.collection.AbstractCollectionDecorator<E>
org.apache.commons.collections4.queue.AbstractQueueDecorator<E>
- Type Parameters:
E
- the type of the elements in the queue
- All Implemented Interfaces:
Serializable
,Iterable<E>
,Collection<E>
,Queue<E>
- Direct Known Subclasses:
UnmodifiableQueue
public abstract class AbstractQueueDecorator<E>
extends AbstractCollectionDecorator<E>
implements Queue<E>
Decorates another
Queue
to provide additional behavior.
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 a custom equals implementation for which symmetry cannot be preserved. See class Javadoc of AbstractCollectionDecorator for more information.
- Since:
- 4.0
- See Also:
-
Constructor Summary
ModifierConstructorDescriptionprotected
Constructor only used in deserialization, do not use otherwise.protected
AbstractQueueDecorator
(Queue<E> queue) Constructor that wraps (not copies). -
Method Summary
Methods inherited from class org.apache.commons.collections4.collection.AbstractCollectionDecorator
add, addAll, clear, contains, containsAll, isEmpty, iterator, remove, removeAll, removeIf, retainAll, setCollection, size, toArray, toArray, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.Collection
addAll, clear, contains, containsAll, equals, hashCode, isEmpty, iterator, parallelStream, remove, removeAll, removeIf, retainAll, size, spliterator, stream, toArray, toArray
-
Constructor Details
-
AbstractQueueDecorator
protected AbstractQueueDecorator()Constructor only used in deserialization, do not use otherwise. -
AbstractQueueDecorator
Constructor that wraps (not copies).- Parameters:
queue
- the queue to decorate, must not be null- Throws:
NullPointerException
- if queue is null
-
-
Method Details
-
decorated
Gets the queue being decorated.- Overrides:
decorated
in classAbstractCollectionDecorator<E>
- Returns:
- the decorated queue
-
element
-
offer
-
peek
-
poll
-
remove
-