다음을 통해 공유


Objects.CheckFromToIndex Method

Definition

Overloads

CheckFromToIndex(Int32, Int32, Int32)

Checks if the sub-range from fromIndex (inclusive) to toIndex (exclusive) is within the bounds of range from 0 (inclusive) to length (exclusive).

CheckFromToIndex(Int64, Int64, Int64)

Checks if the sub-range from fromIndex (inclusive) to toIndex (exclusive) is within the bounds of range from 0 (inclusive) to length (exclusive).

CheckFromToIndex(Int32, Int32, Int32)

Checks if the sub-range from fromIndex (inclusive) to toIndex (exclusive) is within the bounds of range from 0 (inclusive) to length (exclusive).

[Android.Runtime.Register("checkFromToIndex", "(III)I", "", ApiSince=30)]
public static int CheckFromToIndex (int fromIndex, int toIndex, int length);
[<Android.Runtime.Register("checkFromToIndex", "(III)I", "", ApiSince=30)>]
static member CheckFromToIndex : int * int * int -> int

Parameters

fromIndex
Int32

the lower-bound (inclusive) of the sub-range

toIndex
Int32

the upper-bound (exclusive) of the sub-range

length
Int32

the upper-bound (exclusive) the range

Returns

fromIndex if the sub-range within bounds of the range

Attributes

Remarks

Checks if the sub-range from fromIndex (inclusive) to toIndex (exclusive) is within the bounds of range from 0 (inclusive) to length (exclusive).

The sub-range is defined to be out of bounds if any of the following inequalities is true: <ul> <li>fromIndex < 0</li> <li>fromIndex > toIndex</li> <li>toIndex > length</li> <li>length < 0, which is implied from the former inequalities</li> </ul>

Added in 9.

Java documentation for java.util.Objects.checkFromToIndex(int, int, 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

CheckFromToIndex(Int64, Int64, Int64)

Checks if the sub-range from fromIndex (inclusive) to toIndex (exclusive) is within the bounds of range from 0 (inclusive) to length (exclusive).

[Android.Runtime.Register("checkFromToIndex", "(JJJ)J", "", ApiSince=34)]
public static long CheckFromToIndex (long fromIndex, long toIndex, long length);
[<Android.Runtime.Register("checkFromToIndex", "(JJJ)J", "", ApiSince=34)>]
static member CheckFromToIndex : int64 * int64 * int64 -> int64

Parameters

fromIndex
Int64

the lower-bound (inclusive) of the sub-range

toIndex
Int64

the upper-bound (exclusive) of the sub-range

length
Int64

the upper-bound (exclusive) the range

Returns

fromIndex if the sub-range within bounds of the range

Attributes

Remarks

Checks if the sub-range from fromIndex (inclusive) to toIndex (exclusive) is within the bounds of range from 0 (inclusive) to length (exclusive).

The sub-range is defined to be out of bounds if any of the following inequalities is true: <ul> <li>fromIndex < 0</li> <li>fromIndex > toIndex</li> <li>toIndex > length</li> <li>length < 0, which is implied from the former inequalities</li> </ul>

Added in 16.

Java documentation for java.util.Objects.checkFromToIndex(long, long, 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