Class 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 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.

    Since:
    4.0
    See Also:
    Serialized Form
    • Constructor Detail

      • AbstractQueueDecorator

        protected AbstractQueueDecorator()
        Constructor only used in deserialization, do not use otherwise.
      • AbstractQueueDecorator

        protected AbstractQueueDecorator​(Queue<E> queue)
        Constructor that wraps (not copies).
        Parameters:
        queue - the queue to decorate, must not be null
        Throws:
        NullPointerException - if queue is null