Share via


LinkedTransferQueue.Size Method

Definition

Returns the number of elements in this queue.

[Android.Runtime.Register("size", "()I", "GetSizeHandler")]
public override int Size ();
[<Android.Runtime.Register("size", "()I", "GetSizeHandler")>]
override this.Size : unit -> int

Returns

the number of elements in this queue

Implements

Attributes

Remarks

Returns the number of elements in this queue. If this queue contains more than Integer.MAX_VALUE elements, returns Integer.MAX_VALUE.

Beware that, unlike in most collections, this method is <em>NOT</em> a constant-time operation. Because of the asynchronous nature of these queues, determining the current number of elements requires an O(n) traversal.

Java documentation for java.util.concurrent.LinkedTransferQueue.size().

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.

Applies to