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>
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.- Since:
- 4.0
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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.ForwardingQueue
element, offer, peek, poll, remove
-
Methods inherited from class com.google.common.collect.ForwardingCollection
add, addAll, clear, contains, containsAll, isEmpty, iterator, remove, removeAll, retainAll, size, toArray, toArray
-
Methods inherited from class com.google.common.collect.ForwardingObject
toString
-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
-
-
-
Method Detail
-
drainTo
public int drainTo(java.util.Collection<? super E> c, int maxElements)
- Specified by:
drainToin interfacejava.util.concurrent.BlockingQueue<E>
-
drainTo
public int drainTo(java.util.Collection<? super E> c)
- Specified by:
drainToin interfacejava.util.concurrent.BlockingQueue<E>
-
offer
public boolean offer(E e, long timeout, java.util.concurrent.TimeUnit unit) throws java.lang.InterruptedException
- Specified by:
offerin interfacejava.util.concurrent.BlockingQueue<E>- Throws:
java.lang.InterruptedException
-
poll
public E poll(long timeout, java.util.concurrent.TimeUnit unit) throws java.lang.InterruptedException
- Specified by:
pollin interfacejava.util.concurrent.BlockingQueue<E>- Throws:
java.lang.InterruptedException
-
put
public void put(E e) throws java.lang.InterruptedException
- Specified by:
putin interfacejava.util.concurrent.BlockingQueue<E>- Throws:
java.lang.InterruptedException
-
remainingCapacity
public int remainingCapacity()
- Specified by:
remainingCapacityin interfacejava.util.concurrent.BlockingQueue<E>
-
-