contentDeepEquals

expect infix fun <T> Array<out T>.contentDeepEquals(other: Array<out T>): Boolean(source)

Checks if the two specified arrays are deeply equal to one another.

Two arrays are considered deeply equal if they have the same size, and elements at corresponding indices are deeply equal. That is, if two corresponding elements are nested arrays, they are also compared deeply. Elements of other types are compared for equality using the equals function. For floating point numbers, this means NaN is equal to itself and -0.0 is not equal to 0.0.

If any of the arrays contain themselves at any nesting level, the behavior is undefined.

Since Kotlin

1.1

Return

true if the two arrays are deeply equal, false otherwise.

Parameters

other

the array to compare deeply with this array.

Samples

import kotlin.test.*

fun main() { 
   //sampleStart 
   val identityMatrix = arrayOf(
    intArrayOf(1, 0),
    intArrayOf(0, 1)
)
val reflectionMatrix = arrayOf(
    intArrayOf(1, 0),
    intArrayOf(0, -1)
)

// the elements at index [1][1] are not equal
println(identityMatrix.contentDeepEquals(reflectionMatrix)) // false

reflectionMatrix[1][1] = 1
println(identityMatrix.contentDeepEquals(reflectionMatrix)) // true 
   //sampleEnd
}

expect infix fun <T> Array<out T>?.contentDeepEquals(other: Array<out T>?): Boolean(source)

Checks if the two specified arrays are deeply equal to one another.

Two arrays are considered deeply equal if they have the same size, and elements at corresponding indices are deeply equal. That is, if two corresponding elements are nested arrays, they are also compared deeply. Elements of other types are compared for equality using the equals function. For floating point numbers, this means NaN is equal to itself and -0.0 is not equal to 0.0.

The arrays are also considered deeply equal if both are null.

If any of the arrays contain themselves at any nesting level, the behavior is undefined.

Since Kotlin

1.4

Return

true if the two arrays are deeply equal, false otherwise.

Parameters

other

the array to compare deeply with this array.

Samples

import kotlin.test.*

fun main() { 
   //sampleStart 
   val identityMatrix = arrayOf(
    intArrayOf(1, 0),
    intArrayOf(0, 1)
)
val reflectionMatrix = arrayOf(
    intArrayOf(1, 0),
    intArrayOf(0, -1)
)

// the elements at index [1][1] are not equal
println(identityMatrix.contentDeepEquals(reflectionMatrix)) // false

reflectionMatrix[1][1] = 1
println(identityMatrix.contentDeepEquals(reflectionMatrix)) // true 
   //sampleEnd
}
actual infix fun <T> Array<out T>.contentDeepEquals(other: Array<out T>): Boolean(source)

Checks if the two specified arrays are deeply equal to one another.

Two arrays are considered deeply equal if they have the same size, and elements at corresponding indices are deeply equal. That is, if two corresponding elements are nested arrays, they are also compared deeply. Elements of other types are compared for equality using the equals function. For floating point numbers, this means NaN is equal to itself and -0.0 is not equal to 0.0.

If any of the arrays contain themselves at any nesting level, the behavior is undefined.

Since Kotlin

1.1

Return

true if the two arrays are deeply equal, false otherwise.

Parameters

other

the array to compare deeply with this array.

Samples

import kotlin.test.*

fun main() { 
   //sampleStart 
   val identityMatrix = arrayOf(
    intArrayOf(1, 0),
    intArrayOf(0, 1)
)
val reflectionMatrix = arrayOf(
    intArrayOf(1, 0),
    intArrayOf(0, -1)
)

// the elements at index [1][1] are not equal
println(identityMatrix.contentDeepEquals(reflectionMatrix)) // false

reflectionMatrix[1][1] = 1
println(identityMatrix.contentDeepEquals(reflectionMatrix)) // true 
   //sampleEnd
}

actual infix fun <T> Array<out T>?.contentDeepEquals(other: Array<out T>?): Boolean(source)

Checks if the two specified arrays are deeply equal to one another.

Two arrays are considered deeply equal if they have the same size, and elements at corresponding indices are deeply equal. That is, if two corresponding elements are nested arrays, they are also compared deeply. Elements of other types are compared for equality using the equals function. For floating point numbers, this means NaN is equal to itself and -0.0 is not equal to 0.0.

The arrays are also considered deeply equal if both are null.

If any of the arrays contain themselves at any nesting level, the behavior is undefined.

Since Kotlin

1.4

Return

true if the two arrays are deeply equal, false otherwise.

Parameters

other

the array to compare deeply with this array.

Samples

import kotlin.test.*

fun main() { 
   //sampleStart 
   val identityMatrix = arrayOf(
    intArrayOf(1, 0),
    intArrayOf(0, 1)
)
val reflectionMatrix = arrayOf(
    intArrayOf(1, 0),
    intArrayOf(0, -1)
)

// the elements at index [1][1] are not equal
println(identityMatrix.contentDeepEquals(reflectionMatrix)) // false

reflectionMatrix[1][1] = 1
println(identityMatrix.contentDeepEquals(reflectionMatrix)) // true 
   //sampleEnd
}
@JvmName(name = "contentDeepEqualsInline")
actual infix inline fun <T> Array<out T>.contentDeepEquals(other: Array<out T>): Boolean(source)

Checks if the two specified arrays are deeply equal to one another.

Two arrays are considered deeply equal if they have the same size, and elements at corresponding indices are deeply equal. That is, if two corresponding elements are nested arrays, they are also compared deeply. Elements of other types are compared for equality using the equals function. For floating point numbers, this means NaN is equal to itself and -0.0 is not equal to 0.0.

If any of the arrays contain themselves at any nesting level, the behavior is undefined.

Since Kotlin

1.1

Return

true if the two arrays are deeply equal, false otherwise.

Parameters

other

the array to compare deeply with this array.

Samples

import kotlin.test.*

fun main() { 
   //sampleStart 
   val identityMatrix = arrayOf(
    intArrayOf(1, 0),
    intArrayOf(0, 1)
)
val reflectionMatrix = arrayOf(
    intArrayOf(1, 0),
    intArrayOf(0, -1)
)

// the elements at index [1][1] are not equal
println(identityMatrix.contentDeepEquals(reflectionMatrix)) // false

reflectionMatrix[1][1] = 1
println(identityMatrix.contentDeepEquals(reflectionMatrix)) // true 
   //sampleEnd
}

@JvmName(name = "contentDeepEqualsNullable")
actual infix inline fun <T> Array<out T>?.contentDeepEquals(other: Array<out T>?): Boolean(source)

Checks if the two specified arrays are deeply equal to one another.

Two arrays are considered deeply equal if they have the same size, and elements at corresponding indices are deeply equal. That is, if two corresponding elements are nested arrays, they are also compared deeply. Elements of other types are compared for equality using the equals function. For floating point numbers, this means NaN is equal to itself and -0.0 is not equal to 0.0.

The arrays are also considered deeply equal if both are null.

If any of the arrays contain themselves at any nesting level, the behavior is undefined.

Since Kotlin

1.4

Return

true if the two arrays are deeply equal, false otherwise.

Parameters

other

the array to compare deeply with this array.

Samples

import kotlin.test.*

fun main() { 
   //sampleStart 
   val identityMatrix = arrayOf(
    intArrayOf(1, 0),
    intArrayOf(0, 1)
)
val reflectionMatrix = arrayOf(
    intArrayOf(1, 0),
    intArrayOf(0, -1)
)

// the elements at index [1][1] are not equal
println(identityMatrix.contentDeepEquals(reflectionMatrix)) // false

reflectionMatrix[1][1] = 1
println(identityMatrix.contentDeepEquals(reflectionMatrix)) // true 
   //sampleEnd
}
actual infix fun <T> Array<out T>.contentDeepEquals(other: Array<out T>): Boolean(source)

Checks if the two specified arrays are deeply equal to one another.

Two arrays are considered deeply equal if they have the same size, and elements at corresponding indices are deeply equal. That is, if two corresponding elements are nested arrays, they are also compared deeply. Elements of other types are compared for equality using the equals function. For floating point numbers, this means NaN is equal to itself and -0.0 is not equal to 0.0.

If any of the arrays contain themselves at any nesting level, the behavior is undefined.

Since Kotlin

1.3

Return

true if the two arrays are deeply equal, false otherwise.

Parameters

other

the array to compare deeply with this array.

Samples

import kotlin.test.*

fun main() { 
   //sampleStart 
   val identityMatrix = arrayOf(
    intArrayOf(1, 0),
    intArrayOf(0, 1)
)
val reflectionMatrix = arrayOf(
    intArrayOf(1, 0),
    intArrayOf(0, -1)
)

// the elements at index [1][1] are not equal
println(identityMatrix.contentDeepEquals(reflectionMatrix)) // false

reflectionMatrix[1][1] = 1
println(identityMatrix.contentDeepEquals(reflectionMatrix)) // true 
   //sampleEnd
}

actual infix fun <T> Array<out T>?.contentDeepEquals(other: Array<out T>?): Boolean(source)

Checks if the two specified arrays are deeply equal to one another.

Two arrays are considered deeply equal if they have the same size, and elements at corresponding indices are deeply equal. That is, if two corresponding elements are nested arrays, they are also compared deeply. Elements of other types are compared for equality using the equals function. For floating point numbers, this means NaN is equal to itself and -0.0 is not equal to 0.0.

The arrays are also considered deeply equal if both are null.

If any of the arrays contain themselves at any nesting level, the behavior is undefined.

Since Kotlin

1.4

Return

true if the two arrays are deeply equal, false otherwise.

Parameters

other

the array to compare deeply with this array.

Samples

import kotlin.test.*

fun main() { 
   //sampleStart 
   val identityMatrix = arrayOf(
    intArrayOf(1, 0),
    intArrayOf(0, 1)
)
val reflectionMatrix = arrayOf(
    intArrayOf(1, 0),
    intArrayOf(0, -1)
)

// the elements at index [1][1] are not equal
println(identityMatrix.contentDeepEquals(reflectionMatrix)) // false

reflectionMatrix[1][1] = 1
println(identityMatrix.contentDeepEquals(reflectionMatrix)) // true 
   //sampleEnd
}
actual infix fun <T> Array<out T>.contentDeepEquals(other: Array<out T>): Boolean(source)

Checks if the two specified arrays are deeply equal to one another.

Two arrays are considered deeply equal if they have the same size, and elements at corresponding indices are deeply equal. That is, if two corresponding elements are nested arrays, they are also compared deeply. Elements of other types are compared for equality using the equals function. For floating point numbers, this means NaN is equal to itself and -0.0 is not equal to 0.0.

If any of the arrays contain themselves at any nesting level, the behavior is undefined.

Since Kotlin

1.8

Return

true if the two arrays are deeply equal, false otherwise.

Parameters

other

the array to compare deeply with this array.

Samples

import kotlin.test.*

fun main() { 
   //sampleStart 
   val identityMatrix = arrayOf(
    intArrayOf(1, 0),
    intArrayOf(0, 1)
)
val reflectionMatrix = arrayOf(
    intArrayOf(1, 0),
    intArrayOf(0, -1)
)

// the elements at index [1][1] are not equal
println(identityMatrix.contentDeepEquals(reflectionMatrix)) // false

reflectionMatrix[1][1] = 1
println(identityMatrix.contentDeepEquals(reflectionMatrix)) // true 
   //sampleEnd
}

actual infix fun <T> Array<out T>?.contentDeepEquals(other: Array<out T>?): Boolean(source)

Checks if the two specified arrays are deeply equal to one another.

Two arrays are considered deeply equal if they have the same size, and elements at corresponding indices are deeply equal. That is, if two corresponding elements are nested arrays, they are also compared deeply. Elements of other types are compared for equality using the equals function. For floating point numbers, this means NaN is equal to itself and -0.0 is not equal to 0.0.

The arrays are also considered deeply equal if both are null.

If any of the arrays contain themselves at any nesting level, the behavior is undefined.

Since Kotlin

1.8

Return

true if the two arrays are deeply equal, false otherwise.

Parameters

other

the array to compare deeply with this array.

Samples

import kotlin.test.*

fun main() { 
   //sampleStart 
   val identityMatrix = arrayOf(
    intArrayOf(1, 0),
    intArrayOf(0, 1)
)
val reflectionMatrix = arrayOf(
    intArrayOf(1, 0),
    intArrayOf(0, -1)
)

// the elements at index [1][1] are not equal
println(identityMatrix.contentDeepEquals(reflectionMatrix)) // false

reflectionMatrix[1][1] = 1
println(identityMatrix.contentDeepEquals(reflectionMatrix)) // true 
   //sampleEnd
}
actual infix fun <T> Array<out T>.contentDeepEquals(other: Array<out T>): Boolean(source)

Checks if the two specified arrays are deeply equal to one another.

Two arrays are considered deeply equal if they have the same size, and elements at corresponding indices are deeply equal. That is, if two corresponding elements are nested arrays, they are also compared deeply. Elements of other types are compared for equality using the equals function. For floating point numbers, this means NaN is equal to itself and -0.0 is not equal to 0.0.

If any of the arrays contain themselves at any nesting level, the behavior is undefined.

Since Kotlin

1.8

Return

true if the two arrays are deeply equal, false otherwise.

Parameters

other

the array to compare deeply with this array.

Samples

import kotlin.test.*

fun main() { 
   //sampleStart 
   val identityMatrix = arrayOf(
    intArrayOf(1, 0),
    intArrayOf(0, 1)
)
val reflectionMatrix = arrayOf(
    intArrayOf(1, 0),
    intArrayOf(0, -1)
)

// the elements at index [1][1] are not equal
println(identityMatrix.contentDeepEquals(reflectionMatrix)) // false

reflectionMatrix[1][1] = 1
println(identityMatrix.contentDeepEquals(reflectionMatrix)) // true 
   //sampleEnd
}

actual infix fun <T> Array<out T>?.contentDeepEquals(other: Array<out T>?): Boolean(source)

Checks if the two specified arrays are deeply equal to one another.

Two arrays are considered deeply equal if they have the same size, and elements at corresponding indices are deeply equal. That is, if two corresponding elements are nested arrays, they are also compared deeply. Elements of other types are compared for equality using the equals function. For floating point numbers, this means NaN is equal to itself and -0.0 is not equal to 0.0.

The arrays are also considered deeply equal if both are null.

If any of the arrays contain themselves at any nesting level, the behavior is undefined.

Since Kotlin

1.8

Return

true if the two arrays are deeply equal, false otherwise.

Parameters

other

the array to compare deeply with this array.

Samples

import kotlin.test.*

fun main() { 
   //sampleStart 
   val identityMatrix = arrayOf(
    intArrayOf(1, 0),
    intArrayOf(0, 1)
)
val reflectionMatrix = arrayOf(
    intArrayOf(1, 0),
    intArrayOf(0, -1)
)

// the elements at index [1][1] are not equal
println(identityMatrix.contentDeepEquals(reflectionMatrix)) // false

reflectionMatrix[1][1] = 1
println(identityMatrix.contentDeepEquals(reflectionMatrix)) // true 
   //sampleEnd
}