Class ForwardingBlockingDeque<E>
- All Implemented Interfaces:
- Iterable<E>, Collection<E>, BlockingDeque<E>, BlockingQueue<E>, Deque<E>, Queue<E>, SequencedCollection<E>
BlockingDeque which forwards all its method calls to another BlockingDeque.
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 ForwardingBlockingDeque forward indiscriminately
to the methods of the delegate. For example, overriding ForwardingCollection.add(E) alone will not change
the behaviour of offer(E, long, TimeUnit) which can lead to unexpected behaviour. In this case, you should
override offer as well, either providing your own implementation, or delegating to the
provided standardOffer method.
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 ForwardingBlockingDeque.
The standard methods are not guaranteed to be thread-safe, even when all of the
methods that they depend on are thread-safe.
- Since:
- 14.0
- Author:
- Emily Soldal
- 
Constructor SummaryConstructorsModifierConstructorDescriptionprotectedDeprecated.Constructor for use by subclasses.
- 
Method SummaryModifier and TypeMethodDescriptionprotected abstract BlockingDeque<E> delegate()Deprecated.Returns the backing delegate instance that methods are forwarded to.intdrainTo(Collection<? super E> c) Deprecated.intdrainTo(Collection<? super E> c, int maxElements) Deprecated.booleanDeprecated.booleanofferFirst(E e, long timeout, TimeUnit unit) Deprecated.booleanDeprecated.Deprecated.Deprecated.Deprecated.voidDeprecated.voidDeprecated.voidDeprecated.intDeprecated.take()Deprecated.Deprecated.takeLast()Deprecated.Methods inherited from class ForwardingDequeaddFirst, addLast, descendingIterator, getFirst, getLast, offerFirst, offerLast, peekFirst, peekLast, pollFirst, pollLast, pop, push, removeFirst, removeFirstOccurrence, removeLast, removeLastOccurrenceMethods inherited from class ForwardingQueueelement, offer, peek, poll, remove, standardOffer, standardPeek, standardPollMethods inherited from class ForwardingCollectionadd, addAll, clear, contains, containsAll, isEmpty, iterator, remove, removeAll, retainAll, size, standardAddAll, standardClear, standardContains, standardContainsAll, standardIsEmpty, standardRemove, standardRemoveAll, standardRetainAll, standardToArray, standardToArray, standardToString, toArray, toArrayMethods inherited from class ForwardingObjecttoStringMethods inherited from class Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface BlockingDequeadd, addFirst, addLast, contains, element, iterator, offer, offerFirst, offerLast, peek, poll, push, remove, remove, removeFirstOccurrence, removeLastOccurrence, sizeMethods inherited from interface Collectionclear, containsAll, equals, hashCode, isEmpty, parallelStream, removeAll, removeIf, retainAll, spliterator, stream, toArray, toArray, toArray
- 
Constructor Details- 
ForwardingBlockingDequeprotected ForwardingBlockingDeque()Deprecated.Constructor for use by subclasses.
 
- 
- 
Method Details- 
delegateDeprecated.Description copied from class:ForwardingObjectReturns the backing delegate instance that methods are forwarded to. Abstract subclasses generally override this method with an abstract method that has a more specific return type, such asForwardingSet.delegate(). Concrete subclasses override this method to supply the instance being decorated.- Specified by:
- delegatein class- ForwardingDeque<E>
 
- 
remainingCapacitypublic int remainingCapacity()Deprecated.- Specified by:
- remainingCapacityin interface- BlockingQueue<E>
 
- 
putFirstDeprecated.- Specified by:
- putFirstin interface- BlockingDeque<E>
- Throws:
- InterruptedException
 
- 
putLastDeprecated.- Specified by:
- putLastin interface- BlockingDeque<E>
- Throws:
- InterruptedException
 
- 
offerFirstDeprecated.- Specified by:
- offerFirstin interface- BlockingDeque<E>
- Throws:
- InterruptedException
 
- 
offerLastDeprecated.- Specified by:
- offerLastin interface- BlockingDeque<E>
- Throws:
- InterruptedException
 
- 
takeFirstDeprecated.- Specified by:
- takeFirstin interface- BlockingDeque<E>
- Throws:
- InterruptedException
 
- 
takeLastDeprecated.- Specified by:
- takeLastin interface- BlockingDeque<E>
- Throws:
- InterruptedException
 
- 
pollFirstDeprecated.- Specified by:
- pollFirstin interface- BlockingDeque<E>
- Throws:
- InterruptedException
 
- 
pollLastDeprecated.- Specified by:
- pollLastin interface- BlockingDeque<E>
- Throws:
- InterruptedException
 
- 
putDeprecated.- Specified by:
- putin interface- BlockingDeque<E>
- Specified by:
- putin interface- BlockingQueue<E>
- Throws:
- InterruptedException
 
- 
offerDeprecated.- Specified by:
- offerin interface- BlockingDeque<E>
- Specified by:
- offerin interface- BlockingQueue<E>
- Throws:
- InterruptedException
 
- 
takeDeprecated.- Specified by:
- takein interface- BlockingDeque<E>
- Specified by:
- takein interface- BlockingQueue<E>
- Throws:
- InterruptedException
 
- 
pollDeprecated.- Specified by:
- pollin interface- BlockingDeque<E>
- Specified by:
- pollin interface- BlockingQueue<E>
- Throws:
- InterruptedException
 
- 
drainToDeprecated.- Specified by:
- drainToin interface- BlockingQueue<E>
 
- 
drainToDeprecated.- Specified by:
- drainToin interface- BlockingQueue<E>
 
 
- 
com.google.common.util.concurrent. Please useForwardingBlockingDequeinstead.