Class ForwardingBlockingDeque<E>
- java.lang.Object
-
- com.google.common.collect.ForwardingObject
-
- com.google.common.collect.ForwardingCollection<E>
-
- com.google.common.collect.ForwardingQueue<E>
-
- com.google.common.collect.ForwardingDeque<E>
-
- com.google.common.collect.ForwardingBlockingDeque<E>
-
- All Implemented Interfaces:
java.lang.Iterable<E>
,java.util.Collection<E>
,java.util.concurrent.BlockingDeque<E>
,java.util.concurrent.BlockingQueue<E>
,java.util.Deque<E>
,java.util.Queue<E>
@Deprecated @GwtIncompatible public abstract class ForwardingBlockingDeque<E> extends ForwardingDeque<E> implements java.util.concurrent.BlockingDeque<E>
Deprecated.This class has moved tocom.google.common.util.concurrent
. Please useForwardingBlockingDeque
instead.ABlockingDeque
which forwards all its method calls to anotherBlockingDeque
. 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, overridingForwardingCollection.add(E)
alone will not change the behaviour ofoffer(E, long, java.util.concurrent.TimeUnit)
which can lead to unexpected behaviour. In this case, you should overrideoffer
as well, either providing your own implementation, or delegating to the providedstandardOffer
method.default
method warning: This class does not forward calls todefault
methods. Instead, it inherits their default implementations. When those implementations invoke methods, they invoke methods on theForwardingBlockingDeque
.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
Constructors Modifier Constructor Description protected
ForwardingBlockingDeque()
Deprecated.Constructor for use by subclasses.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected abstract java.util.concurrent.BlockingDeque<E>
delegate()
Deprecated.Returns the backing delegate instance that methods are forwarded to.int
drainTo(java.util.Collection<? super E> c)
Deprecated.int
drainTo(java.util.Collection<? super E> c, int maxElements)
Deprecated.boolean
offer(E e, long timeout, java.util.concurrent.TimeUnit unit)
Deprecated.boolean
offerFirst(E e, long timeout, java.util.concurrent.TimeUnit unit)
Deprecated.boolean
offerLast(E e, long timeout, java.util.concurrent.TimeUnit unit)
Deprecated.E
poll(long timeout, java.util.concurrent.TimeUnit unit)
Deprecated.E
pollFirst(long timeout, java.util.concurrent.TimeUnit unit)
Deprecated.E
pollLast(long timeout, java.util.concurrent.TimeUnit unit)
Deprecated.void
put(E e)
Deprecated.void
putFirst(E e)
Deprecated.void
putLast(E e)
Deprecated.int
remainingCapacity()
Deprecated.E
take()
Deprecated.E
takeFirst()
Deprecated.E
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 Detail
-
ForwardingBlockingDeque
protected ForwardingBlockingDeque()
Deprecated.Constructor for use by subclasses.
-
-
Method Detail
-
delegate
protected abstract java.util.concurrent.BlockingDeque<E> 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
public int remainingCapacity()
Deprecated.- Specified by:
remainingCapacity
in interfacejava.util.concurrent.BlockingQueue<E>
-
putFirst
public void putFirst(E e) throws java.lang.InterruptedException
Deprecated.- Specified by:
putFirst
in interfacejava.util.concurrent.BlockingDeque<E>
- Throws:
java.lang.InterruptedException
-
putLast
public void putLast(E e) throws java.lang.InterruptedException
Deprecated.- Specified by:
putLast
in interfacejava.util.concurrent.BlockingDeque<E>
- Throws:
java.lang.InterruptedException
-
offerFirst
public boolean offerFirst(E e, long timeout, java.util.concurrent.TimeUnit unit) throws java.lang.InterruptedException
Deprecated.- Specified by:
offerFirst
in interfacejava.util.concurrent.BlockingDeque<E>
- Throws:
java.lang.InterruptedException
-
offerLast
public boolean offerLast(E e, long timeout, java.util.concurrent.TimeUnit unit) throws java.lang.InterruptedException
Deprecated.- Specified by:
offerLast
in interfacejava.util.concurrent.BlockingDeque<E>
- Throws:
java.lang.InterruptedException
-
takeFirst
public E takeFirst() throws java.lang.InterruptedException
Deprecated.- Specified by:
takeFirst
in interfacejava.util.concurrent.BlockingDeque<E>
- Throws:
java.lang.InterruptedException
-
takeLast
public E takeLast() throws java.lang.InterruptedException
Deprecated.- Specified by:
takeLast
in interfacejava.util.concurrent.BlockingDeque<E>
- Throws:
java.lang.InterruptedException
-
pollFirst
@CheckForNull public E pollFirst(long timeout, java.util.concurrent.TimeUnit unit) throws java.lang.InterruptedException
Deprecated.- Specified by:
pollFirst
in interfacejava.util.concurrent.BlockingDeque<E>
- Throws:
java.lang.InterruptedException
-
pollLast
@CheckForNull public E pollLast(long timeout, java.util.concurrent.TimeUnit unit) throws java.lang.InterruptedException
Deprecated.- Specified by:
pollLast
in interfacejava.util.concurrent.BlockingDeque<E>
- Throws:
java.lang.InterruptedException
-
offer
public boolean offer(E e, long timeout, java.util.concurrent.TimeUnit unit) throws java.lang.InterruptedException
Deprecated.
-
poll
@CheckForNull public E poll(long timeout, java.util.concurrent.TimeUnit unit) throws java.lang.InterruptedException
Deprecated.
-
drainTo
public int drainTo(java.util.Collection<? super E> c)
Deprecated.- Specified by:
drainTo
in interfacejava.util.concurrent.BlockingQueue<E>
-
-