ITransferQueue Interface
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
A BlockingQueue
in which producers may wait for consumers
to receive elements.
[Android.Runtime.Register("java/util/concurrent/TransferQueue", "", "Java.Util.Concurrent.ITransferQueueInvoker")]
[Java.Interop.JavaTypeParameters(new System.String[] { "E" })]
public interface ITransferQueue : IDisposable, Java.Interop.IJavaPeerable, Java.Util.Concurrent.IBlockingQueue
[<Android.Runtime.Register("java/util/concurrent/TransferQueue", "", "Java.Util.Concurrent.ITransferQueueInvoker")>]
[<Java.Interop.JavaTypeParameters(new System.String[] { "E" })>]
type ITransferQueue = interface
interface IBlockingQueue
interface IQueue
interface ICollection
interface IIterable
interface IJavaObject
interface IDisposable
interface IJavaPeerable
- Derived
- Attributes
- Implements
Remarks
A BlockingQueue
in which producers may wait for consumers to receive elements. A TransferQueue
may be useful for example in message passing applications in which producers sometimes (using method #transfer
) await receipt of elements by consumers invoking take
or poll
, while at other times enqueue elements (via method put
) without waiting for receipt. #tryTransfer(Object) Non-blocking and #tryTransfer(Object,long,TimeUnit) time-out versions of tryTransfer
are also available. A TransferQueue
may also be queried, via #hasWaitingConsumer
, whether there are any threads waiting for items, which is a converse analogy to a peek
operation.
Like other blocking queues, a TransferQueue
may be capacity bounded. If so, an attempted transfer operation may initially block waiting for available space, and/or subsequently block waiting for reception by a consumer. Note that in a queue with zero capacity, such as SynchronousQueue
, put
and transfer
are effectively synonymous.
This interface is a member of the Java Collections Framework.
Added in 1.7.
Java documentation for java.util.concurrent.TransferQueue
.
Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.
Properties
Handle |
Gets the JNI value of the underlying Android object. (Inherited from IJavaObject) |
HasWaitingConsumer |
Returns |
IsEmpty |
Returns if this |
JniIdentityHashCode |
Returns the value of |
JniManagedPeerState |
State of the managed peer. (Inherited from IJavaPeerable) |
JniPeerMembers |
Member access and invocation support. (Inherited from IJavaPeerable) |
PeerReference |
Returns a JniObjectReference of the wrapped Java object instance. (Inherited from IJavaPeerable) |
WaitingConsumerCount |
Returns an estimate of the number of consumers waiting to receive elements via Take() or timed Poll(Int64, TimeUnit). |
Methods
Add(Object) |
Inserts the specified element into this queue if it is possible to do so
immediately without violating capacity restrictions, returning
|
AddAll(ICollection) |
Adds all of the elements in the specified collection to this collection (optional operation). (Inherited from ICollection) |
Clear() |
Removes all of the elements from this collection (optional operation). (Inherited from ICollection) |
Contains(Object) |
Returns |
ContainsAll(ICollection) |
Returns |
Disposed() |
Called when the instance has been disposed. (Inherited from IJavaPeerable) |
DisposeUnlessReferenced() |
If there are no outstanding references to this instance, then
calls |
DrainTo(ICollection, Int32) |
Removes at most the given number of available elements from this queue and adds them to the given collection. (Inherited from IBlockingQueue) |
DrainTo(ICollection) |
Removes all available elements from this queue and adds them to the given collection. (Inherited from IBlockingQueue) |
Element() |
Retrieves, but does not remove, the head of this queue. (Inherited from IQueue) |
Equals(Object) |
Compares the specified object with this collection for equality. (Inherited from ICollection) |
Finalized() |
Called when the instance has been finalized. (Inherited from IJavaPeerable) |
ForEach(IConsumer) |
Performs the given action for each element of the |
GetHashCode() |
Returns the hash code value for this collection. (Inherited from ICollection) |
Iterator() |
Returns an iterator over the elements in this collection. (Inherited from ICollection) |
Offer(Object, Int64, TimeUnit) |
Inserts the specified element into this queue, waiting up to the specified wait time if necessary for space to become available. (Inherited from IBlockingQueue) |
Offer(Object) |
Inserts the specified element into this queue if it is possible to do so immediately without violating capacity restrictions. (Inherited from IQueue) |
Peek() |
Retrieves, but does not remove, the head of this queue,
or returns |
Poll() |
Retrieves and removes the head of this queue,
or returns |
Poll(Int64, TimeUnit) |
Retrieves and removes the head of this queue, waiting up to the specified wait time if necessary for an element to become available. (Inherited from IBlockingQueue) |
Put(Object) |
Inserts the specified element into this queue, waiting if necessary for space to become available. (Inherited from IBlockingQueue) |
RemainingCapacity() |
Returns the number of additional elements that this queue can ideally
(in the absence of memory or resource constraints) accept without
blocking, or |
Remove() |
Retrieves and removes the head of this queue. (Inherited from IQueue) |
Remove(Object) |
Removes a single instance of the specified element from this collection, if it is present (optional operation). (Inherited from ICollection) |
RemoveAll(ICollection) |
Removes all of this collection's elements that are also contained in the specified collection (optional operation). (Inherited from ICollection) |
RemoveIf(IPredicate) |
Removes all of the elements of this collection that satisfy the given predicate. (Inherited from ICollection) |
RetainAll(ICollection) |
Retains only the elements in this collection that are contained in the specified collection (optional operation). (Inherited from ICollection) |
SetJniIdentityHashCode(Int32) |
Set the value returned by |
SetJniManagedPeerState(JniManagedPeerStates) | (Inherited from IJavaPeerable) |
SetPeerReference(JniObjectReference) |
Set the value returned by |
Size() |
Returns the number of elements in this collection. (Inherited from ICollection) |
Spliterator() |
Creates a |
Take() |
Retrieves and removes the head of this queue, waiting if necessary until an element becomes available. (Inherited from IBlockingQueue) |
ToArray() |
Returns an array containing all of the elements in this collection. (Inherited from ICollection) |
ToArray(IIntFunction) |
Returns an array containing all of the elements in this collection,
using the provided |
ToArray(Object[]) |
Returns an array containing all of the elements in this collection; the runtime type of the returned array is that of the specified array. (Inherited from ICollection) |
Transfer(Object) |
Transfers the element to a consumer, waiting if necessary to do so. |
TryTransfer(Object, Int64, TimeUnit) |
Transfers the element to a consumer if it is possible to do so before the timeout elapses. |
TryTransfer(Object) |
Transfers the element to a waiting consumer immediately, if possible. |
UnregisterFromRuntime() |
Unregister this instance so that the runtime will not return it from future Java.Interop.JniRuntime+JniValueManager.PeekValue invocations. (Inherited from IJavaPeerable) |
Explicit Interface Implementations
IIterable.Spliterator() |
Creates a |