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:

    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.

    See Also:
    Serialized Form
    • Method Detail

      • offer

        public boolean offer​(E obj)
        Specified by:
        offer in interface Queue<E>
      • poll

        public E poll()
        Specified by:
        poll in interface Queue<E>
      • peek

        public E peek()
        Specified by:
        peek in interface Queue<E>
      • element

        public E element()
        Specified by:
        element in interface Queue<E>
      • remove

        public E remove()
        Specified by:
        remove in interface Queue<E>