Class ForwardingBlockingQueue<E>
java.lang.Object
com.google.common.collect.ForwardingObject
com.google.common.collect.ForwardingCollection<E>
com.google.common.collect.ForwardingQueue<E>
com.google.common.util.concurrent.ForwardingBlockingQueue<E>
- Type Parameters:
- E- the type of elements held in this collection
- All Implemented Interfaces:
- Iterable<E>,- Collection<E>,- BlockingQueue<E>,- Queue<E>
@GwtIncompatible
public abstract class ForwardingBlockingQueue<E>
extends ForwardingQueue<E>
implements BlockingQueue<E>
A 
BlockingQueue which forwards all its method calls to another BlockingQueue.
 Subclasses should override one or more methods to modify the behavior of the backing collection
 as desired per the decorator
 pattern.
 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 ForwardingBlockingQueue.
- Since:
- 4.0
- Author:
- Raimundo Mirisola
- 
Constructor SummaryConstructorsModifierConstructorDescriptionprotectedConstructor for use by subclasses.
- 
Method SummaryModifier and TypeMethodDescriptionprotected abstract BlockingQueue<E> delegate()Returns the backing delegate instance that methods are forwarded to.intdrainTo(Collection<? super E> c) intdrainTo(Collection<? super E> c, int maxElements) booleanvoidinttake()Methods inherited from class com.google.common.collect.ForwardingQueueelement, offer, peek, poll, remove, standardOffer, standardPeek, standardPollMethods inherited from class com.google.common.collect.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 com.google.common.collect.ForwardingObjecttoStringMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.concurrent.BlockingQueueadd, contains, offer, removeMethods inherited from interface java.util.CollectionaddAll, clear, containsAll, equals, hashCode, isEmpty, iterator, parallelStream, removeAll, removeIf, retainAll, size, spliterator, stream, toArray, toArray, toArray
- 
Constructor Details- 
ForwardingBlockingQueueprotected ForwardingBlockingQueue()Constructor for use by subclasses.
 
- 
- 
Method Details- 
delegateDescription 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- ForwardingQueue<E>
 
- 
drainTo- Specified by:
- drainToin interface- BlockingQueue<E>
 
- 
drainTo- Specified by:
- drainToin interface- BlockingQueue<E>
 
- 
offer@CanIgnoreReturnValue public boolean offer(E e, long timeout, TimeUnit unit) throws InterruptedException - Specified by:
- offerin interface- BlockingQueue<E>
- Throws:
- InterruptedException
 
- 
poll@CanIgnoreReturnValue public @Nullable E poll(long timeout, TimeUnit unit) throws InterruptedException - Specified by:
- pollin interface- BlockingQueue<E>
- Throws:
- InterruptedException
 
- 
put- Specified by:
- putin interface- BlockingQueue<E>
- Throws:
- InterruptedException
 
- 
remainingCapacitypublic int remainingCapacity()- Specified by:
- remainingCapacityin interface- BlockingQueue<E>
 
- 
take- Specified by:
- takein interface- BlockingQueue<E>
- Throws:
- InterruptedException
 
 
-