Module dev.mccue.guava.concurrent
Package dev.mccue.guava.concurrent
Class ForwardingBlockingQueue<E>
java.lang.Object
dev.mccue.guava.collect.ForwardingObject
dev.mccue.guava.collect.ForwardingCollection<E>
dev.mccue.guava.collect.ForwardingQueue<E>
dev.mccue.guava.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>
public abstract class ForwardingBlockingQueue<E>
extends dev.mccue.guava.collect.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 Summary
ConstructorsModifierConstructorDescriptionprotected
Constructor for use by subclasses. -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract BlockingQueue<E>
delegate()
int
drainTo
(Collection<? super E> c) int
drainTo
(Collection<? super E> c, int maxElements) boolean
void
int
take()
Methods inherited from class dev.mccue.guava.collect.ForwardingQueue
element, offer, peek, poll, remove, standardOffer, standardPeek, standardPoll
Methods inherited from class dev.mccue.guava.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 dev.mccue.guava.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.BlockingQueue
add, contains, offer, remove
Methods inherited from interface java.util.Collection
addAll, clear, containsAll, equals, hashCode, isEmpty, iterator, parallelStream, removeAll, removeIf, retainAll, size, spliterator, stream, toArray, toArray, toArray
-
Constructor Details
-
ForwardingBlockingQueue
protected ForwardingBlockingQueue()Constructor for use by subclasses.
-
-
Method Details
-
delegate
- Specified by:
delegate
in classdev.mccue.guava.collect.ForwardingQueue<E>
-
drainTo
- Specified by:
drainTo
in interfaceBlockingQueue<E>
-
drainTo
- Specified by:
drainTo
in interfaceBlockingQueue<E>
-
offer
@CanIgnoreReturnValue public boolean offer(E e, long timeout, TimeUnit unit) throws InterruptedException - Specified by:
offer
in interfaceBlockingQueue<E>
- Throws:
InterruptedException
-
poll
@CanIgnoreReturnValue @CheckForNull public E poll(long timeout, TimeUnit unit) throws InterruptedException - Specified by:
poll
in interfaceBlockingQueue<E>
- Throws:
InterruptedException
-
put
- Specified by:
put
in interfaceBlockingQueue<E>
- Throws:
InterruptedException
-
remainingCapacity
public int remainingCapacity()- Specified by:
remainingCapacity
in interfaceBlockingQueue<E>
-
take
- Specified by:
take
in interfaceBlockingQueue<E>
- Throws:
InterruptedException
-