BooleanArray

class BooleanArray(size: Int)(source)

An array of booleans. When targeting the JVM, instances of this class are represented as boolean[].

Since Kotlin

1.0
class BooleanArray(size: Int)(source)

An array of booleans. When targeting the JVM, instances of this class are represented as boolean[].

Since Kotlin

1.1

Constructors

Link copied to clipboard
fun BooleanArray(size: Int, init: (Int) -> Boolean)

Creates a new array of the specified size, where each element is calculated by calling the specified init function.

fun BooleanArray(size: Int, init: (Int) -> Boolean)

Creates a new array of the specified size, where each element is calculated by calling the specified init function.

Link copied to clipboard
fun BooleanArray(size: Int)

Creates a new array of the specified size, with all elements initialized to false.

fun BooleanArray(size: Int)

Creates a new array of the specified size, with all elements initialized to false.

Functions

Link copied to clipboard
operator fun get(index: Int): Boolean

Returns the array element at the given index. This method can be called using the index operator.

Since Kotlin 1.0
operator fun get(index: Int): Boolean

Returns the array element at the given index. This method can be called using the index operator.

Since Kotlin 1.1
Link copied to clipboard
operator fun iterator(): BooleanIterator

Creates an iterator over the elements of the array.

Since Kotlin 1.0
operator fun iterator(): BooleanIterator

Creates an iterator over the elements of the array.

Since Kotlin 1.1
Link copied to clipboard
operator fun set(index: Int, value: Boolean)

Sets the element at the given index to the given value. This method can be called using the index operator.

Since Kotlin 1.0
operator fun set(index: Int, value: Boolean)

Sets the element at the given index to the given value. This method can be called using the index operator.

Since Kotlin 1.1

Properties

Link copied to clipboard
val size: Int

Returns the number of elements in the array.

Since Kotlin 1.0
val size: Int

Returns the number of elements in the array.

Since Kotlin 1.1

Extensions

Link copied to clipboard
inline fun <R : Comparable<R>> BooleanArray.maxBy(selector: (Boolean) -> R): Boolean?
inline fun <R : Comparable<R>> BooleanArray.maxBy(selector: (Boolean) -> R): Boolean?
Since Kotlin 1.0
Link copied to clipboard
Since Kotlin 1.0
Link copied to clipboard
inline fun <R : Comparable<R>> BooleanArray.minBy(selector: (Boolean) -> R): Boolean?
inline fun <R : Comparable<R>> BooleanArray.minBy(selector: (Boolean) -> R): Boolean?
Since Kotlin 1.0
Link copied to clipboard
Since Kotlin 1.0
Link copied to clipboard

Returns a new SortedSet of all elements.

Since Kotlin 1.0