equals

fun equals(a: ByteArray, aFromIndex: Int, aToIndex: Int, b: ByteArray, bFromIndex: Int, bToIndex: Int): Boolean

Returns true if the two specified arrays of bytes, over the specified ranges, are equal to one another.

Two arrays are considered equal if the number of elements covered by each range is the same, and all corresponding pairs of elements over the specified ranges in the two arrays are equal. In other words, two arrays are equal if they contain, over the specified ranges, the same elements in the same order.

Return

true if the two arrays, over the specified ranges, are equal

Since

9

Parameters

a

the first array to be tested for equality

aFromIndex

the index (inclusive) of the first element in the first array to be tested

aToIndex

the index (exclusive) of the last element in the first array to be tested

b

the second array to be tested for equality

bFromIndex

the index (inclusive) of the first element in the second array to be tested

bToIndex

the index (exclusive) of the last element in the second array to be tested

Throws

if aFromIndex > aToIndex or if bFromIndex > bToIndex

ArrayIndexOutOfBoundsException

if aFromIndex < 0 or aToIndex > a.length or if bFromIndex < 0 or bToIndex > b.length

if either array is null


fun equals(a: LongArray, aFromIndex: Int, aToIndex: Int, b: LongArray, bFromIndex: Int, bToIndex: Int): Boolean

Returns true if the two LongArrays, over the specified ranges, are equal (i.e. they have the same length and each corresponding element is equal).

Return

true if the specified ranges in a and b are equal; false otherwise.

Parameters

a

the first array

aFromIndex

the index (inclusive) of the first element in a to compare

aToIndex

the index (exclusive) of the last element in a to compare

b

the second array

bFromIndex

the index (inclusive) of the first element in b to compare

bToIndex

the index (exclusive) of the last element in b to compare

Throws

if aFromIndex > aToIndex or bFromIndex > bToIndex.

if any index is out of range.


fun equals(a: FloatArray, aFromIndex: Int, aToIndex: Int, b: FloatArray, bFromIndex: Int, bToIndex: Int): Boolean

Returns true if the two specified arrays of floats, over the specified ranges, are equal to one another.

Two arrays are considered equal if the number of elements covered by each range is the same, and all corresponding pairs of elements over the specified ranges in the two arrays are equal. In other words, two arrays are equal if they contain, over the specified ranges, the same elements in the same order.

Two floats f1 and f2 are considered equal if:

    `Float.valueOf(f1).equals(Float.valueOf(f2))`

(Unlike the == operator, this method considers NaN equal to itself, and 0.0f unequal to -0.0f.)

Return

true if the two arrays, over the specified ranges, are equal

Since

9

Parameters

a

the first array to be tested for equality

aFromIndex

the index (inclusive) of the first element in the first array to be tested

aToIndex

the index (exclusive) of the last element in the first array to be tested

b

the second array to be tested for equality

bFromIndex

the index (inclusive) of the first element in the second array to be tested

bToIndex

the index (exclusive) of the last element in the second array to be tested

See also

Throws

if aFromIndex > aToIndex or if bFromIndex > bToIndex

ArrayIndexOutOfBoundsException

if aFromIndex < 0 or aToIndex > a.length or if bFromIndex < 0 or bToIndex > b.length

if either array is null


fun equals(a: CharArray, aFromIndex: Int, aToIndex: Int, b: CharArray, bFromIndex: Int, bToIndex: Int): Boolean


fun equals(a: IntArray, aFromIndex: Int, aToIndex: Int, b: IntArray, bFromIndex: Int, bToIndex: Int): Boolean

ported from equals(int[] a, int aFromIndex, int aToIndex, int[] b, int bFromIndex, int bToIndex)

Returns true if the two specified subarrays of IntArrays are equal.

Two arrays are considered equal if the number of elements in each range is the same and every corresponding pair of elements in the ranges is equal.

Return

true if the two arrays are equal over the specified ranges.

Parameters

a

the first array to be tested for equality.

aFromIndex

the index (inclusive) of the first element in the first array to test.

aToIndex

the index (exclusive) of the last element in the first array to test.

b

the second array to be tested for equality.

bFromIndex

the index (inclusive) of the first element in the second array to test.

bToIndex

the index (exclusive) of the last element in the second array to test.

Throws

if fromIndex > toIndex.

if indices are out of bounds.