Class ForwardingDeque<E extends @Nullable java.lang.Object>

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

    public abstract class ForwardingDeque<E extends @Nullable java.lang.Object>
    extends ForwardingQueue<E>
    implements java.util.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.

    Kurt Alfred Kluever