GeezerVison is showing docs.oracle.com — TransferQueue (Java Platform SE 8 )
Java™ Platform Standard Ed. 8
- Summary:
- Nested |
- Field |
- Constr |
- Method
- Detail:
- Field |
- Constr |
- Method
compact1, compact2, compact3
java.util.concurrent
Interface TransferQueue<E>
-
-
Method Summary
All Methods Instance Methods Abstract Methods
| Modifier and Type |
Method |
Description |
int |
getWaitingConsumerCount() |
|
boolean |
hasWaitingConsumer() |
|
void |
transfer(E e) |
Transfers the element to a consumer, waiting if necessary to do so.
|
boolean |
tryTransfer(E e) |
Transfers the element to a waiting consumer immediately, if possible.
|
boolean |
tryTransfer(E e,
long timeout,
TimeUnit unit) |
Transfers the element to a consumer if it is possible to do so
before the timeout elapses.
|
-
Methods inherited from interface java.util.concurrent.BlockingQueue
add, contains, drainTo, drainTo, offer, offer, poll, put, remainingCapacity, remove, take
-
Methods inherited from interface java.util.Collection
addAll, clear, containsAll, equals, hashCode, isEmpty, iterator, parallelStream, removeAll, removeIf, retainAll, size, spliterator, stream, toArray, toArray
-
-
Method Detail
-
tryTransfer
boolean tryTransfer(E e)
Transfers the element to a waiting consumer immediately, if possible.
More precisely, transfers the specified element immediately
if there exists a consumer already waiting to receive it (in
BlockingQueue.take() or timed poll),
otherwise returning false without enqueuing the element.
- Parameters:
e - the element to transfer
- Returns:
true if the element was transferred, else
false
- Throws:
ClassCastException - if the class of the specified element
prevents it from being added to this queue
NullPointerException - if the specified element is null
IllegalArgumentException - if some property of the specified
element prevents it from being added to this queue
Java™ Platform Standard Ed. 8
- Summary:
- Nested |
- Field |
- Constr |
- Method
- Detail:
- Field |
- Constr |
- Method
Submit a bug or feature For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples. Copyright © 1993, 2026, Oracle and/or its affiliates. All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.
|