Freigeben über


ConcurrentHashMap.MappingCount Method

Definition

Returns the number of mappings.

[Android.Runtime.Register("mappingCount", "()J", "GetMappingCountHandler", ApiSince=24)]
public virtual long MappingCount ();
[<Android.Runtime.Register("mappingCount", "()J", "GetMappingCountHandler", ApiSince=24)>]
abstract member MappingCount : unit -> int64
override this.MappingCount : unit -> int64

Returns

the number of mappings

Attributes

Remarks

Returns the number of mappings. This method should be used instead of #size because a ConcurrentHashMap may contain more mappings than can be represented as an int. The value returned is an estimate; the actual count may differ if there are concurrent insertions or removals.

Added in 1.8.

Java documentation for java.util.concurrent.ConcurrentHashMap.mappingCount().

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