Share via


ConcurrentLinkedDeque.Size Method

Definition

Returns the number of elements in this deque.

[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 deque

Implements

Attributes

Remarks

Returns the number of elements in this deque. If this deque contains more than Integer.MAX_VALUE elements, it 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 deques, determining the current number of elements requires traversing them all to count them. Additionally, it is possible for the size to change during execution of this method, in which case the returned result will be inaccurate. Thus, this method is typically not very useful in concurrent applications.

Java documentation for java.util.concurrent.ConcurrentLinkedDeque.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