Class ForwardingDeque<E extends @Nullable Object>

  • All Implemented Interfaces:
    Iterable<E>, Collection<E>, Deque<E>, Queue<E>
    Direct Known Subclasses:
    ForwardingBlockingDeque, ForwardingBlockingDeque

    @GwtIncompatible
    public abstract class ForwardingDeque<E extends @Nullable Object>
    extends ForwardingQueue<E>
    implements Deque<E>
    A deque which forwards all its method calls to another deque. Subclasses should override one or more methods to modify the behavior of the backing deque as desired per the decorator pattern.

    Warning: The methods of ForwardingDeque forward indiscriminately to the methods of the delegate. For example, overriding ForwardingCollection.add(E) alone will not change the behavior of ForwardingQueue.offer(E) which can lead to unexpected behavior. In this case, you should override offer as well.

    default method warning: This class does not forward calls to default methods. Instead, it inherits their default implementations. When those implementations invoke methods, they invoke methods on the ForwardingDeque.

    Since:
    12.0
    Author:
    Kurt Alfred Kluever