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, java.util.concurrent.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 Summary
ModifierConstructorDescriptionprotected
Deprecated.Constructor for use by subclasses. -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract BlockingDeque
<E> delegate()
Deprecated.Returns the backing delegate instance that methods are forwarded to.int
drainTo
(Collection<? super E> c) Deprecated.int
drainTo
(Collection<? super E> c, int maxElements) Deprecated.boolean
Deprecated.boolean
offerFirst
(E e, long timeout, TimeUnit unit) Deprecated.boolean
Deprecated.Deprecated.Deprecated.Deprecated.void
Deprecated.void
Deprecated.void
Deprecated.int
Deprecated.take()
Deprecated.Deprecated.takeLast()
Deprecated.Methods inherited from class com.google.common.collect.ForwardingDeque
addFirst, addLast, descendingIterator, getFirst, getLast, offerFirst, offerLast, peekFirst, peekLast, pollFirst, pollLast, pop, push, removeFirst, removeFirstOccurrence, removeLast, removeLastOccurrence
Methods inherited from class com.google.common.collect.ForwardingQueue
element, offer, peek, poll, remove, standardOffer, standardPeek, standardPoll
Methods inherited from class com.google.common.collect.ForwardingCollection
add, addAll, clear, contains, containsAll, isEmpty, iterator, remove, removeAll, retainAll, size, standardAddAll, standardClear, standardContains, standardContainsAll, standardIsEmpty, standardRemove, standardRemoveAll, standardRetainAll, standardToArray, standardToArray, standardToString, toArray, toArray
Methods inherited from class com.google.common.collect.ForwardingObject
toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.concurrent.BlockingDeque
add, addFirst, addLast, contains, element, iterator, offer, offerFirst, offerLast, peek, poll, push, remove, remove, removeFirstOccurrence, removeLastOccurrence, size
Methods inherited from interface java.util.Collection
clear, containsAll, equals, hashCode, isEmpty, parallelStream, removeAll, removeIf, retainAll, spliterator, stream, toArray, toArray, toArray
-
Constructor Details
-
ForwardingBlockingDeque
-
-
Method Details
-
delegate
Deprecated.Description copied from class:ForwardingObject
Returns 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:
delegate
in classForwardingDeque<E>
-
remainingCapacity
Deprecated.- Specified by:
remainingCapacity
in interfaceBlockingQueue<E>
-
putFirst
Deprecated.- Specified by:
putFirst
in interfaceBlockingDeque<E>
- Throws:
InterruptedException
-
putLast
Deprecated.- Specified by:
putLast
in interfaceBlockingDeque<E>
- Throws:
InterruptedException
-
offerFirst
Deprecated.- Specified by:
offerFirst
in interfaceBlockingDeque<E>
- Throws:
InterruptedException
-
offerLast
Deprecated.- Specified by:
offerLast
in interfaceBlockingDeque<E>
- Throws:
InterruptedException
-
takeFirst
Deprecated.- Specified by:
takeFirst
in interfaceBlockingDeque<E>
- Throws:
InterruptedException
-
takeLast
Deprecated.- Specified by:
takeLast
in interfaceBlockingDeque<E>
- Throws:
InterruptedException
-
pollFirst
Deprecated.- Specified by:
pollFirst
in interfaceBlockingDeque<E>
- Throws:
InterruptedException
-
pollLast
Deprecated.- Specified by:
pollLast
in interfaceBlockingDeque<E>
- Throws:
InterruptedException
-
put
Deprecated.- Specified by:
put
in interfaceBlockingDeque<E>
- Specified by:
put
in interfaceBlockingQueue<E>
- Throws:
InterruptedException
-
offer
Deprecated.- Specified by:
offer
in interfaceBlockingDeque<E>
- Specified by:
offer
in interfaceBlockingQueue<E>
- Throws:
InterruptedException
-
take
Deprecated.- Specified by:
take
in interfaceBlockingDeque<E>
- Specified by:
take
in interfaceBlockingQueue<E>
- Throws:
InterruptedException
-
poll
Deprecated.- Specified by:
poll
in interfaceBlockingDeque<E>
- Specified by:
poll
in interfaceBlockingQueue<E>
- Throws:
InterruptedException
-
drainTo
Deprecated.- Specified by:
drainTo
in interfaceBlockingQueue<E>
-
drainTo
Deprecated.- Specified by:
drainTo
in interfaceBlockingQueue<E>
-
com.google.common.util.concurrent
. Please useForwardingBlockingDeque
instead.