Language

SparseArray<E>.Get Method

Definition

Overloads

Name Description
Get(Int32)

Gets the Object mapped from the specified key, or null if no such mapping has been made.

Get(Int32, E)

Gets the Object mapped from the specified key, or the specified Object if no such mapping has been made.

Get(Int32)

Gets the Object mapped from the specified key, or null if no such mapping has been made.

[Android.Runtime.Register("get", "(I)Ljava/lang/Object;", "")]
public virtual E Get(int key);
[<Android.Runtime.Register("get", "(I)Ljava/lang/Object;", "")>]
override this.Get : int -> 'E

Parameters

key
Int32

The integer key to look up.

Returns

E

The mapped value converted to E, or default(E) if the key is absent.

Attributes

Remarks

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

Get(Int32, E)

Gets the Object mapped from the specified key, or the specified Object if no such mapping has been made.

[Android.Runtime.Register("get", "(ILjava/lang/Object;)Ljava/lang/Object;", "")]
public virtual E Get(int key, E valueIfKeyNotFound);
[<Android.Runtime.Register("get", "(ILjava/lang/Object;)Ljava/lang/Object;", "")>]
override this.Get : int * 'E -> 'E

Parameters

key
Int32

The integer key to look up.

valueIfKeyNotFound
E

The managed value to return when the key has no mapping.

Returns

E

The mapped value, or valueIfKeyNotFound if the key is absent.

Attributes

Remarks

Gets the Object mapped from the specified key, or the specified Object if no such mapping has been made.

Android reference for android.util.SparseArray.get.

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