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:
- java.lang.Iterable<E>,- java.util.Collection<E>,- java.util.concurrent.BlockingQueue<E>,- java.util.Queue<E>
 
 @GwtIncompatible public abstract class ForwardingBlockingQueue<E> extends ForwardingQueue<E> implements java.util.concurrent.BlockingQueue<E> ABlockingQueuewhich forwards all its method calls to anotherBlockingQueue. Subclasses should override one or more methods to modify the behavior of the backing collection as desired per the decorator pattern.defaultmethod warning: This class does not forward calls todefaultmethods. Instead, it inherits their default implementations. When those implementations invoke methods, they invoke methods on theForwardingBlockingQueue.- Since:
- 4.0
- Author:
- Raimundo Mirisola
 
- 
- 
Constructor SummaryConstructors Modifier Constructor Description protectedForwardingBlockingQueue()Constructor for use by subclasses.
 - 
Method SummaryAll Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract java.util.concurrent.BlockingQueue<E>delegate()Returns the backing delegate instance that methods are forwarded to.intdrainTo(java.util.Collection<? super E> c)intdrainTo(java.util.Collection<? super E> c, int maxElements)booleanoffer(E e, long timeout, java.util.concurrent.TimeUnit unit)Epoll(long timeout, java.util.concurrent.TimeUnit unit)voidput(E e)intremainingCapacity()Etake()- 
Methods inherited from class com.google.common.collect.ForwardingQueueelement, offer, peek, poll, remove, standardOffer, standardPeek, standardPoll
 - 
Methods 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, toArray
 - 
Methods inherited from class com.google.common.collect.ForwardingObjecttoString
 - 
Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
- 
 
- 
- 
- 
Constructor Detail- 
ForwardingBlockingQueueprotected ForwardingBlockingQueue() Constructor for use by subclasses.
 
- 
 - 
Method Detail- 
delegateprotected abstract java.util.concurrent.BlockingQueue<E> delegate() 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- ForwardingQueue<E>
 
 - 
drainTo@CanIgnoreReturnValue public int drainTo(java.util.Collection<? super E> c, int maxElements) - Specified by:
- drainToin interface- java.util.concurrent.BlockingQueue<E>
 
 - 
drainTo@CanIgnoreReturnValue public int drainTo(java.util.Collection<? super E> c) - Specified by:
- drainToin interface- java.util.concurrent.BlockingQueue<E>
 
 - 
offer@CanIgnoreReturnValue public boolean offer(E e, long timeout, java.util.concurrent.TimeUnit unit) throws java.lang.InterruptedException - Specified by:
- offerin interface- java.util.concurrent.BlockingQueue<E>
- Throws:
- java.lang.InterruptedException
 
 - 
poll@CanIgnoreReturnValue @CheckForNull public E poll(long timeout, java.util.concurrent.TimeUnit unit) throws java.lang.InterruptedException - Specified by:
- pollin interface- java.util.concurrent.BlockingQueue<E>
- Throws:
- java.lang.InterruptedException
 
 - 
putpublic void put(E e) throws java.lang.InterruptedException - Specified by:
- putin interface- java.util.concurrent.BlockingQueue<E>
- Throws:
- java.lang.InterruptedException
 
 - 
remainingCapacitypublic int remainingCapacity() - Specified by:
- remainingCapacityin interface- java.util.concurrent.BlockingQueue<E>
 
 - 
take@CanIgnoreReturnValue public E take() throws java.lang.InterruptedException - Specified by:
- takein interface- java.util.concurrent.BlockingQueue<E>
- Throws:
- java.lang.InterruptedException
 
 
- 
 
-