com.google.common.util.concurrent
. Please use ForwardingBlockingDeque
instead. This class is scheduled
for deletion in January 2019.@Deprecated @GwtIncompatible public abstract class ForwardingBlockingDeque<E> extends ForwardingDeque<E> implements BlockingDeque<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.
Modifier | Constructor and Description |
---|---|
protected |
ForwardingBlockingDeque()
Deprecated.
Constructor for use by subclasses.
|
Modifier and Type | Method and Description |
---|---|
protected 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 |
offer(E e,
long timeout,
TimeUnit unit)
Deprecated.
|
boolean |
offerFirst(E e,
long timeout,
TimeUnit unit)
Deprecated.
|
boolean |
offerLast(E e,
long timeout,
TimeUnit unit)
Deprecated.
|
E |
poll(long timeout,
TimeUnit unit)
Deprecated.
|
E |
pollFirst(long timeout,
TimeUnit unit)
Deprecated.
|
E |
pollLast(long timeout,
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.
|
addFirst, addLast, descendingIterator, getFirst, getLast, offerFirst, offerLast, peekFirst, peekLast, pollFirst, pollLast, pop, push, removeFirst, removeFirstOccurrence, removeLast, removeLastOccurrence
element, offer, peek, poll, remove, standardOffer, standardPeek, standardPoll
add, addAll, clear, contains, containsAll, isEmpty, iterator, remove, removeAll, retainAll, size, standardAddAll, standardClear, standardContains, standardContainsAll, standardIsEmpty, standardRemove, standardRemoveAll, standardRetainAll, standardToArray, standardToArray, standardToString, toArray, toArray
toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
add, addFirst, addLast, contains, element, iterator, offer, offerFirst, offerLast, peek, poll, push, remove, remove, removeFirstOccurrence, removeLastOccurrence, size
descendingIterator, getFirst, getLast, peekFirst, peekLast, pollFirst, pollLast, pop, removeFirst, removeLast
addAll, clear, containsAll, equals, hashCode, isEmpty, parallelStream, removeAll, removeIf, retainAll, spliterator, stream, toArray, toArray
protected ForwardingBlockingDeque()
protected abstract BlockingDeque<E> delegate()
ForwardingObject
ForwardingSet.delegate()
. Concrete subclasses override this method to supply
the instance being decorated.delegate
in class ForwardingDeque<E>
public int remainingCapacity()
remainingCapacity
in interface BlockingQueue<E>
public void putFirst(E e) throws InterruptedException
putFirst
in interface BlockingDeque<E>
InterruptedException
public void putLast(E e) throws InterruptedException
putLast
in interface BlockingDeque<E>
InterruptedException
public boolean offerFirst(E e, long timeout, TimeUnit unit) throws InterruptedException
offerFirst
in interface BlockingDeque<E>
InterruptedException
public boolean offerLast(E e, long timeout, TimeUnit unit) throws InterruptedException
offerLast
in interface BlockingDeque<E>
InterruptedException
public E takeFirst() throws InterruptedException
takeFirst
in interface BlockingDeque<E>
InterruptedException
public E takeLast() throws InterruptedException
takeLast
in interface BlockingDeque<E>
InterruptedException
public E pollFirst(long timeout, TimeUnit unit) throws InterruptedException
pollFirst
in interface BlockingDeque<E>
InterruptedException
public E pollLast(long timeout, TimeUnit unit) throws InterruptedException
pollLast
in interface BlockingDeque<E>
InterruptedException
public void put(E e) throws InterruptedException
put
in interface BlockingDeque<E>
put
in interface BlockingQueue<E>
InterruptedException
public boolean offer(E e, long timeout, TimeUnit unit) throws InterruptedException
offer
in interface BlockingDeque<E>
offer
in interface BlockingQueue<E>
InterruptedException
public E take() throws InterruptedException
take
in interface BlockingDeque<E>
take
in interface BlockingQueue<E>
InterruptedException
public E poll(long timeout, TimeUnit unit) throws InterruptedException
poll
in interface BlockingDeque<E>
poll
in interface BlockingQueue<E>
InterruptedException
public int drainTo(Collection<? super E> c)
drainTo
in interface BlockingQueue<E>
public int drainTo(Collection<? super E> c, int maxElements)
drainTo
in interface BlockingQueue<E>
Copyright © 2010–2017. All rights reserved.