Sdílet prostřednictvím


JSONArray.OptLong Method

Definition

Overloads

OptLong(Int32)

Returns the value at index if it exists and is a long or can be coerced to a long.

OptLong(Int32, Int64)

Returns the value at index if it exists and is a long or can be coerced to a long.

OptLong(Int32)

Returns the value at index if it exists and is a long or can be coerced to a long.

[Android.Runtime.Register("optLong", "(I)J", "GetOptLong_IHandler")]
public virtual long OptLong (int index);
[<Android.Runtime.Register("optLong", "(I)J", "GetOptLong_IHandler")>]
abstract member OptLong : int -> int64
override this.OptLong : int -> int64

Parameters

index
Int32

Returns

Attributes

Remarks

Returns the value at index if it exists and is a long or can be coerced to a long. Returns 0 otherwise.

Java documentation for org.json.JSONArray.optLong(int).

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

OptLong(Int32, Int64)

Returns the value at index if it exists and is a long or can be coerced to a long.

[Android.Runtime.Register("optLong", "(IJ)J", "GetOptLong_IJHandler")]
public virtual long OptLong (int index, long fallback);
[<Android.Runtime.Register("optLong", "(IJ)J", "GetOptLong_IJHandler")>]
abstract member OptLong : int * int64 -> int64
override this.OptLong : int * int64 -> int64

Parameters

index
Int32
fallback
Int64

Returns

Attributes

Remarks

Returns the value at index if it exists and is a long or can be coerced to a long. Returns fallback otherwise.

Java documentation for org.json.JSONArray.optLong(int, long).

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