From b72e5c038db4bba8ddbdad46a332f18529ba7a47 Mon Sep 17 00:00:00 2001 From: Ilya Gorbunov Date: Thu, 15 Dec 2016 20:13:25 +0300 Subject: [PATCH] Generate common headers to common/src/generated --- .../stdlib/common/src/generated/_Arrays.kt | 7566 +++++++++++++++++ .../common/src/generated/_Collections.kt | 1063 +++ .../stdlib/common/src/generated/_Maps.kt | 132 + .../stdlib/common/src/generated/_Ranges.kt | 645 ++ .../stdlib/common/src/generated/_Sequences.kt | 755 ++ .../stdlib/common/src/generated/_Sets.kt | 86 + .../stdlib/common/src/generated/_Strings.kt | 665 ++ .../src/generators/GenerateStandardLib.kt | 2 +- 8 files changed, 10913 insertions(+), 1 deletion(-) create mode 100644 libraries/stdlib/common/src/generated/_Arrays.kt create mode 100644 libraries/stdlib/common/src/generated/_Collections.kt create mode 100644 libraries/stdlib/common/src/generated/_Maps.kt create mode 100644 libraries/stdlib/common/src/generated/_Ranges.kt create mode 100644 libraries/stdlib/common/src/generated/_Sequences.kt create mode 100644 libraries/stdlib/common/src/generated/_Sets.kt create mode 100644 libraries/stdlib/common/src/generated/_Strings.kt diff --git a/libraries/stdlib/common/src/generated/_Arrays.kt b/libraries/stdlib/common/src/generated/_Arrays.kt new file mode 100644 index 00000000000..2f175d63ad0 --- /dev/null +++ b/libraries/stdlib/common/src/generated/_Arrays.kt @@ -0,0 +1,7566 @@ +@file:kotlin.jvm.JvmMultifileClass +@file:kotlin.jvm.JvmName("ArraysKt") + +package kotlin.collections + +// +// NOTE THIS FILE IS AUTO-GENERATED by the GenerateStandardLib.kt +// See: https://github.com/JetBrains/kotlin/tree/master/libraries/stdlib +// + +import kotlin.comparisons.* + +/** + * Returns 1st *element* from the collection. + */ +@kotlin.internal.InlineOnly +public header inline operator fun Array.component1(): T + +/** + * Returns 1st *element* from the collection. + */ +@kotlin.internal.InlineOnly +public header inline operator fun ByteArray.component1(): Byte + +/** + * Returns 1st *element* from the collection. + */ +@kotlin.internal.InlineOnly +public header inline operator fun ShortArray.component1(): Short + +/** + * Returns 1st *element* from the collection. + */ +@kotlin.internal.InlineOnly +public header inline operator fun IntArray.component1(): Int + +/** + * Returns 1st *element* from the collection. + */ +@kotlin.internal.InlineOnly +public header inline operator fun LongArray.component1(): Long + +/** + * Returns 1st *element* from the collection. + */ +@kotlin.internal.InlineOnly +public header inline operator fun FloatArray.component1(): Float + +/** + * Returns 1st *element* from the collection. + */ +@kotlin.internal.InlineOnly +public header inline operator fun DoubleArray.component1(): Double + +/** + * Returns 1st *element* from the collection. + */ +@kotlin.internal.InlineOnly +public header inline operator fun BooleanArray.component1(): Boolean + +/** + * Returns 1st *element* from the collection. + */ +@kotlin.internal.InlineOnly +public header inline operator fun CharArray.component1(): Char + +/** + * Returns 2nd *element* from the collection. + */ +@kotlin.internal.InlineOnly +public header inline operator fun Array.component2(): T + +/** + * Returns 2nd *element* from the collection. + */ +@kotlin.internal.InlineOnly +public header inline operator fun ByteArray.component2(): Byte + +/** + * Returns 2nd *element* from the collection. + */ +@kotlin.internal.InlineOnly +public header inline operator fun ShortArray.component2(): Short + +/** + * Returns 2nd *element* from the collection. + */ +@kotlin.internal.InlineOnly +public header inline operator fun IntArray.component2(): Int + +/** + * Returns 2nd *element* from the collection. + */ +@kotlin.internal.InlineOnly +public header inline operator fun LongArray.component2(): Long + +/** + * Returns 2nd *element* from the collection. + */ +@kotlin.internal.InlineOnly +public header inline operator fun FloatArray.component2(): Float + +/** + * Returns 2nd *element* from the collection. + */ +@kotlin.internal.InlineOnly +public header inline operator fun DoubleArray.component2(): Double + +/** + * Returns 2nd *element* from the collection. + */ +@kotlin.internal.InlineOnly +public header inline operator fun BooleanArray.component2(): Boolean + +/** + * Returns 2nd *element* from the collection. + */ +@kotlin.internal.InlineOnly +public header inline operator fun CharArray.component2(): Char + +/** + * Returns 3rd *element* from the collection. + */ +@kotlin.internal.InlineOnly +public header inline operator fun Array.component3(): T + +/** + * Returns 3rd *element* from the collection. + */ +@kotlin.internal.InlineOnly +public header inline operator fun ByteArray.component3(): Byte + +/** + * Returns 3rd *element* from the collection. + */ +@kotlin.internal.InlineOnly +public header inline operator fun ShortArray.component3(): Short + +/** + * Returns 3rd *element* from the collection. + */ +@kotlin.internal.InlineOnly +public header inline operator fun IntArray.component3(): Int + +/** + * Returns 3rd *element* from the collection. + */ +@kotlin.internal.InlineOnly +public header inline operator fun LongArray.component3(): Long + +/** + * Returns 3rd *element* from the collection. + */ +@kotlin.internal.InlineOnly +public header inline operator fun FloatArray.component3(): Float + +/** + * Returns 3rd *element* from the collection. + */ +@kotlin.internal.InlineOnly +public header inline operator fun DoubleArray.component3(): Double + +/** + * Returns 3rd *element* from the collection. + */ +@kotlin.internal.InlineOnly +public header inline operator fun BooleanArray.component3(): Boolean + +/** + * Returns 3rd *element* from the collection. + */ +@kotlin.internal.InlineOnly +public header inline operator fun CharArray.component3(): Char + +/** + * Returns 4th *element* from the collection. + */ +@kotlin.internal.InlineOnly +public header inline operator fun Array.component4(): T + +/** + * Returns 4th *element* from the collection. + */ +@kotlin.internal.InlineOnly +public header inline operator fun ByteArray.component4(): Byte + +/** + * Returns 4th *element* from the collection. + */ +@kotlin.internal.InlineOnly +public header inline operator fun ShortArray.component4(): Short + +/** + * Returns 4th *element* from the collection. + */ +@kotlin.internal.InlineOnly +public header inline operator fun IntArray.component4(): Int + +/** + * Returns 4th *element* from the collection. + */ +@kotlin.internal.InlineOnly +public header inline operator fun LongArray.component4(): Long + +/** + * Returns 4th *element* from the collection. + */ +@kotlin.internal.InlineOnly +public header inline operator fun FloatArray.component4(): Float + +/** + * Returns 4th *element* from the collection. + */ +@kotlin.internal.InlineOnly +public header inline operator fun DoubleArray.component4(): Double + +/** + * Returns 4th *element* from the collection. + */ +@kotlin.internal.InlineOnly +public header inline operator fun BooleanArray.component4(): Boolean + +/** + * Returns 4th *element* from the collection. + */ +@kotlin.internal.InlineOnly +public header inline operator fun CharArray.component4(): Char + +/** + * Returns 5th *element* from the collection. + */ +@kotlin.internal.InlineOnly +public header inline operator fun Array.component5(): T + +/** + * Returns 5th *element* from the collection. + */ +@kotlin.internal.InlineOnly +public header inline operator fun ByteArray.component5(): Byte + +/** + * Returns 5th *element* from the collection. + */ +@kotlin.internal.InlineOnly +public header inline operator fun ShortArray.component5(): Short + +/** + * Returns 5th *element* from the collection. + */ +@kotlin.internal.InlineOnly +public header inline operator fun IntArray.component5(): Int + +/** + * Returns 5th *element* from the collection. + */ +@kotlin.internal.InlineOnly +public header inline operator fun LongArray.component5(): Long + +/** + * Returns 5th *element* from the collection. + */ +@kotlin.internal.InlineOnly +public header inline operator fun FloatArray.component5(): Float + +/** + * Returns 5th *element* from the collection. + */ +@kotlin.internal.InlineOnly +public header inline operator fun DoubleArray.component5(): Double + +/** + * Returns 5th *element* from the collection. + */ +@kotlin.internal.InlineOnly +public header inline operator fun BooleanArray.component5(): Boolean + +/** + * Returns 5th *element* from the collection. + */ +@kotlin.internal.InlineOnly +public header inline operator fun CharArray.component5(): Char + +/** + * Returns `true` if [element] is found in the array. + */ +public header operator fun <@kotlin.internal.OnlyInputTypes T> Array.contains(element: T): Boolean + +/** + * Returns `true` if [element] is found in the array. + */ +public header operator fun ByteArray.contains(element: Byte): Boolean + +/** + * Returns `true` if [element] is found in the array. + */ +public header operator fun ShortArray.contains(element: Short): Boolean + +/** + * Returns `true` if [element] is found in the array. + */ +public header operator fun IntArray.contains(element: Int): Boolean + +/** + * Returns `true` if [element] is found in the array. + */ +public header operator fun LongArray.contains(element: Long): Boolean + +/** + * Returns `true` if [element] is found in the array. + */ +public header operator fun FloatArray.contains(element: Float): Boolean + +/** + * Returns `true` if [element] is found in the array. + */ +public header operator fun DoubleArray.contains(element: Double): Boolean + +/** + * Returns `true` if [element] is found in the array. + */ +public header operator fun BooleanArray.contains(element: Boolean): Boolean + +/** + * Returns `true` if [element] is found in the array. + */ +public header operator fun CharArray.contains(element: Char): Boolean + +/** + * Returns an element at the given [index] or throws an [IndexOutOfBoundsException] if the [index] is out of bounds of this array. + */ +@kotlin.internal.InlineOnly +public header inline fun Array.elementAt(index: Int): T + +/** + * Returns an element at the given [index] or throws an [IndexOutOfBoundsException] if the [index] is out of bounds of this array. + */ +@kotlin.internal.InlineOnly +public header inline fun ByteArray.elementAt(index: Int): Byte + +/** + * Returns an element at the given [index] or throws an [IndexOutOfBoundsException] if the [index] is out of bounds of this array. + */ +@kotlin.internal.InlineOnly +public header inline fun ShortArray.elementAt(index: Int): Short + +/** + * Returns an element at the given [index] or throws an [IndexOutOfBoundsException] if the [index] is out of bounds of this array. + */ +@kotlin.internal.InlineOnly +public header inline fun IntArray.elementAt(index: Int): Int + +/** + * Returns an element at the given [index] or throws an [IndexOutOfBoundsException] if the [index] is out of bounds of this array. + */ +@kotlin.internal.InlineOnly +public header inline fun LongArray.elementAt(index: Int): Long + +/** + * Returns an element at the given [index] or throws an [IndexOutOfBoundsException] if the [index] is out of bounds of this array. + */ +@kotlin.internal.InlineOnly +public header inline fun FloatArray.elementAt(index: Int): Float + +/** + * Returns an element at the given [index] or throws an [IndexOutOfBoundsException] if the [index] is out of bounds of this array. + */ +@kotlin.internal.InlineOnly +public header inline fun DoubleArray.elementAt(index: Int): Double + +/** + * Returns an element at the given [index] or throws an [IndexOutOfBoundsException] if the [index] is out of bounds of this array. + */ +@kotlin.internal.InlineOnly +public header inline fun BooleanArray.elementAt(index: Int): Boolean + +/** + * Returns an element at the given [index] or throws an [IndexOutOfBoundsException] if the [index] is out of bounds of this array. + */ +@kotlin.internal.InlineOnly +public header inline fun CharArray.elementAt(index: Int): Char + +/** + * Returns an element at the given [index] or the result of calling the [defaultValue] function if the [index] is out of bounds of this array. + */ +@kotlin.internal.InlineOnly +public header inline fun Array.elementAtOrElse(index: Int, defaultValue: (Int) -> T): T + +/** + * Returns an element at the given [index] or the result of calling the [defaultValue] function if the [index] is out of bounds of this array. + */ +@kotlin.internal.InlineOnly +public header inline fun ByteArray.elementAtOrElse(index: Int, defaultValue: (Int) -> Byte): Byte + +/** + * Returns an element at the given [index] or the result of calling the [defaultValue] function if the [index] is out of bounds of this array. + */ +@kotlin.internal.InlineOnly +public header inline fun ShortArray.elementAtOrElse(index: Int, defaultValue: (Int) -> Short): Short + +/** + * Returns an element at the given [index] or the result of calling the [defaultValue] function if the [index] is out of bounds of this array. + */ +@kotlin.internal.InlineOnly +public header inline fun IntArray.elementAtOrElse(index: Int, defaultValue: (Int) -> Int): Int + +/** + * Returns an element at the given [index] or the result of calling the [defaultValue] function if the [index] is out of bounds of this array. + */ +@kotlin.internal.InlineOnly +public header inline fun LongArray.elementAtOrElse(index: Int, defaultValue: (Int) -> Long): Long + +/** + * Returns an element at the given [index] or the result of calling the [defaultValue] function if the [index] is out of bounds of this array. + */ +@kotlin.internal.InlineOnly +public header inline fun FloatArray.elementAtOrElse(index: Int, defaultValue: (Int) -> Float): Float + +/** + * Returns an element at the given [index] or the result of calling the [defaultValue] function if the [index] is out of bounds of this array. + */ +@kotlin.internal.InlineOnly +public header inline fun DoubleArray.elementAtOrElse(index: Int, defaultValue: (Int) -> Double): Double + +/** + * Returns an element at the given [index] or the result of calling the [defaultValue] function if the [index] is out of bounds of this array. + */ +@kotlin.internal.InlineOnly +public header inline fun BooleanArray.elementAtOrElse(index: Int, defaultValue: (Int) -> Boolean): Boolean + +/** + * Returns an element at the given [index] or the result of calling the [defaultValue] function if the [index] is out of bounds of this array. + */ +@kotlin.internal.InlineOnly +public header inline fun CharArray.elementAtOrElse(index: Int, defaultValue: (Int) -> Char): Char + +/** + * Returns an element at the given [index] or `null` if the [index] is out of bounds of this array. + */ +@kotlin.internal.InlineOnly +public header inline fun Array.elementAtOrNull(index: Int): T? + +/** + * Returns an element at the given [index] or `null` if the [index] is out of bounds of this array. + */ +@kotlin.internal.InlineOnly +public header inline fun ByteArray.elementAtOrNull(index: Int): Byte? + +/** + * Returns an element at the given [index] or `null` if the [index] is out of bounds of this array. + */ +@kotlin.internal.InlineOnly +public header inline fun ShortArray.elementAtOrNull(index: Int): Short? + +/** + * Returns an element at the given [index] or `null` if the [index] is out of bounds of this array. + */ +@kotlin.internal.InlineOnly +public header inline fun IntArray.elementAtOrNull(index: Int): Int? + +/** + * Returns an element at the given [index] or `null` if the [index] is out of bounds of this array. + */ +@kotlin.internal.InlineOnly +public header inline fun LongArray.elementAtOrNull(index: Int): Long? + +/** + * Returns an element at the given [index] or `null` if the [index] is out of bounds of this array. + */ +@kotlin.internal.InlineOnly +public header inline fun FloatArray.elementAtOrNull(index: Int): Float? + +/** + * Returns an element at the given [index] or `null` if the [index] is out of bounds of this array. + */ +@kotlin.internal.InlineOnly +public header inline fun DoubleArray.elementAtOrNull(index: Int): Double? + +/** + * Returns an element at the given [index] or `null` if the [index] is out of bounds of this array. + */ +@kotlin.internal.InlineOnly +public header inline fun BooleanArray.elementAtOrNull(index: Int): Boolean? + +/** + * Returns an element at the given [index] or `null` if the [index] is out of bounds of this array. + */ +@kotlin.internal.InlineOnly +public header inline fun CharArray.elementAtOrNull(index: Int): Char? + +/** + * Returns the first element matching the given [predicate], or `null` if no such element was found. + */ +@kotlin.internal.InlineOnly +public header inline fun Array.find(predicate: (T) -> Boolean): T? + +/** + * Returns the first element matching the given [predicate], or `null` if no such element was found. + */ +@kotlin.internal.InlineOnly +public header inline fun ByteArray.find(predicate: (Byte) -> Boolean): Byte? + +/** + * Returns the first element matching the given [predicate], or `null` if no such element was found. + */ +@kotlin.internal.InlineOnly +public header inline fun ShortArray.find(predicate: (Short) -> Boolean): Short? + +/** + * Returns the first element matching the given [predicate], or `null` if no such element was found. + */ +@kotlin.internal.InlineOnly +public header inline fun IntArray.find(predicate: (Int) -> Boolean): Int? + +/** + * Returns the first element matching the given [predicate], or `null` if no such element was found. + */ +@kotlin.internal.InlineOnly +public header inline fun LongArray.find(predicate: (Long) -> Boolean): Long? + +/** + * Returns the first element matching the given [predicate], or `null` if no such element was found. + */ +@kotlin.internal.InlineOnly +public header inline fun FloatArray.find(predicate: (Float) -> Boolean): Float? + +/** + * Returns the first element matching the given [predicate], or `null` if no such element was found. + */ +@kotlin.internal.InlineOnly +public header inline fun DoubleArray.find(predicate: (Double) -> Boolean): Double? + +/** + * Returns the first element matching the given [predicate], or `null` if no such element was found. + */ +@kotlin.internal.InlineOnly +public header inline fun BooleanArray.find(predicate: (Boolean) -> Boolean): Boolean? + +/** + * Returns the first element matching the given [predicate], or `null` if no such element was found. + */ +@kotlin.internal.InlineOnly +public header inline fun CharArray.find(predicate: (Char) -> Boolean): Char? + +/** + * Returns the last element matching the given [predicate], or `null` if no such element was found. + */ +@kotlin.internal.InlineOnly +public header inline fun Array.findLast(predicate: (T) -> Boolean): T? + +/** + * Returns the last element matching the given [predicate], or `null` if no such element was found. + */ +@kotlin.internal.InlineOnly +public header inline fun ByteArray.findLast(predicate: (Byte) -> Boolean): Byte? + +/** + * Returns the last element matching the given [predicate], or `null` if no such element was found. + */ +@kotlin.internal.InlineOnly +public header inline fun ShortArray.findLast(predicate: (Short) -> Boolean): Short? + +/** + * Returns the last element matching the given [predicate], or `null` if no such element was found. + */ +@kotlin.internal.InlineOnly +public header inline fun IntArray.findLast(predicate: (Int) -> Boolean): Int? + +/** + * Returns the last element matching the given [predicate], or `null` if no such element was found. + */ +@kotlin.internal.InlineOnly +public header inline fun LongArray.findLast(predicate: (Long) -> Boolean): Long? + +/** + * Returns the last element matching the given [predicate], or `null` if no such element was found. + */ +@kotlin.internal.InlineOnly +public header inline fun FloatArray.findLast(predicate: (Float) -> Boolean): Float? + +/** + * Returns the last element matching the given [predicate], or `null` if no such element was found. + */ +@kotlin.internal.InlineOnly +public header inline fun DoubleArray.findLast(predicate: (Double) -> Boolean): Double? + +/** + * Returns the last element matching the given [predicate], or `null` if no such element was found. + */ +@kotlin.internal.InlineOnly +public header inline fun BooleanArray.findLast(predicate: (Boolean) -> Boolean): Boolean? + +/** + * Returns the last element matching the given [predicate], or `null` if no such element was found. + */ +@kotlin.internal.InlineOnly +public header inline fun CharArray.findLast(predicate: (Char) -> Boolean): Char? + +/** + * Returns first element. + * @throws [NoSuchElementException] if the array is empty. + */ +public header fun Array.first(): T + +/** + * Returns first element. + * @throws [NoSuchElementException] if the array is empty. + */ +public header fun ByteArray.first(): Byte + +/** + * Returns first element. + * @throws [NoSuchElementException] if the array is empty. + */ +public header fun ShortArray.first(): Short + +/** + * Returns first element. + * @throws [NoSuchElementException] if the array is empty. + */ +public header fun IntArray.first(): Int + +/** + * Returns first element. + * @throws [NoSuchElementException] if the array is empty. + */ +public header fun LongArray.first(): Long + +/** + * Returns first element. + * @throws [NoSuchElementException] if the array is empty. + */ +public header fun FloatArray.first(): Float + +/** + * Returns first element. + * @throws [NoSuchElementException] if the array is empty. + */ +public header fun DoubleArray.first(): Double + +/** + * Returns first element. + * @throws [NoSuchElementException] if the array is empty. + */ +public header fun BooleanArray.first(): Boolean + +/** + * Returns first element. + * @throws [NoSuchElementException] if the array is empty. + */ +public header fun CharArray.first(): Char + +/** + * Returns the first element matching the given [predicate]. + * @throws [NoSuchElementException] if no such element is found. + */ +public header inline fun Array.first(predicate: (T) -> Boolean): T + +/** + * Returns the first element matching the given [predicate]. + * @throws [NoSuchElementException] if no such element is found. + */ +public header inline fun ByteArray.first(predicate: (Byte) -> Boolean): Byte + +/** + * Returns the first element matching the given [predicate]. + * @throws [NoSuchElementException] if no such element is found. + */ +public header inline fun ShortArray.first(predicate: (Short) -> Boolean): Short + +/** + * Returns the first element matching the given [predicate]. + * @throws [NoSuchElementException] if no such element is found. + */ +public header inline fun IntArray.first(predicate: (Int) -> Boolean): Int + +/** + * Returns the first element matching the given [predicate]. + * @throws [NoSuchElementException] if no such element is found. + */ +public header inline fun LongArray.first(predicate: (Long) -> Boolean): Long + +/** + * Returns the first element matching the given [predicate]. + * @throws [NoSuchElementException] if no such element is found. + */ +public header inline fun FloatArray.first(predicate: (Float) -> Boolean): Float + +/** + * Returns the first element matching the given [predicate]. + * @throws [NoSuchElementException] if no such element is found. + */ +public header inline fun DoubleArray.first(predicate: (Double) -> Boolean): Double + +/** + * Returns the first element matching the given [predicate]. + * @throws [NoSuchElementException] if no such element is found. + */ +public header inline fun BooleanArray.first(predicate: (Boolean) -> Boolean): Boolean + +/** + * Returns the first element matching the given [predicate]. + * @throws [NoSuchElementException] if no such element is found. + */ +public header inline fun CharArray.first(predicate: (Char) -> Boolean): Char + +/** + * Returns the first element, or `null` if the array is empty. + */ +public header fun Array.firstOrNull(): T? + +/** + * Returns the first element, or `null` if the array is empty. + */ +public header fun ByteArray.firstOrNull(): Byte? + +/** + * Returns the first element, or `null` if the array is empty. + */ +public header fun ShortArray.firstOrNull(): Short? + +/** + * Returns the first element, or `null` if the array is empty. + */ +public header fun IntArray.firstOrNull(): Int? + +/** + * Returns the first element, or `null` if the array is empty. + */ +public header fun LongArray.firstOrNull(): Long? + +/** + * Returns the first element, or `null` if the array is empty. + */ +public header fun FloatArray.firstOrNull(): Float? + +/** + * Returns the first element, or `null` if the array is empty. + */ +public header fun DoubleArray.firstOrNull(): Double? + +/** + * Returns the first element, or `null` if the array is empty. + */ +public header fun BooleanArray.firstOrNull(): Boolean? + +/** + * Returns the first element, or `null` if the array is empty. + */ +public header fun CharArray.firstOrNull(): Char? + +/** + * Returns the first element matching the given [predicate], or `null` if element was not found. + */ +public header inline fun Array.firstOrNull(predicate: (T) -> Boolean): T? + +/** + * Returns the first element matching the given [predicate], or `null` if element was not found. + */ +public header inline fun ByteArray.firstOrNull(predicate: (Byte) -> Boolean): Byte? + +/** + * Returns the first element matching the given [predicate], or `null` if element was not found. + */ +public header inline fun ShortArray.firstOrNull(predicate: (Short) -> Boolean): Short? + +/** + * Returns the first element matching the given [predicate], or `null` if element was not found. + */ +public header inline fun IntArray.firstOrNull(predicate: (Int) -> Boolean): Int? + +/** + * Returns the first element matching the given [predicate], or `null` if element was not found. + */ +public header inline fun LongArray.firstOrNull(predicate: (Long) -> Boolean): Long? + +/** + * Returns the first element matching the given [predicate], or `null` if element was not found. + */ +public header inline fun FloatArray.firstOrNull(predicate: (Float) -> Boolean): Float? + +/** + * Returns the first element matching the given [predicate], or `null` if element was not found. + */ +public header inline fun DoubleArray.firstOrNull(predicate: (Double) -> Boolean): Double? + +/** + * Returns the first element matching the given [predicate], or `null` if element was not found. + */ +public header inline fun BooleanArray.firstOrNull(predicate: (Boolean) -> Boolean): Boolean? + +/** + * Returns the first element matching the given [predicate], or `null` if element was not found. + */ +public header inline fun CharArray.firstOrNull(predicate: (Char) -> Boolean): Char? + +/** + * Returns an element at the given [index] or the result of calling the [defaultValue] function if the [index] is out of bounds of this array. + */ +@kotlin.internal.InlineOnly +public header inline fun Array.getOrElse(index: Int, defaultValue: (Int) -> T): T + +/** + * Returns an element at the given [index] or the result of calling the [defaultValue] function if the [index] is out of bounds of this array. + */ +@kotlin.internal.InlineOnly +public header inline fun ByteArray.getOrElse(index: Int, defaultValue: (Int) -> Byte): Byte + +/** + * Returns an element at the given [index] or the result of calling the [defaultValue] function if the [index] is out of bounds of this array. + */ +@kotlin.internal.InlineOnly +public header inline fun ShortArray.getOrElse(index: Int, defaultValue: (Int) -> Short): Short + +/** + * Returns an element at the given [index] or the result of calling the [defaultValue] function if the [index] is out of bounds of this array. + */ +@kotlin.internal.InlineOnly +public header inline fun IntArray.getOrElse(index: Int, defaultValue: (Int) -> Int): Int + +/** + * Returns an element at the given [index] or the result of calling the [defaultValue] function if the [index] is out of bounds of this array. + */ +@kotlin.internal.InlineOnly +public header inline fun LongArray.getOrElse(index: Int, defaultValue: (Int) -> Long): Long + +/** + * Returns an element at the given [index] or the result of calling the [defaultValue] function if the [index] is out of bounds of this array. + */ +@kotlin.internal.InlineOnly +public header inline fun FloatArray.getOrElse(index: Int, defaultValue: (Int) -> Float): Float + +/** + * Returns an element at the given [index] or the result of calling the [defaultValue] function if the [index] is out of bounds of this array. + */ +@kotlin.internal.InlineOnly +public header inline fun DoubleArray.getOrElse(index: Int, defaultValue: (Int) -> Double): Double + +/** + * Returns an element at the given [index] or the result of calling the [defaultValue] function if the [index] is out of bounds of this array. + */ +@kotlin.internal.InlineOnly +public header inline fun BooleanArray.getOrElse(index: Int, defaultValue: (Int) -> Boolean): Boolean + +/** + * Returns an element at the given [index] or the result of calling the [defaultValue] function if the [index] is out of bounds of this array. + */ +@kotlin.internal.InlineOnly +public header inline fun CharArray.getOrElse(index: Int, defaultValue: (Int) -> Char): Char + +/** + * Returns an element at the given [index] or `null` if the [index] is out of bounds of this array. + */ +public header fun Array.getOrNull(index: Int): T? + +/** + * Returns an element at the given [index] or `null` if the [index] is out of bounds of this array. + */ +public header fun ByteArray.getOrNull(index: Int): Byte? + +/** + * Returns an element at the given [index] or `null` if the [index] is out of bounds of this array. + */ +public header fun ShortArray.getOrNull(index: Int): Short? + +/** + * Returns an element at the given [index] or `null` if the [index] is out of bounds of this array. + */ +public header fun IntArray.getOrNull(index: Int): Int? + +/** + * Returns an element at the given [index] or `null` if the [index] is out of bounds of this array. + */ +public header fun LongArray.getOrNull(index: Int): Long? + +/** + * Returns an element at the given [index] or `null` if the [index] is out of bounds of this array. + */ +public header fun FloatArray.getOrNull(index: Int): Float? + +/** + * Returns an element at the given [index] or `null` if the [index] is out of bounds of this array. + */ +public header fun DoubleArray.getOrNull(index: Int): Double? + +/** + * Returns an element at the given [index] or `null` if the [index] is out of bounds of this array. + */ +public header fun BooleanArray.getOrNull(index: Int): Boolean? + +/** + * Returns an element at the given [index] or `null` if the [index] is out of bounds of this array. + */ +public header fun CharArray.getOrNull(index: Int): Char? + +/** + * Returns first index of [element], or -1 if the array does not contain element. + */ +public header fun <@kotlin.internal.OnlyInputTypes T> Array.indexOf(element: T): Int + +/** + * Returns first index of [element], or -1 if the array does not contain element. + */ +public header fun ByteArray.indexOf(element: Byte): Int + +/** + * Returns first index of [element], or -1 if the array does not contain element. + */ +public header fun ShortArray.indexOf(element: Short): Int + +/** + * Returns first index of [element], or -1 if the array does not contain element. + */ +public header fun IntArray.indexOf(element: Int): Int + +/** + * Returns first index of [element], or -1 if the array does not contain element. + */ +public header fun LongArray.indexOf(element: Long): Int + +/** + * Returns first index of [element], or -1 if the array does not contain element. + */ +public header fun FloatArray.indexOf(element: Float): Int + +/** + * Returns first index of [element], or -1 if the array does not contain element. + */ +public header fun DoubleArray.indexOf(element: Double): Int + +/** + * Returns first index of [element], or -1 if the array does not contain element. + */ +public header fun BooleanArray.indexOf(element: Boolean): Int + +/** + * Returns first index of [element], or -1 if the array does not contain element. + */ +public header fun CharArray.indexOf(element: Char): Int + +/** + * Returns index of the first element matching the given [predicate], or -1 if the array does not contain such element. + */ +public header inline fun Array.indexOfFirst(predicate: (T) -> Boolean): Int + +/** + * Returns index of the first element matching the given [predicate], or -1 if the array does not contain such element. + */ +public header inline fun ByteArray.indexOfFirst(predicate: (Byte) -> Boolean): Int + +/** + * Returns index of the first element matching the given [predicate], or -1 if the array does not contain such element. + */ +public header inline fun ShortArray.indexOfFirst(predicate: (Short) -> Boolean): Int + +/** + * Returns index of the first element matching the given [predicate], or -1 if the array does not contain such element. + */ +public header inline fun IntArray.indexOfFirst(predicate: (Int) -> Boolean): Int + +/** + * Returns index of the first element matching the given [predicate], or -1 if the array does not contain such element. + */ +public header inline fun LongArray.indexOfFirst(predicate: (Long) -> Boolean): Int + +/** + * Returns index of the first element matching the given [predicate], or -1 if the array does not contain such element. + */ +public header inline fun FloatArray.indexOfFirst(predicate: (Float) -> Boolean): Int + +/** + * Returns index of the first element matching the given [predicate], or -1 if the array does not contain such element. + */ +public header inline fun DoubleArray.indexOfFirst(predicate: (Double) -> Boolean): Int + +/** + * Returns index of the first element matching the given [predicate], or -1 if the array does not contain such element. + */ +public header inline fun BooleanArray.indexOfFirst(predicate: (Boolean) -> Boolean): Int + +/** + * Returns index of the first element matching the given [predicate], or -1 if the array does not contain such element. + */ +public header inline fun CharArray.indexOfFirst(predicate: (Char) -> Boolean): Int + +/** + * Returns index of the last element matching the given [predicate], or -1 if the array does not contain such element. + */ +public header inline fun Array.indexOfLast(predicate: (T) -> Boolean): Int + +/** + * Returns index of the last element matching the given [predicate], or -1 if the array does not contain such element. + */ +public header inline fun ByteArray.indexOfLast(predicate: (Byte) -> Boolean): Int + +/** + * Returns index of the last element matching the given [predicate], or -1 if the array does not contain such element. + */ +public header inline fun ShortArray.indexOfLast(predicate: (Short) -> Boolean): Int + +/** + * Returns index of the last element matching the given [predicate], or -1 if the array does not contain such element. + */ +public header inline fun IntArray.indexOfLast(predicate: (Int) -> Boolean): Int + +/** + * Returns index of the last element matching the given [predicate], or -1 if the array does not contain such element. + */ +public header inline fun LongArray.indexOfLast(predicate: (Long) -> Boolean): Int + +/** + * Returns index of the last element matching the given [predicate], or -1 if the array does not contain such element. + */ +public header inline fun FloatArray.indexOfLast(predicate: (Float) -> Boolean): Int + +/** + * Returns index of the last element matching the given [predicate], or -1 if the array does not contain such element. + */ +public header inline fun DoubleArray.indexOfLast(predicate: (Double) -> Boolean): Int + +/** + * Returns index of the last element matching the given [predicate], or -1 if the array does not contain such element. + */ +public header inline fun BooleanArray.indexOfLast(predicate: (Boolean) -> Boolean): Int + +/** + * Returns index of the last element matching the given [predicate], or -1 if the array does not contain such element. + */ +public header inline fun CharArray.indexOfLast(predicate: (Char) -> Boolean): Int + +/** + * Returns the last element. + * @throws [NoSuchElementException] if the array is empty. + */ +public header fun Array.last(): T + +/** + * Returns the last element. + * @throws [NoSuchElementException] if the array is empty. + */ +public header fun ByteArray.last(): Byte + +/** + * Returns the last element. + * @throws [NoSuchElementException] if the array is empty. + */ +public header fun ShortArray.last(): Short + +/** + * Returns the last element. + * @throws [NoSuchElementException] if the array is empty. + */ +public header fun IntArray.last(): Int + +/** + * Returns the last element. + * @throws [NoSuchElementException] if the array is empty. + */ +public header fun LongArray.last(): Long + +/** + * Returns the last element. + * @throws [NoSuchElementException] if the array is empty. + */ +public header fun FloatArray.last(): Float + +/** + * Returns the last element. + * @throws [NoSuchElementException] if the array is empty. + */ +public header fun DoubleArray.last(): Double + +/** + * Returns the last element. + * @throws [NoSuchElementException] if the array is empty. + */ +public header fun BooleanArray.last(): Boolean + +/** + * Returns the last element. + * @throws [NoSuchElementException] if the array is empty. + */ +public header fun CharArray.last(): Char + +/** + * Returns the last element matching the given [predicate]. + * @throws [NoSuchElementException] if no such element is found. + */ +public header inline fun Array.last(predicate: (T) -> Boolean): T + +/** + * Returns the last element matching the given [predicate]. + * @throws [NoSuchElementException] if no such element is found. + */ +public header inline fun ByteArray.last(predicate: (Byte) -> Boolean): Byte + +/** + * Returns the last element matching the given [predicate]. + * @throws [NoSuchElementException] if no such element is found. + */ +public header inline fun ShortArray.last(predicate: (Short) -> Boolean): Short + +/** + * Returns the last element matching the given [predicate]. + * @throws [NoSuchElementException] if no such element is found. + */ +public header inline fun IntArray.last(predicate: (Int) -> Boolean): Int + +/** + * Returns the last element matching the given [predicate]. + * @throws [NoSuchElementException] if no such element is found. + */ +public header inline fun LongArray.last(predicate: (Long) -> Boolean): Long + +/** + * Returns the last element matching the given [predicate]. + * @throws [NoSuchElementException] if no such element is found. + */ +public header inline fun FloatArray.last(predicate: (Float) -> Boolean): Float + +/** + * Returns the last element matching the given [predicate]. + * @throws [NoSuchElementException] if no such element is found. + */ +public header inline fun DoubleArray.last(predicate: (Double) -> Boolean): Double + +/** + * Returns the last element matching the given [predicate]. + * @throws [NoSuchElementException] if no such element is found. + */ +public header inline fun BooleanArray.last(predicate: (Boolean) -> Boolean): Boolean + +/** + * Returns the last element matching the given [predicate]. + * @throws [NoSuchElementException] if no such element is found. + */ +public header inline fun CharArray.last(predicate: (Char) -> Boolean): Char + +/** + * Returns last index of [element], or -1 if the array does not contain element. + */ +public header fun <@kotlin.internal.OnlyInputTypes T> Array.lastIndexOf(element: T): Int + +/** + * Returns last index of [element], or -1 if the array does not contain element. + */ +public header fun ByteArray.lastIndexOf(element: Byte): Int + +/** + * Returns last index of [element], or -1 if the array does not contain element. + */ +public header fun ShortArray.lastIndexOf(element: Short): Int + +/** + * Returns last index of [element], or -1 if the array does not contain element. + */ +public header fun IntArray.lastIndexOf(element: Int): Int + +/** + * Returns last index of [element], or -1 if the array does not contain element. + */ +public header fun LongArray.lastIndexOf(element: Long): Int + +/** + * Returns last index of [element], or -1 if the array does not contain element. + */ +public header fun FloatArray.lastIndexOf(element: Float): Int + +/** + * Returns last index of [element], or -1 if the array does not contain element. + */ +public header fun DoubleArray.lastIndexOf(element: Double): Int + +/** + * Returns last index of [element], or -1 if the array does not contain element. + */ +public header fun BooleanArray.lastIndexOf(element: Boolean): Int + +/** + * Returns last index of [element], or -1 if the array does not contain element. + */ +public header fun CharArray.lastIndexOf(element: Char): Int + +/** + * Returns the last element, or `null` if the array is empty. + */ +public header fun Array.lastOrNull(): T? + +/** + * Returns the last element, or `null` if the array is empty. + */ +public header fun ByteArray.lastOrNull(): Byte? + +/** + * Returns the last element, or `null` if the array is empty. + */ +public header fun ShortArray.lastOrNull(): Short? + +/** + * Returns the last element, or `null` if the array is empty. + */ +public header fun IntArray.lastOrNull(): Int? + +/** + * Returns the last element, or `null` if the array is empty. + */ +public header fun LongArray.lastOrNull(): Long? + +/** + * Returns the last element, or `null` if the array is empty. + */ +public header fun FloatArray.lastOrNull(): Float? + +/** + * Returns the last element, or `null` if the array is empty. + */ +public header fun DoubleArray.lastOrNull(): Double? + +/** + * Returns the last element, or `null` if the array is empty. + */ +public header fun BooleanArray.lastOrNull(): Boolean? + +/** + * Returns the last element, or `null` if the array is empty. + */ +public header fun CharArray.lastOrNull(): Char? + +/** + * Returns the last element matching the given [predicate], or `null` if no such element was found. + */ +public header inline fun Array.lastOrNull(predicate: (T) -> Boolean): T? + +/** + * Returns the last element matching the given [predicate], or `null` if no such element was found. + */ +public header inline fun ByteArray.lastOrNull(predicate: (Byte) -> Boolean): Byte? + +/** + * Returns the last element matching the given [predicate], or `null` if no such element was found. + */ +public header inline fun ShortArray.lastOrNull(predicate: (Short) -> Boolean): Short? + +/** + * Returns the last element matching the given [predicate], or `null` if no such element was found. + */ +public header inline fun IntArray.lastOrNull(predicate: (Int) -> Boolean): Int? + +/** + * Returns the last element matching the given [predicate], or `null` if no such element was found. + */ +public header inline fun LongArray.lastOrNull(predicate: (Long) -> Boolean): Long? + +/** + * Returns the last element matching the given [predicate], or `null` if no such element was found. + */ +public header inline fun FloatArray.lastOrNull(predicate: (Float) -> Boolean): Float? + +/** + * Returns the last element matching the given [predicate], or `null` if no such element was found. + */ +public header inline fun DoubleArray.lastOrNull(predicate: (Double) -> Boolean): Double? + +/** + * Returns the last element matching the given [predicate], or `null` if no such element was found. + */ +public header inline fun BooleanArray.lastOrNull(predicate: (Boolean) -> Boolean): Boolean? + +/** + * Returns the last element matching the given [predicate], or `null` if no such element was found. + */ +public header inline fun CharArray.lastOrNull(predicate: (Char) -> Boolean): Char? + +/** + * Returns the single element, or throws an exception if the array is empty or has more than one element. + */ +public header fun Array.single(): T + +/** + * Returns the single element, or throws an exception if the array is empty or has more than one element. + */ +public header fun ByteArray.single(): Byte + +/** + * Returns the single element, or throws an exception if the array is empty or has more than one element. + */ +public header fun ShortArray.single(): Short + +/** + * Returns the single element, or throws an exception if the array is empty or has more than one element. + */ +public header fun IntArray.single(): Int + +/** + * Returns the single element, or throws an exception if the array is empty or has more than one element. + */ +public header fun LongArray.single(): Long + +/** + * Returns the single element, or throws an exception if the array is empty or has more than one element. + */ +public header fun FloatArray.single(): Float + +/** + * Returns the single element, or throws an exception if the array is empty or has more than one element. + */ +public header fun DoubleArray.single(): Double + +/** + * Returns the single element, or throws an exception if the array is empty or has more than one element. + */ +public header fun BooleanArray.single(): Boolean + +/** + * Returns the single element, or throws an exception if the array is empty or has more than one element. + */ +public header fun CharArray.single(): Char + +/** + * Returns the single element matching the given [predicate], or throws exception if there is no or more than one matching element. + */ +public header inline fun Array.single(predicate: (T) -> Boolean): T + +/** + * Returns the single element matching the given [predicate], or throws exception if there is no or more than one matching element. + */ +public header inline fun ByteArray.single(predicate: (Byte) -> Boolean): Byte + +/** + * Returns the single element matching the given [predicate], or throws exception if there is no or more than one matching element. + */ +public header inline fun ShortArray.single(predicate: (Short) -> Boolean): Short + +/** + * Returns the single element matching the given [predicate], or throws exception if there is no or more than one matching element. + */ +public header inline fun IntArray.single(predicate: (Int) -> Boolean): Int + +/** + * Returns the single element matching the given [predicate], or throws exception if there is no or more than one matching element. + */ +public header inline fun LongArray.single(predicate: (Long) -> Boolean): Long + +/** + * Returns the single element matching the given [predicate], or throws exception if there is no or more than one matching element. + */ +public header inline fun FloatArray.single(predicate: (Float) -> Boolean): Float + +/** + * Returns the single element matching the given [predicate], or throws exception if there is no or more than one matching element. + */ +public header inline fun DoubleArray.single(predicate: (Double) -> Boolean): Double + +/** + * Returns the single element matching the given [predicate], or throws exception if there is no or more than one matching element. + */ +public header inline fun BooleanArray.single(predicate: (Boolean) -> Boolean): Boolean + +/** + * Returns the single element matching the given [predicate], or throws exception if there is no or more than one matching element. + */ +public header inline fun CharArray.single(predicate: (Char) -> Boolean): Char + +/** + * Returns single element, or `null` if the array is empty or has more than one element. + */ +public header fun Array.singleOrNull(): T? + +/** + * Returns single element, or `null` if the array is empty or has more than one element. + */ +public header fun ByteArray.singleOrNull(): Byte? + +/** + * Returns single element, or `null` if the array is empty or has more than one element. + */ +public header fun ShortArray.singleOrNull(): Short? + +/** + * Returns single element, or `null` if the array is empty or has more than one element. + */ +public header fun IntArray.singleOrNull(): Int? + +/** + * Returns single element, or `null` if the array is empty or has more than one element. + */ +public header fun LongArray.singleOrNull(): Long? + +/** + * Returns single element, or `null` if the array is empty or has more than one element. + */ +public header fun FloatArray.singleOrNull(): Float? + +/** + * Returns single element, or `null` if the array is empty or has more than one element. + */ +public header fun DoubleArray.singleOrNull(): Double? + +/** + * Returns single element, or `null` if the array is empty or has more than one element. + */ +public header fun BooleanArray.singleOrNull(): Boolean? + +/** + * Returns single element, or `null` if the array is empty or has more than one element. + */ +public header fun CharArray.singleOrNull(): Char? + +/** + * Returns the single element matching the given [predicate], or `null` if element was not found or more than one element was found. + */ +public header inline fun Array.singleOrNull(predicate: (T) -> Boolean): T? + +/** + * Returns the single element matching the given [predicate], or `null` if element was not found or more than one element was found. + */ +public header inline fun ByteArray.singleOrNull(predicate: (Byte) -> Boolean): Byte? + +/** + * Returns the single element matching the given [predicate], or `null` if element was not found or more than one element was found. + */ +public header inline fun ShortArray.singleOrNull(predicate: (Short) -> Boolean): Short? + +/** + * Returns the single element matching the given [predicate], or `null` if element was not found or more than one element was found. + */ +public header inline fun IntArray.singleOrNull(predicate: (Int) -> Boolean): Int? + +/** + * Returns the single element matching the given [predicate], or `null` if element was not found or more than one element was found. + */ +public header inline fun LongArray.singleOrNull(predicate: (Long) -> Boolean): Long? + +/** + * Returns the single element matching the given [predicate], or `null` if element was not found or more than one element was found. + */ +public header inline fun FloatArray.singleOrNull(predicate: (Float) -> Boolean): Float? + +/** + * Returns the single element matching the given [predicate], or `null` if element was not found or more than one element was found. + */ +public header inline fun DoubleArray.singleOrNull(predicate: (Double) -> Boolean): Double? + +/** + * Returns the single element matching the given [predicate], or `null` if element was not found or more than one element was found. + */ +public header inline fun BooleanArray.singleOrNull(predicate: (Boolean) -> Boolean): Boolean? + +/** + * Returns the single element matching the given [predicate], or `null` if element was not found or more than one element was found. + */ +public header inline fun CharArray.singleOrNull(predicate: (Char) -> Boolean): Char? + +/** + * Returns a list containing all elements except first [n] elements. + */ +public header fun Array.drop(n: Int): List + +/** + * Returns a list containing all elements except first [n] elements. + */ +public header fun ByteArray.drop(n: Int): List + +/** + * Returns a list containing all elements except first [n] elements. + */ +public header fun ShortArray.drop(n: Int): List + +/** + * Returns a list containing all elements except first [n] elements. + */ +public header fun IntArray.drop(n: Int): List + +/** + * Returns a list containing all elements except first [n] elements. + */ +public header fun LongArray.drop(n: Int): List + +/** + * Returns a list containing all elements except first [n] elements. + */ +public header fun FloatArray.drop(n: Int): List + +/** + * Returns a list containing all elements except first [n] elements. + */ +public header fun DoubleArray.drop(n: Int): List + +/** + * Returns a list containing all elements except first [n] elements. + */ +public header fun BooleanArray.drop(n: Int): List + +/** + * Returns a list containing all elements except first [n] elements. + */ +public header fun CharArray.drop(n: Int): List + +/** + * Returns a list containing all elements except last [n] elements. + */ +public header fun Array.dropLast(n: Int): List + +/** + * Returns a list containing all elements except last [n] elements. + */ +public header fun ByteArray.dropLast(n: Int): List + +/** + * Returns a list containing all elements except last [n] elements. + */ +public header fun ShortArray.dropLast(n: Int): List + +/** + * Returns a list containing all elements except last [n] elements. + */ +public header fun IntArray.dropLast(n: Int): List + +/** + * Returns a list containing all elements except last [n] elements. + */ +public header fun LongArray.dropLast(n: Int): List + +/** + * Returns a list containing all elements except last [n] elements. + */ +public header fun FloatArray.dropLast(n: Int): List + +/** + * Returns a list containing all elements except last [n] elements. + */ +public header fun DoubleArray.dropLast(n: Int): List + +/** + * Returns a list containing all elements except last [n] elements. + */ +public header fun BooleanArray.dropLast(n: Int): List + +/** + * Returns a list containing all elements except last [n] elements. + */ +public header fun CharArray.dropLast(n: Int): List + +/** + * Returns a list containing all elements except last elements that satisfy the given [predicate]. + */ +public header inline fun Array.dropLastWhile(predicate: (T) -> Boolean): List + +/** + * Returns a list containing all elements except last elements that satisfy the given [predicate]. + */ +public header inline fun ByteArray.dropLastWhile(predicate: (Byte) -> Boolean): List + +/** + * Returns a list containing all elements except last elements that satisfy the given [predicate]. + */ +public header inline fun ShortArray.dropLastWhile(predicate: (Short) -> Boolean): List + +/** + * Returns a list containing all elements except last elements that satisfy the given [predicate]. + */ +public header inline fun IntArray.dropLastWhile(predicate: (Int) -> Boolean): List + +/** + * Returns a list containing all elements except last elements that satisfy the given [predicate]. + */ +public header inline fun LongArray.dropLastWhile(predicate: (Long) -> Boolean): List + +/** + * Returns a list containing all elements except last elements that satisfy the given [predicate]. + */ +public header inline fun FloatArray.dropLastWhile(predicate: (Float) -> Boolean): List + +/** + * Returns a list containing all elements except last elements that satisfy the given [predicate]. + */ +public header inline fun DoubleArray.dropLastWhile(predicate: (Double) -> Boolean): List + +/** + * Returns a list containing all elements except last elements that satisfy the given [predicate]. + */ +public header inline fun BooleanArray.dropLastWhile(predicate: (Boolean) -> Boolean): List + +/** + * Returns a list containing all elements except last elements that satisfy the given [predicate]. + */ +public header inline fun CharArray.dropLastWhile(predicate: (Char) -> Boolean): List + +/** + * Returns a list containing all elements except first elements that satisfy the given [predicate]. + */ +public header inline fun Array.dropWhile(predicate: (T) -> Boolean): List + +/** + * Returns a list containing all elements except first elements that satisfy the given [predicate]. + */ +public header inline fun ByteArray.dropWhile(predicate: (Byte) -> Boolean): List + +/** + * Returns a list containing all elements except first elements that satisfy the given [predicate]. + */ +public header inline fun ShortArray.dropWhile(predicate: (Short) -> Boolean): List + +/** + * Returns a list containing all elements except first elements that satisfy the given [predicate]. + */ +public header inline fun IntArray.dropWhile(predicate: (Int) -> Boolean): List + +/** + * Returns a list containing all elements except first elements that satisfy the given [predicate]. + */ +public header inline fun LongArray.dropWhile(predicate: (Long) -> Boolean): List + +/** + * Returns a list containing all elements except first elements that satisfy the given [predicate]. + */ +public header inline fun FloatArray.dropWhile(predicate: (Float) -> Boolean): List + +/** + * Returns a list containing all elements except first elements that satisfy the given [predicate]. + */ +public header inline fun DoubleArray.dropWhile(predicate: (Double) -> Boolean): List + +/** + * Returns a list containing all elements except first elements that satisfy the given [predicate]. + */ +public header inline fun BooleanArray.dropWhile(predicate: (Boolean) -> Boolean): List + +/** + * Returns a list containing all elements except first elements that satisfy the given [predicate]. + */ +public header inline fun CharArray.dropWhile(predicate: (Char) -> Boolean): List + +/** + * Returns a list containing only elements matching the given [predicate]. + */ +public header inline fun Array.filter(predicate: (T) -> Boolean): List + +/** + * Returns a list containing only elements matching the given [predicate]. + */ +public header inline fun ByteArray.filter(predicate: (Byte) -> Boolean): List + +/** + * Returns a list containing only elements matching the given [predicate]. + */ +public header inline fun ShortArray.filter(predicate: (Short) -> Boolean): List + +/** + * Returns a list containing only elements matching the given [predicate]. + */ +public header inline fun IntArray.filter(predicate: (Int) -> Boolean): List + +/** + * Returns a list containing only elements matching the given [predicate]. + */ +public header inline fun LongArray.filter(predicate: (Long) -> Boolean): List + +/** + * Returns a list containing only elements matching the given [predicate]. + */ +public header inline fun FloatArray.filter(predicate: (Float) -> Boolean): List + +/** + * Returns a list containing only elements matching the given [predicate]. + */ +public header inline fun DoubleArray.filter(predicate: (Double) -> Boolean): List + +/** + * Returns a list containing only elements matching the given [predicate]. + */ +public header inline fun BooleanArray.filter(predicate: (Boolean) -> Boolean): List + +/** + * Returns a list containing only elements matching the given [predicate]. + */ +public header inline fun CharArray.filter(predicate: (Char) -> Boolean): List + +/** + * Returns a list containing only elements matching the given [predicate]. + * @param [predicate] function that takes the index of an element and the element itself + * and returns the result of predicate evaluation on the element. + */ +public header inline fun Array.filterIndexed(predicate: (Int, T) -> Boolean): List + +/** + * Returns a list containing only elements matching the given [predicate]. + * @param [predicate] function that takes the index of an element and the element itself + * and returns the result of predicate evaluation on the element. + */ +public header inline fun ByteArray.filterIndexed(predicate: (Int, Byte) -> Boolean): List + +/** + * Returns a list containing only elements matching the given [predicate]. + * @param [predicate] function that takes the index of an element and the element itself + * and returns the result of predicate evaluation on the element. + */ +public header inline fun ShortArray.filterIndexed(predicate: (Int, Short) -> Boolean): List + +/** + * Returns a list containing only elements matching the given [predicate]. + * @param [predicate] function that takes the index of an element and the element itself + * and returns the result of predicate evaluation on the element. + */ +public header inline fun IntArray.filterIndexed(predicate: (Int, Int) -> Boolean): List + +/** + * Returns a list containing only elements matching the given [predicate]. + * @param [predicate] function that takes the index of an element and the element itself + * and returns the result of predicate evaluation on the element. + */ +public header inline fun LongArray.filterIndexed(predicate: (Int, Long) -> Boolean): List + +/** + * Returns a list containing only elements matching the given [predicate]. + * @param [predicate] function that takes the index of an element and the element itself + * and returns the result of predicate evaluation on the element. + */ +public header inline fun FloatArray.filterIndexed(predicate: (Int, Float) -> Boolean): List + +/** + * Returns a list containing only elements matching the given [predicate]. + * @param [predicate] function that takes the index of an element and the element itself + * and returns the result of predicate evaluation on the element. + */ +public header inline fun DoubleArray.filterIndexed(predicate: (Int, Double) -> Boolean): List + +/** + * Returns a list containing only elements matching the given [predicate]. + * @param [predicate] function that takes the index of an element and the element itself + * and returns the result of predicate evaluation on the element. + */ +public header inline fun BooleanArray.filterIndexed(predicate: (Int, Boolean) -> Boolean): List + +/** + * Returns a list containing only elements matching the given [predicate]. + * @param [predicate] function that takes the index of an element and the element itself + * and returns the result of predicate evaluation on the element. + */ +public header inline fun CharArray.filterIndexed(predicate: (Int, Char) -> Boolean): List + +/** + * Appends all elements matching the given [predicate] to the given [destination]. + * @param [predicate] function that takes the index of an element and the element itself + * and returns the result of predicate evaluation on the element. + */ +public header inline fun > Array.filterIndexedTo(destination: C, predicate: (Int, T) -> Boolean): C + +/** + * Appends all elements matching the given [predicate] to the given [destination]. + * @param [predicate] function that takes the index of an element and the element itself + * and returns the result of predicate evaluation on the element. + */ +public header inline fun > ByteArray.filterIndexedTo(destination: C, predicate: (Int, Byte) -> Boolean): C + +/** + * Appends all elements matching the given [predicate] to the given [destination]. + * @param [predicate] function that takes the index of an element and the element itself + * and returns the result of predicate evaluation on the element. + */ +public header inline fun > ShortArray.filterIndexedTo(destination: C, predicate: (Int, Short) -> Boolean): C + +/** + * Appends all elements matching the given [predicate] to the given [destination]. + * @param [predicate] function that takes the index of an element and the element itself + * and returns the result of predicate evaluation on the element. + */ +public header inline fun > IntArray.filterIndexedTo(destination: C, predicate: (Int, Int) -> Boolean): C + +/** + * Appends all elements matching the given [predicate] to the given [destination]. + * @param [predicate] function that takes the index of an element and the element itself + * and returns the result of predicate evaluation on the element. + */ +public header inline fun > LongArray.filterIndexedTo(destination: C, predicate: (Int, Long) -> Boolean): C + +/** + * Appends all elements matching the given [predicate] to the given [destination]. + * @param [predicate] function that takes the index of an element and the element itself + * and returns the result of predicate evaluation on the element. + */ +public header inline fun > FloatArray.filterIndexedTo(destination: C, predicate: (Int, Float) -> Boolean): C + +/** + * Appends all elements matching the given [predicate] to the given [destination]. + * @param [predicate] function that takes the index of an element and the element itself + * and returns the result of predicate evaluation on the element. + */ +public header inline fun > DoubleArray.filterIndexedTo(destination: C, predicate: (Int, Double) -> Boolean): C + +/** + * Appends all elements matching the given [predicate] to the given [destination]. + * @param [predicate] function that takes the index of an element and the element itself + * and returns the result of predicate evaluation on the element. + */ +public header inline fun > BooleanArray.filterIndexedTo(destination: C, predicate: (Int, Boolean) -> Boolean): C + +/** + * Appends all elements matching the given [predicate] to the given [destination]. + * @param [predicate] function that takes the index of an element and the element itself + * and returns the result of predicate evaluation on the element. + */ +public header inline fun > CharArray.filterIndexedTo(destination: C, predicate: (Int, Char) -> Boolean): C + +/** + * Returns a list containing all elements that are instances of specified type parameter R. + */ +public header inline fun Array<*>.filterIsInstance(): List<@kotlin.internal.NoInfer R> + +/** + * Appends all elements that are instances of specified type parameter R to the given [destination]. + */ +public header inline fun > Array<*>.filterIsInstanceTo(destination: C): C + +/** + * Returns a list containing all elements not matching the given [predicate]. + */ +public header inline fun Array.filterNot(predicate: (T) -> Boolean): List + +/** + * Returns a list containing all elements not matching the given [predicate]. + */ +public header inline fun ByteArray.filterNot(predicate: (Byte) -> Boolean): List + +/** + * Returns a list containing all elements not matching the given [predicate]. + */ +public header inline fun ShortArray.filterNot(predicate: (Short) -> Boolean): List + +/** + * Returns a list containing all elements not matching the given [predicate]. + */ +public header inline fun IntArray.filterNot(predicate: (Int) -> Boolean): List + +/** + * Returns a list containing all elements not matching the given [predicate]. + */ +public header inline fun LongArray.filterNot(predicate: (Long) -> Boolean): List + +/** + * Returns a list containing all elements not matching the given [predicate]. + */ +public header inline fun FloatArray.filterNot(predicate: (Float) -> Boolean): List + +/** + * Returns a list containing all elements not matching the given [predicate]. + */ +public header inline fun DoubleArray.filterNot(predicate: (Double) -> Boolean): List + +/** + * Returns a list containing all elements not matching the given [predicate]. + */ +public header inline fun BooleanArray.filterNot(predicate: (Boolean) -> Boolean): List + +/** + * Returns a list containing all elements not matching the given [predicate]. + */ +public header inline fun CharArray.filterNot(predicate: (Char) -> Boolean): List + +/** + * Returns a list containing all elements that are not `null`. + */ +public header fun Array.filterNotNull(): List + +/** + * Appends all elements that are not `null` to the given [destination]. + */ +public header fun , T : Any> Array.filterNotNullTo(destination: C): C + +/** + * Appends all elements not matching the given [predicate] to the given [destination]. + */ +public header inline fun > Array.filterNotTo(destination: C, predicate: (T) -> Boolean): C + +/** + * Appends all elements not matching the given [predicate] to the given [destination]. + */ +public header inline fun > ByteArray.filterNotTo(destination: C, predicate: (Byte) -> Boolean): C + +/** + * Appends all elements not matching the given [predicate] to the given [destination]. + */ +public header inline fun > ShortArray.filterNotTo(destination: C, predicate: (Short) -> Boolean): C + +/** + * Appends all elements not matching the given [predicate] to the given [destination]. + */ +public header inline fun > IntArray.filterNotTo(destination: C, predicate: (Int) -> Boolean): C + +/** + * Appends all elements not matching the given [predicate] to the given [destination]. + */ +public header inline fun > LongArray.filterNotTo(destination: C, predicate: (Long) -> Boolean): C + +/** + * Appends all elements not matching the given [predicate] to the given [destination]. + */ +public header inline fun > FloatArray.filterNotTo(destination: C, predicate: (Float) -> Boolean): C + +/** + * Appends all elements not matching the given [predicate] to the given [destination]. + */ +public header inline fun > DoubleArray.filterNotTo(destination: C, predicate: (Double) -> Boolean): C + +/** + * Appends all elements not matching the given [predicate] to the given [destination]. + */ +public header inline fun > BooleanArray.filterNotTo(destination: C, predicate: (Boolean) -> Boolean): C + +/** + * Appends all elements not matching the given [predicate] to the given [destination]. + */ +public header inline fun > CharArray.filterNotTo(destination: C, predicate: (Char) -> Boolean): C + +/** + * Appends all elements matching the given [predicate] to the given [destination]. + */ +public header inline fun > Array.filterTo(destination: C, predicate: (T) -> Boolean): C + +/** + * Appends all elements matching the given [predicate] to the given [destination]. + */ +public header inline fun > ByteArray.filterTo(destination: C, predicate: (Byte) -> Boolean): C + +/** + * Appends all elements matching the given [predicate] to the given [destination]. + */ +public header inline fun > ShortArray.filterTo(destination: C, predicate: (Short) -> Boolean): C + +/** + * Appends all elements matching the given [predicate] to the given [destination]. + */ +public header inline fun > IntArray.filterTo(destination: C, predicate: (Int) -> Boolean): C + +/** + * Appends all elements matching the given [predicate] to the given [destination]. + */ +public header inline fun > LongArray.filterTo(destination: C, predicate: (Long) -> Boolean): C + +/** + * Appends all elements matching the given [predicate] to the given [destination]. + */ +public header inline fun > FloatArray.filterTo(destination: C, predicate: (Float) -> Boolean): C + +/** + * Appends all elements matching the given [predicate] to the given [destination]. + */ +public header inline fun > DoubleArray.filterTo(destination: C, predicate: (Double) -> Boolean): C + +/** + * Appends all elements matching the given [predicate] to the given [destination]. + */ +public header inline fun > BooleanArray.filterTo(destination: C, predicate: (Boolean) -> Boolean): C + +/** + * Appends all elements matching the given [predicate] to the given [destination]. + */ +public header inline fun > CharArray.filterTo(destination: C, predicate: (Char) -> Boolean): C + +/** + * Returns a list containing elements at indices in the specified [indices] range. + */ +public header fun Array.slice(indices: IntRange): List + +/** + * Returns a list containing elements at indices in the specified [indices] range. + */ +public header fun ByteArray.slice(indices: IntRange): List + +/** + * Returns a list containing elements at indices in the specified [indices] range. + */ +public header fun ShortArray.slice(indices: IntRange): List + +/** + * Returns a list containing elements at indices in the specified [indices] range. + */ +public header fun IntArray.slice(indices: IntRange): List + +/** + * Returns a list containing elements at indices in the specified [indices] range. + */ +public header fun LongArray.slice(indices: IntRange): List + +/** + * Returns a list containing elements at indices in the specified [indices] range. + */ +public header fun FloatArray.slice(indices: IntRange): List + +/** + * Returns a list containing elements at indices in the specified [indices] range. + */ +public header fun DoubleArray.slice(indices: IntRange): List + +/** + * Returns a list containing elements at indices in the specified [indices] range. + */ +public header fun BooleanArray.slice(indices: IntRange): List + +/** + * Returns a list containing elements at indices in the specified [indices] range. + */ +public header fun CharArray.slice(indices: IntRange): List + +/** + * Returns a list containing elements at specified [indices]. + */ +public header fun Array.slice(indices: Iterable): List + +/** + * Returns a list containing elements at specified [indices]. + */ +public header fun ByteArray.slice(indices: Iterable): List + +/** + * Returns a list containing elements at specified [indices]. + */ +public header fun ShortArray.slice(indices: Iterable): List + +/** + * Returns a list containing elements at specified [indices]. + */ +public header fun IntArray.slice(indices: Iterable): List + +/** + * Returns a list containing elements at specified [indices]. + */ +public header fun LongArray.slice(indices: Iterable): List + +/** + * Returns a list containing elements at specified [indices]. + */ +public header fun FloatArray.slice(indices: Iterable): List + +/** + * Returns a list containing elements at specified [indices]. + */ +public header fun DoubleArray.slice(indices: Iterable): List + +/** + * Returns a list containing elements at specified [indices]. + */ +public header fun BooleanArray.slice(indices: Iterable): List + +/** + * Returns a list containing elements at specified [indices]. + */ +public header fun CharArray.slice(indices: Iterable): List + +/** + * Returns an array containing elements of this array at specified [indices]. + */ +public header fun Array.sliceArray(indices: Collection): Array + +/** + * Returns an array containing elements of this array at specified [indices]. + */ +public header fun ByteArray.sliceArray(indices: Collection): ByteArray + +/** + * Returns an array containing elements of this array at specified [indices]. + */ +public header fun ShortArray.sliceArray(indices: Collection): ShortArray + +/** + * Returns an array containing elements of this array at specified [indices]. + */ +public header fun IntArray.sliceArray(indices: Collection): IntArray + +/** + * Returns an array containing elements of this array at specified [indices]. + */ +public header fun LongArray.sliceArray(indices: Collection): LongArray + +/** + * Returns an array containing elements of this array at specified [indices]. + */ +public header fun FloatArray.sliceArray(indices: Collection): FloatArray + +/** + * Returns an array containing elements of this array at specified [indices]. + */ +public header fun DoubleArray.sliceArray(indices: Collection): DoubleArray + +/** + * Returns an array containing elements of this array at specified [indices]. + */ +public header fun BooleanArray.sliceArray(indices: Collection): BooleanArray + +/** + * Returns an array containing elements of this array at specified [indices]. + */ +public header fun CharArray.sliceArray(indices: Collection): CharArray + +/** + * Returns a list containing elements at indices in the specified [indices] range. + */ +public header fun Array.sliceArray(indices: IntRange): Array + +/** + * Returns a list containing elements at indices in the specified [indices] range. + */ +public header fun ByteArray.sliceArray(indices: IntRange): ByteArray + +/** + * Returns a list containing elements at indices in the specified [indices] range. + */ +public header fun ShortArray.sliceArray(indices: IntRange): ShortArray + +/** + * Returns a list containing elements at indices in the specified [indices] range. + */ +public header fun IntArray.sliceArray(indices: IntRange): IntArray + +/** + * Returns a list containing elements at indices in the specified [indices] range. + */ +public header fun LongArray.sliceArray(indices: IntRange): LongArray + +/** + * Returns a list containing elements at indices in the specified [indices] range. + */ +public header fun FloatArray.sliceArray(indices: IntRange): FloatArray + +/** + * Returns a list containing elements at indices in the specified [indices] range. + */ +public header fun DoubleArray.sliceArray(indices: IntRange): DoubleArray + +/** + * Returns a list containing elements at indices in the specified [indices] range. + */ +public header fun BooleanArray.sliceArray(indices: IntRange): BooleanArray + +/** + * Returns a list containing elements at indices in the specified [indices] range. + */ +public header fun CharArray.sliceArray(indices: IntRange): CharArray + +/** + * Returns a list containing first [n] elements. + */ +public header fun Array.take(n: Int): List + +/** + * Returns a list containing first [n] elements. + */ +public header fun ByteArray.take(n: Int): List + +/** + * Returns a list containing first [n] elements. + */ +public header fun ShortArray.take(n: Int): List + +/** + * Returns a list containing first [n] elements. + */ +public header fun IntArray.take(n: Int): List + +/** + * Returns a list containing first [n] elements. + */ +public header fun LongArray.take(n: Int): List + +/** + * Returns a list containing first [n] elements. + */ +public header fun FloatArray.take(n: Int): List + +/** + * Returns a list containing first [n] elements. + */ +public header fun DoubleArray.take(n: Int): List + +/** + * Returns a list containing first [n] elements. + */ +public header fun BooleanArray.take(n: Int): List + +/** + * Returns a list containing first [n] elements. + */ +public header fun CharArray.take(n: Int): List + +/** + * Returns a list containing last [n] elements. + */ +public header fun Array.takeLast(n: Int): List + +/** + * Returns a list containing last [n] elements. + */ +public header fun ByteArray.takeLast(n: Int): List + +/** + * Returns a list containing last [n] elements. + */ +public header fun ShortArray.takeLast(n: Int): List + +/** + * Returns a list containing last [n] elements. + */ +public header fun IntArray.takeLast(n: Int): List + +/** + * Returns a list containing last [n] elements. + */ +public header fun LongArray.takeLast(n: Int): List + +/** + * Returns a list containing last [n] elements. + */ +public header fun FloatArray.takeLast(n: Int): List + +/** + * Returns a list containing last [n] elements. + */ +public header fun DoubleArray.takeLast(n: Int): List + +/** + * Returns a list containing last [n] elements. + */ +public header fun BooleanArray.takeLast(n: Int): List + +/** + * Returns a list containing last [n] elements. + */ +public header fun CharArray.takeLast(n: Int): List + +/** + * Returns a list containing last elements satisfying the given [predicate]. + */ +public header inline fun Array.takeLastWhile(predicate: (T) -> Boolean): List + +/** + * Returns a list containing last elements satisfying the given [predicate]. + */ +public header inline fun ByteArray.takeLastWhile(predicate: (Byte) -> Boolean): List + +/** + * Returns a list containing last elements satisfying the given [predicate]. + */ +public header inline fun ShortArray.takeLastWhile(predicate: (Short) -> Boolean): List + +/** + * Returns a list containing last elements satisfying the given [predicate]. + */ +public header inline fun IntArray.takeLastWhile(predicate: (Int) -> Boolean): List + +/** + * Returns a list containing last elements satisfying the given [predicate]. + */ +public header inline fun LongArray.takeLastWhile(predicate: (Long) -> Boolean): List + +/** + * Returns a list containing last elements satisfying the given [predicate]. + */ +public header inline fun FloatArray.takeLastWhile(predicate: (Float) -> Boolean): List + +/** + * Returns a list containing last elements satisfying the given [predicate]. + */ +public header inline fun DoubleArray.takeLastWhile(predicate: (Double) -> Boolean): List + +/** + * Returns a list containing last elements satisfying the given [predicate]. + */ +public header inline fun BooleanArray.takeLastWhile(predicate: (Boolean) -> Boolean): List + +/** + * Returns a list containing last elements satisfying the given [predicate]. + */ +public header inline fun CharArray.takeLastWhile(predicate: (Char) -> Boolean): List + +/** + * Returns a list containing first elements satisfying the given [predicate]. + */ +public header inline fun Array.takeWhile(predicate: (T) -> Boolean): List + +/** + * Returns a list containing first elements satisfying the given [predicate]. + */ +public header inline fun ByteArray.takeWhile(predicate: (Byte) -> Boolean): List + +/** + * Returns a list containing first elements satisfying the given [predicate]. + */ +public header inline fun ShortArray.takeWhile(predicate: (Short) -> Boolean): List + +/** + * Returns a list containing first elements satisfying the given [predicate]. + */ +public header inline fun IntArray.takeWhile(predicate: (Int) -> Boolean): List + +/** + * Returns a list containing first elements satisfying the given [predicate]. + */ +public header inline fun LongArray.takeWhile(predicate: (Long) -> Boolean): List + +/** + * Returns a list containing first elements satisfying the given [predicate]. + */ +public header inline fun FloatArray.takeWhile(predicate: (Float) -> Boolean): List + +/** + * Returns a list containing first elements satisfying the given [predicate]. + */ +public header inline fun DoubleArray.takeWhile(predicate: (Double) -> Boolean): List + +/** + * Returns a list containing first elements satisfying the given [predicate]. + */ +public header inline fun BooleanArray.takeWhile(predicate: (Boolean) -> Boolean): List + +/** + * Returns a list containing first elements satisfying the given [predicate]. + */ +public header inline fun CharArray.takeWhile(predicate: (Char) -> Boolean): List + +/** + * Reverses elements in the array in-place. + */ +public header fun Array.reverse(): Unit + +/** + * Reverses elements in the array in-place. + */ +public header fun ByteArray.reverse(): Unit + +/** + * Reverses elements in the array in-place. + */ +public header fun ShortArray.reverse(): Unit + +/** + * Reverses elements in the array in-place. + */ +public header fun IntArray.reverse(): Unit + +/** + * Reverses elements in the array in-place. + */ +public header fun LongArray.reverse(): Unit + +/** + * Reverses elements in the array in-place. + */ +public header fun FloatArray.reverse(): Unit + +/** + * Reverses elements in the array in-place. + */ +public header fun DoubleArray.reverse(): Unit + +/** + * Reverses elements in the array in-place. + */ +public header fun BooleanArray.reverse(): Unit + +/** + * Reverses elements in the array in-place. + */ +public header fun CharArray.reverse(): Unit + +/** + * Returns a list with elements in reversed order. + */ +public header fun Array.reversed(): List + +/** + * Returns a list with elements in reversed order. + */ +public header fun ByteArray.reversed(): List + +/** + * Returns a list with elements in reversed order. + */ +public header fun ShortArray.reversed(): List + +/** + * Returns a list with elements in reversed order. + */ +public header fun IntArray.reversed(): List + +/** + * Returns a list with elements in reversed order. + */ +public header fun LongArray.reversed(): List + +/** + * Returns a list with elements in reversed order. + */ +public header fun FloatArray.reversed(): List + +/** + * Returns a list with elements in reversed order. + */ +public header fun DoubleArray.reversed(): List + +/** + * Returns a list with elements in reversed order. + */ +public header fun BooleanArray.reversed(): List + +/** + * Returns a list with elements in reversed order. + */ +public header fun CharArray.reversed(): List + +/** + * Returns an array with elements of this array in reversed order. + */ +public header fun Array.reversedArray(): Array + +/** + * Returns an array with elements of this array in reversed order. + */ +public header fun ByteArray.reversedArray(): ByteArray + +/** + * Returns an array with elements of this array in reversed order. + */ +public header fun ShortArray.reversedArray(): ShortArray + +/** + * Returns an array with elements of this array in reversed order. + */ +public header fun IntArray.reversedArray(): IntArray + +/** + * Returns an array with elements of this array in reversed order. + */ +public header fun LongArray.reversedArray(): LongArray + +/** + * Returns an array with elements of this array in reversed order. + */ +public header fun FloatArray.reversedArray(): FloatArray + +/** + * Returns an array with elements of this array in reversed order. + */ +public header fun DoubleArray.reversedArray(): DoubleArray + +/** + * Returns an array with elements of this array in reversed order. + */ +public header fun BooleanArray.reversedArray(): BooleanArray + +/** + * Returns an array with elements of this array in reversed order. + */ +public header fun CharArray.reversedArray(): CharArray + +/** + * Sorts elements in the array in-place according to natural sort order of the value returned by specified [selector] function. + */ +public header inline fun > Array.sortBy(crossinline selector: (T) -> R?): Unit + +/** + * Sorts elements in the array in-place descending according to natural sort order of the value returned by specified [selector] function. + */ +public header inline fun > Array.sortByDescending(crossinline selector: (T) -> R?): Unit + +/** + * Sorts elements in the array in-place descending according to their natural sort order. + */ +public header fun > Array.sortDescending(): Unit + +/** + * Sorts elements in the array in-place descending according to their natural sort order. + */ +public header fun ByteArray.sortDescending(): Unit + +/** + * Sorts elements in the array in-place descending according to their natural sort order. + */ +public header fun ShortArray.sortDescending(): Unit + +/** + * Sorts elements in the array in-place descending according to their natural sort order. + */ +public header fun IntArray.sortDescending(): Unit + +/** + * Sorts elements in the array in-place descending according to their natural sort order. + */ +public header fun LongArray.sortDescending(): Unit + +/** + * Sorts elements in the array in-place descending according to their natural sort order. + */ +public header fun FloatArray.sortDescending(): Unit + +/** + * Sorts elements in the array in-place descending according to their natural sort order. + */ +public header fun DoubleArray.sortDescending(): Unit + +/** + * Sorts elements in the array in-place descending according to their natural sort order. + */ +public header fun CharArray.sortDescending(): Unit + +/** + * Returns a list of all elements sorted according to their natural sort order. + */ +public header fun > Array.sorted(): List + +/** + * Returns a list of all elements sorted according to their natural sort order. + */ +public header fun ByteArray.sorted(): List + +/** + * Returns a list of all elements sorted according to their natural sort order. + */ +public header fun ShortArray.sorted(): List + +/** + * Returns a list of all elements sorted according to their natural sort order. + */ +public header fun IntArray.sorted(): List + +/** + * Returns a list of all elements sorted according to their natural sort order. + */ +public header fun LongArray.sorted(): List + +/** + * Returns a list of all elements sorted according to their natural sort order. + */ +public header fun FloatArray.sorted(): List + +/** + * Returns a list of all elements sorted according to their natural sort order. + */ +public header fun DoubleArray.sorted(): List + +/** + * Returns a list of all elements sorted according to their natural sort order. + */ +public header fun CharArray.sorted(): List + +/** + * Returns an array with all elements of this array sorted according to their natural sort order. + */ +public header fun > Array.sortedArray(): Array + +/** + * Returns an array with all elements of this array sorted according to their natural sort order. + */ +public header fun ByteArray.sortedArray(): ByteArray + +/** + * Returns an array with all elements of this array sorted according to their natural sort order. + */ +public header fun ShortArray.sortedArray(): ShortArray + +/** + * Returns an array with all elements of this array sorted according to their natural sort order. + */ +public header fun IntArray.sortedArray(): IntArray + +/** + * Returns an array with all elements of this array sorted according to their natural sort order. + */ +public header fun LongArray.sortedArray(): LongArray + +/** + * Returns an array with all elements of this array sorted according to their natural sort order. + */ +public header fun FloatArray.sortedArray(): FloatArray + +/** + * Returns an array with all elements of this array sorted according to their natural sort order. + */ +public header fun DoubleArray.sortedArray(): DoubleArray + +/** + * Returns an array with all elements of this array sorted according to their natural sort order. + */ +public header fun CharArray.sortedArray(): CharArray + +/** + * Returns an array with all elements of this array sorted descending according to their natural sort order. + */ +public header fun > Array.sortedArrayDescending(): Array + +/** + * Returns an array with all elements of this array sorted descending according to their natural sort order. + */ +public header fun ByteArray.sortedArrayDescending(): ByteArray + +/** + * Returns an array with all elements of this array sorted descending according to their natural sort order. + */ +public header fun ShortArray.sortedArrayDescending(): ShortArray + +/** + * Returns an array with all elements of this array sorted descending according to their natural sort order. + */ +public header fun IntArray.sortedArrayDescending(): IntArray + +/** + * Returns an array with all elements of this array sorted descending according to their natural sort order. + */ +public header fun LongArray.sortedArrayDescending(): LongArray + +/** + * Returns an array with all elements of this array sorted descending according to their natural sort order. + */ +public header fun FloatArray.sortedArrayDescending(): FloatArray + +/** + * Returns an array with all elements of this array sorted descending according to their natural sort order. + */ +public header fun DoubleArray.sortedArrayDescending(): DoubleArray + +/** + * Returns an array with all elements of this array sorted descending according to their natural sort order. + */ +public header fun CharArray.sortedArrayDescending(): CharArray + +/** + * Returns an array with all elements of this array sorted according the specified [comparator]. + */ +public header fun Array.sortedArrayWith(comparator: Comparator): Array + +/** + * Returns a list of all elements sorted according to natural sort order of the value returned by specified [selector] function. + */ +public header inline fun > Array.sortedBy(crossinline selector: (T) -> R?): List + +/** + * Returns a list of all elements sorted according to natural sort order of the value returned by specified [selector] function. + */ +public header inline fun > ByteArray.sortedBy(crossinline selector: (Byte) -> R?): List + +/** + * Returns a list of all elements sorted according to natural sort order of the value returned by specified [selector] function. + */ +public header inline fun > ShortArray.sortedBy(crossinline selector: (Short) -> R?): List + +/** + * Returns a list of all elements sorted according to natural sort order of the value returned by specified [selector] function. + */ +public header inline fun > IntArray.sortedBy(crossinline selector: (Int) -> R?): List + +/** + * Returns a list of all elements sorted according to natural sort order of the value returned by specified [selector] function. + */ +public header inline fun > LongArray.sortedBy(crossinline selector: (Long) -> R?): List + +/** + * Returns a list of all elements sorted according to natural sort order of the value returned by specified [selector] function. + */ +public header inline fun > FloatArray.sortedBy(crossinline selector: (Float) -> R?): List + +/** + * Returns a list of all elements sorted according to natural sort order of the value returned by specified [selector] function. + */ +public header inline fun > DoubleArray.sortedBy(crossinline selector: (Double) -> R?): List + +/** + * Returns a list of all elements sorted according to natural sort order of the value returned by specified [selector] function. + */ +public header inline fun > BooleanArray.sortedBy(crossinline selector: (Boolean) -> R?): List + +/** + * Returns a list of all elements sorted according to natural sort order of the value returned by specified [selector] function. + */ +public header inline fun > CharArray.sortedBy(crossinline selector: (Char) -> R?): List + +/** + * Returns a list of all elements sorted descending according to natural sort order of the value returned by specified [selector] function. + */ +public header inline fun > Array.sortedByDescending(crossinline selector: (T) -> R?): List + +/** + * Returns a list of all elements sorted descending according to natural sort order of the value returned by specified [selector] function. + */ +public header inline fun > ByteArray.sortedByDescending(crossinline selector: (Byte) -> R?): List + +/** + * Returns a list of all elements sorted descending according to natural sort order of the value returned by specified [selector] function. + */ +public header inline fun > ShortArray.sortedByDescending(crossinline selector: (Short) -> R?): List + +/** + * Returns a list of all elements sorted descending according to natural sort order of the value returned by specified [selector] function. + */ +public header inline fun > IntArray.sortedByDescending(crossinline selector: (Int) -> R?): List + +/** + * Returns a list of all elements sorted descending according to natural sort order of the value returned by specified [selector] function. + */ +public header inline fun > LongArray.sortedByDescending(crossinline selector: (Long) -> R?): List + +/** + * Returns a list of all elements sorted descending according to natural sort order of the value returned by specified [selector] function. + */ +public header inline fun > FloatArray.sortedByDescending(crossinline selector: (Float) -> R?): List + +/** + * Returns a list of all elements sorted descending according to natural sort order of the value returned by specified [selector] function. + */ +public header inline fun > DoubleArray.sortedByDescending(crossinline selector: (Double) -> R?): List + +/** + * Returns a list of all elements sorted descending according to natural sort order of the value returned by specified [selector] function. + */ +public header inline fun > BooleanArray.sortedByDescending(crossinline selector: (Boolean) -> R?): List + +/** + * Returns a list of all elements sorted descending according to natural sort order of the value returned by specified [selector] function. + */ +public header inline fun > CharArray.sortedByDescending(crossinline selector: (Char) -> R?): List + +/** + * Returns a list of all elements sorted descending according to their natural sort order. + */ +public header fun > Array.sortedDescending(): List + +/** + * Returns a list of all elements sorted descending according to their natural sort order. + */ +public header fun ByteArray.sortedDescending(): List + +/** + * Returns a list of all elements sorted descending according to their natural sort order. + */ +public header fun ShortArray.sortedDescending(): List + +/** + * Returns a list of all elements sorted descending according to their natural sort order. + */ +public header fun IntArray.sortedDescending(): List + +/** + * Returns a list of all elements sorted descending according to their natural sort order. + */ +public header fun LongArray.sortedDescending(): List + +/** + * Returns a list of all elements sorted descending according to their natural sort order. + */ +public header fun FloatArray.sortedDescending(): List + +/** + * Returns a list of all elements sorted descending according to their natural sort order. + */ +public header fun DoubleArray.sortedDescending(): List + +/** + * Returns a list of all elements sorted descending according to their natural sort order. + */ +public header fun CharArray.sortedDescending(): List + +/** + * Returns a list of all elements sorted according to the specified [comparator]. + */ +public header fun Array.sortedWith(comparator: Comparator): List + +/** + * Returns a list of all elements sorted according to the specified [comparator]. + */ +public header fun ByteArray.sortedWith(comparator: Comparator): List + +/** + * Returns a list of all elements sorted according to the specified [comparator]. + */ +public header fun ShortArray.sortedWith(comparator: Comparator): List + +/** + * Returns a list of all elements sorted according to the specified [comparator]. + */ +public header fun IntArray.sortedWith(comparator: Comparator): List + +/** + * Returns a list of all elements sorted according to the specified [comparator]. + */ +public header fun LongArray.sortedWith(comparator: Comparator): List + +/** + * Returns a list of all elements sorted according to the specified [comparator]. + */ +public header fun FloatArray.sortedWith(comparator: Comparator): List + +/** + * Returns a list of all elements sorted according to the specified [comparator]. + */ +public header fun DoubleArray.sortedWith(comparator: Comparator): List + +/** + * Returns a list of all elements sorted according to the specified [comparator]. + */ +public header fun BooleanArray.sortedWith(comparator: Comparator): List + +/** + * Returns a list of all elements sorted according to the specified [comparator]. + */ +public header fun CharArray.sortedWith(comparator: Comparator): List + +/** + * Returns `true` if the two specified arrays are *deeply* equal to one another, + * i.e. contain the same number of the same elements in the same order. + * + * If two corresponding elements are nested arrays, they are also compared deeply. + * If any of arrays contains itself on any nesting level the behavior is undefined. + */ +@SinceKotlin("1.1") +public header infix fun Array.contentDeepEquals(other: Array): Boolean + +/** + * Returns a hash code based on the contents of this array as if it is [List]. + * Nested arrays are treated as lists too. + * + * If any of arrays contains itself on any nesting level the behavior is undefined. + */ +@SinceKotlin("1.1") +public header fun Array.contentDeepHashCode(): Int + +/** + * Returns a string representation of the contents of this array as if it is a [List]. + * Nested arrays are treated as lists too. + * + * If any of arrays contains itself on any nesting level that reference + * is rendered as `"[...]"` to prevent recursion. + */ +@SinceKotlin("1.1") +public header fun Array.contentDeepToString(): String + +/** + * Returns `true` if the two specified arrays are *structurally* equal to one another, + * i.e. contain the same number of the same elements in the same order. + */ +@SinceKotlin("1.1") +public header infix fun Array.contentEquals(other: Array): Boolean + +/** + * Returns `true` if the two specified arrays are *structurally* equal to one another, + * i.e. contain the same number of the same elements in the same order. + */ +@SinceKotlin("1.1") +public header infix fun ByteArray.contentEquals(other: ByteArray): Boolean + +/** + * Returns `true` if the two specified arrays are *structurally* equal to one another, + * i.e. contain the same number of the same elements in the same order. + */ +@SinceKotlin("1.1") +public header infix fun ShortArray.contentEquals(other: ShortArray): Boolean + +/** + * Returns `true` if the two specified arrays are *structurally* equal to one another, + * i.e. contain the same number of the same elements in the same order. + */ +@SinceKotlin("1.1") +public header infix fun IntArray.contentEquals(other: IntArray): Boolean + +/** + * Returns `true` if the two specified arrays are *structurally* equal to one another, + * i.e. contain the same number of the same elements in the same order. + */ +@SinceKotlin("1.1") +public header infix fun LongArray.contentEquals(other: LongArray): Boolean + +/** + * Returns `true` if the two specified arrays are *structurally* equal to one another, + * i.e. contain the same number of the same elements in the same order. + */ +@SinceKotlin("1.1") +public header infix fun FloatArray.contentEquals(other: FloatArray): Boolean + +/** + * Returns `true` if the two specified arrays are *structurally* equal to one another, + * i.e. contain the same number of the same elements in the same order. + */ +@SinceKotlin("1.1") +public header infix fun DoubleArray.contentEquals(other: DoubleArray): Boolean + +/** + * Returns `true` if the two specified arrays are *structurally* equal to one another, + * i.e. contain the same number of the same elements in the same order. + */ +@SinceKotlin("1.1") +public header infix fun BooleanArray.contentEquals(other: BooleanArray): Boolean + +/** + * Returns `true` if the two specified arrays are *structurally* equal to one another, + * i.e. contain the same number of the same elements in the same order. + */ +@SinceKotlin("1.1") +public header infix fun CharArray.contentEquals(other: CharArray): Boolean + +/** + * Returns a hash code based on the contents of this array as if it is [List]. + */ +@SinceKotlin("1.1") +public header fun Array.contentHashCode(): Int + +/** + * Returns a hash code based on the contents of this array as if it is [List]. + */ +@SinceKotlin("1.1") +public header fun ByteArray.contentHashCode(): Int + +/** + * Returns a hash code based on the contents of this array as if it is [List]. + */ +@SinceKotlin("1.1") +public header fun ShortArray.contentHashCode(): Int + +/** + * Returns a hash code based on the contents of this array as if it is [List]. + */ +@SinceKotlin("1.1") +public header fun IntArray.contentHashCode(): Int + +/** + * Returns a hash code based on the contents of this array as if it is [List]. + */ +@SinceKotlin("1.1") +public header fun LongArray.contentHashCode(): Int + +/** + * Returns a hash code based on the contents of this array as if it is [List]. + */ +@SinceKotlin("1.1") +public header fun FloatArray.contentHashCode(): Int + +/** + * Returns a hash code based on the contents of this array as if it is [List]. + */ +@SinceKotlin("1.1") +public header fun DoubleArray.contentHashCode(): Int + +/** + * Returns a hash code based on the contents of this array as if it is [List]. + */ +@SinceKotlin("1.1") +public header fun BooleanArray.contentHashCode(): Int + +/** + * Returns a hash code based on the contents of this array as if it is [List]. + */ +@SinceKotlin("1.1") +public header fun CharArray.contentHashCode(): Int + +/** + * Returns a string representation of the contents of the specified array as if it is [List]. + */ +@SinceKotlin("1.1") +public header fun Array.contentToString(): String + +/** + * Returns a string representation of the contents of the specified array as if it is [List]. + */ +@SinceKotlin("1.1") +public header fun ByteArray.contentToString(): String + +/** + * Returns a string representation of the contents of the specified array as if it is [List]. + */ +@SinceKotlin("1.1") +public header fun ShortArray.contentToString(): String + +/** + * Returns a string representation of the contents of the specified array as if it is [List]. + */ +@SinceKotlin("1.1") +public header fun IntArray.contentToString(): String + +/** + * Returns a string representation of the contents of the specified array as if it is [List]. + */ +@SinceKotlin("1.1") +public header fun LongArray.contentToString(): String + +/** + * Returns a string representation of the contents of the specified array as if it is [List]. + */ +@SinceKotlin("1.1") +public header fun FloatArray.contentToString(): String + +/** + * Returns a string representation of the contents of the specified array as if it is [List]. + */ +@SinceKotlin("1.1") +public header fun DoubleArray.contentToString(): String + +/** + * Returns a string representation of the contents of the specified array as if it is [List]. + */ +@SinceKotlin("1.1") +public header fun BooleanArray.contentToString(): String + +/** + * Returns a string representation of the contents of the specified array as if it is [List]. + */ +@SinceKotlin("1.1") +public header fun CharArray.contentToString(): String + +/** + * Returns the range of valid indices for the array. + */ +public header val Array.indices: IntRange + +/** + * Returns the range of valid indices for the array. + */ +public header val ByteArray.indices: IntRange + +/** + * Returns the range of valid indices for the array. + */ +public header val ShortArray.indices: IntRange + +/** + * Returns the range of valid indices for the array. + */ +public header val IntArray.indices: IntRange + +/** + * Returns the range of valid indices for the array. + */ +public header val LongArray.indices: IntRange + +/** + * Returns the range of valid indices for the array. + */ +public header val FloatArray.indices: IntRange + +/** + * Returns the range of valid indices for the array. + */ +public header val DoubleArray.indices: IntRange + +/** + * Returns the range of valid indices for the array. + */ +public header val BooleanArray.indices: IntRange + +/** + * Returns the range of valid indices for the array. + */ +public header val CharArray.indices: IntRange + +/** + * Returns `true` if the array is empty. + */ +@kotlin.internal.InlineOnly +public header inline fun Array.isEmpty(): Boolean + +/** + * Returns `true` if the array is empty. + */ +@kotlin.internal.InlineOnly +public header inline fun ByteArray.isEmpty(): Boolean + +/** + * Returns `true` if the array is empty. + */ +@kotlin.internal.InlineOnly +public header inline fun ShortArray.isEmpty(): Boolean + +/** + * Returns `true` if the array is empty. + */ +@kotlin.internal.InlineOnly +public header inline fun IntArray.isEmpty(): Boolean + +/** + * Returns `true` if the array is empty. + */ +@kotlin.internal.InlineOnly +public header inline fun LongArray.isEmpty(): Boolean + +/** + * Returns `true` if the array is empty. + */ +@kotlin.internal.InlineOnly +public header inline fun FloatArray.isEmpty(): Boolean + +/** + * Returns `true` if the array is empty. + */ +@kotlin.internal.InlineOnly +public header inline fun DoubleArray.isEmpty(): Boolean + +/** + * Returns `true` if the array is empty. + */ +@kotlin.internal.InlineOnly +public header inline fun BooleanArray.isEmpty(): Boolean + +/** + * Returns `true` if the array is empty. + */ +@kotlin.internal.InlineOnly +public header inline fun CharArray.isEmpty(): Boolean + +/** + * Returns `true` if the array is not empty. + */ +@kotlin.internal.InlineOnly +public header inline fun Array.isNotEmpty(): Boolean + +/** + * Returns `true` if the array is not empty. + */ +@kotlin.internal.InlineOnly +public header inline fun ByteArray.isNotEmpty(): Boolean + +/** + * Returns `true` if the array is not empty. + */ +@kotlin.internal.InlineOnly +public header inline fun ShortArray.isNotEmpty(): Boolean + +/** + * Returns `true` if the array is not empty. + */ +@kotlin.internal.InlineOnly +public header inline fun IntArray.isNotEmpty(): Boolean + +/** + * Returns `true` if the array is not empty. + */ +@kotlin.internal.InlineOnly +public header inline fun LongArray.isNotEmpty(): Boolean + +/** + * Returns `true` if the array is not empty. + */ +@kotlin.internal.InlineOnly +public header inline fun FloatArray.isNotEmpty(): Boolean + +/** + * Returns `true` if the array is not empty. + */ +@kotlin.internal.InlineOnly +public header inline fun DoubleArray.isNotEmpty(): Boolean + +/** + * Returns `true` if the array is not empty. + */ +@kotlin.internal.InlineOnly +public header inline fun BooleanArray.isNotEmpty(): Boolean + +/** + * Returns `true` if the array is not empty. + */ +@kotlin.internal.InlineOnly +public header inline fun CharArray.isNotEmpty(): Boolean + +/** + * Returns the last valid index for the array. + */ +public header val Array.lastIndex: Int + +/** + * Returns the last valid index for the array. + */ +public header val ByteArray.lastIndex: Int + +/** + * Returns the last valid index for the array. + */ +public header val ShortArray.lastIndex: Int + +/** + * Returns the last valid index for the array. + */ +public header val IntArray.lastIndex: Int + +/** + * Returns the last valid index for the array. + */ +public header val LongArray.lastIndex: Int + +/** + * Returns the last valid index for the array. + */ +public header val FloatArray.lastIndex: Int + +/** + * Returns the last valid index for the array. + */ +public header val DoubleArray.lastIndex: Int + +/** + * Returns the last valid index for the array. + */ +public header val BooleanArray.lastIndex: Int + +/** + * Returns the last valid index for the array. + */ +public header val CharArray.lastIndex: Int + +/** + * Returns an array of Boolean containing all of the elements of this generic array. + */ +public header fun Array.toBooleanArray(): BooleanArray + +/** + * Returns an array of Byte containing all of the elements of this generic array. + */ +public header fun Array.toByteArray(): ByteArray + +/** + * Returns an array of Char containing all of the elements of this generic array. + */ +public header fun Array.toCharArray(): CharArray + +/** + * Returns an array of Double containing all of the elements of this generic array. + */ +public header fun Array.toDoubleArray(): DoubleArray + +/** + * Returns an array of Float containing all of the elements of this generic array. + */ +public header fun Array.toFloatArray(): FloatArray + +/** + * Returns an array of Int containing all of the elements of this generic array. + */ +public header fun Array.toIntArray(): IntArray + +/** + * Returns an array of Long containing all of the elements of this generic array. + */ +public header fun Array.toLongArray(): LongArray + +/** + * Returns an array of Short containing all of the elements of this generic array. + */ +public header fun Array.toShortArray(): ShortArray + +/** + * Returns a [Map] containing key-value pairs provided by [transform] function + * applied to elements of the given array. + * + * If any of two pairs would have the same key the last one gets added to the map. + * + * The returned map preserves the entry iteration order of the original array. + */ +public header inline fun Array.associate(transform: (T) -> Pair): Map + +/** + * Returns a [Map] containing key-value pairs provided by [transform] function + * applied to elements of the given array. + * + * If any of two pairs would have the same key the last one gets added to the map. + * + * The returned map preserves the entry iteration order of the original array. + */ +public header inline fun ByteArray.associate(transform: (Byte) -> Pair): Map + +/** + * Returns a [Map] containing key-value pairs provided by [transform] function + * applied to elements of the given array. + * + * If any of two pairs would have the same key the last one gets added to the map. + * + * The returned map preserves the entry iteration order of the original array. + */ +public header inline fun ShortArray.associate(transform: (Short) -> Pair): Map + +/** + * Returns a [Map] containing key-value pairs provided by [transform] function + * applied to elements of the given array. + * + * If any of two pairs would have the same key the last one gets added to the map. + * + * The returned map preserves the entry iteration order of the original array. + */ +public header inline fun IntArray.associate(transform: (Int) -> Pair): Map + +/** + * Returns a [Map] containing key-value pairs provided by [transform] function + * applied to elements of the given array. + * + * If any of two pairs would have the same key the last one gets added to the map. + * + * The returned map preserves the entry iteration order of the original array. + */ +public header inline fun LongArray.associate(transform: (Long) -> Pair): Map + +/** + * Returns a [Map] containing key-value pairs provided by [transform] function + * applied to elements of the given array. + * + * If any of two pairs would have the same key the last one gets added to the map. + * + * The returned map preserves the entry iteration order of the original array. + */ +public header inline fun FloatArray.associate(transform: (Float) -> Pair): Map + +/** + * Returns a [Map] containing key-value pairs provided by [transform] function + * applied to elements of the given array. + * + * If any of two pairs would have the same key the last one gets added to the map. + * + * The returned map preserves the entry iteration order of the original array. + */ +public header inline fun DoubleArray.associate(transform: (Double) -> Pair): Map + +/** + * Returns a [Map] containing key-value pairs provided by [transform] function + * applied to elements of the given array. + * + * If any of two pairs would have the same key the last one gets added to the map. + * + * The returned map preserves the entry iteration order of the original array. + */ +public header inline fun BooleanArray.associate(transform: (Boolean) -> Pair): Map + +/** + * Returns a [Map] containing key-value pairs provided by [transform] function + * applied to elements of the given array. + * + * If any of two pairs would have the same key the last one gets added to the map. + * + * The returned map preserves the entry iteration order of the original array. + */ +public header inline fun CharArray.associate(transform: (Char) -> Pair): Map + +/** + * Returns a [Map] containing the elements from the given array indexed by the key + * returned from [keySelector] function applied to each element. + * + * If any two elements would have the same key returned by [keySelector] the last one gets added to the map. + * + * The returned map preserves the entry iteration order of the original array. + */ +public header inline fun Array.associateBy(keySelector: (T) -> K): Map + +/** + * Returns a [Map] containing the elements from the given array indexed by the key + * returned from [keySelector] function applied to each element. + * + * If any two elements would have the same key returned by [keySelector] the last one gets added to the map. + * + * The returned map preserves the entry iteration order of the original array. + */ +public header inline fun ByteArray.associateBy(keySelector: (Byte) -> K): Map + +/** + * Returns a [Map] containing the elements from the given array indexed by the key + * returned from [keySelector] function applied to each element. + * + * If any two elements would have the same key returned by [keySelector] the last one gets added to the map. + * + * The returned map preserves the entry iteration order of the original array. + */ +public header inline fun ShortArray.associateBy(keySelector: (Short) -> K): Map + +/** + * Returns a [Map] containing the elements from the given array indexed by the key + * returned from [keySelector] function applied to each element. + * + * If any two elements would have the same key returned by [keySelector] the last one gets added to the map. + * + * The returned map preserves the entry iteration order of the original array. + */ +public header inline fun IntArray.associateBy(keySelector: (Int) -> K): Map + +/** + * Returns a [Map] containing the elements from the given array indexed by the key + * returned from [keySelector] function applied to each element. + * + * If any two elements would have the same key returned by [keySelector] the last one gets added to the map. + * + * The returned map preserves the entry iteration order of the original array. + */ +public header inline fun LongArray.associateBy(keySelector: (Long) -> K): Map + +/** + * Returns a [Map] containing the elements from the given array indexed by the key + * returned from [keySelector] function applied to each element. + * + * If any two elements would have the same key returned by [keySelector] the last one gets added to the map. + * + * The returned map preserves the entry iteration order of the original array. + */ +public header inline fun FloatArray.associateBy(keySelector: (Float) -> K): Map + +/** + * Returns a [Map] containing the elements from the given array indexed by the key + * returned from [keySelector] function applied to each element. + * + * If any two elements would have the same key returned by [keySelector] the last one gets added to the map. + * + * The returned map preserves the entry iteration order of the original array. + */ +public header inline fun DoubleArray.associateBy(keySelector: (Double) -> K): Map + +/** + * Returns a [Map] containing the elements from the given array indexed by the key + * returned from [keySelector] function applied to each element. + * + * If any two elements would have the same key returned by [keySelector] the last one gets added to the map. + * + * The returned map preserves the entry iteration order of the original array. + */ +public header inline fun BooleanArray.associateBy(keySelector: (Boolean) -> K): Map + +/** + * Returns a [Map] containing the elements from the given array indexed by the key + * returned from [keySelector] function applied to each element. + * + * If any two elements would have the same key returned by [keySelector] the last one gets added to the map. + * + * The returned map preserves the entry iteration order of the original array. + */ +public header inline fun CharArray.associateBy(keySelector: (Char) -> K): Map + +/** + * Returns a [Map] containing the values provided by [valueTransform] and indexed by [keySelector] functions applied to elements of the given array. + * + * If any two elements would have the same key returned by [keySelector] the last one gets added to the map. + * + * The returned map preserves the entry iteration order of the original array. + */ +public header inline fun Array.associateBy(keySelector: (T) -> K, valueTransform: (T) -> V): Map + +/** + * Returns a [Map] containing the values provided by [valueTransform] and indexed by [keySelector] functions applied to elements of the given array. + * + * If any two elements would have the same key returned by [keySelector] the last one gets added to the map. + * + * The returned map preserves the entry iteration order of the original array. + */ +public header inline fun ByteArray.associateBy(keySelector: (Byte) -> K, valueTransform: (Byte) -> V): Map + +/** + * Returns a [Map] containing the values provided by [valueTransform] and indexed by [keySelector] functions applied to elements of the given array. + * + * If any two elements would have the same key returned by [keySelector] the last one gets added to the map. + * + * The returned map preserves the entry iteration order of the original array. + */ +public header inline fun ShortArray.associateBy(keySelector: (Short) -> K, valueTransform: (Short) -> V): Map + +/** + * Returns a [Map] containing the values provided by [valueTransform] and indexed by [keySelector] functions applied to elements of the given array. + * + * If any two elements would have the same key returned by [keySelector] the last one gets added to the map. + * + * The returned map preserves the entry iteration order of the original array. + */ +public header inline fun IntArray.associateBy(keySelector: (Int) -> K, valueTransform: (Int) -> V): Map + +/** + * Returns a [Map] containing the values provided by [valueTransform] and indexed by [keySelector] functions applied to elements of the given array. + * + * If any two elements would have the same key returned by [keySelector] the last one gets added to the map. + * + * The returned map preserves the entry iteration order of the original array. + */ +public header inline fun LongArray.associateBy(keySelector: (Long) -> K, valueTransform: (Long) -> V): Map + +/** + * Returns a [Map] containing the values provided by [valueTransform] and indexed by [keySelector] functions applied to elements of the given array. + * + * If any two elements would have the same key returned by [keySelector] the last one gets added to the map. + * + * The returned map preserves the entry iteration order of the original array. + */ +public header inline fun FloatArray.associateBy(keySelector: (Float) -> K, valueTransform: (Float) -> V): Map + +/** + * Returns a [Map] containing the values provided by [valueTransform] and indexed by [keySelector] functions applied to elements of the given array. + * + * If any two elements would have the same key returned by [keySelector] the last one gets added to the map. + * + * The returned map preserves the entry iteration order of the original array. + */ +public header inline fun DoubleArray.associateBy(keySelector: (Double) -> K, valueTransform: (Double) -> V): Map + +/** + * Returns a [Map] containing the values provided by [valueTransform] and indexed by [keySelector] functions applied to elements of the given array. + * + * If any two elements would have the same key returned by [keySelector] the last one gets added to the map. + * + * The returned map preserves the entry iteration order of the original array. + */ +public header inline fun BooleanArray.associateBy(keySelector: (Boolean) -> K, valueTransform: (Boolean) -> V): Map + +/** + * Returns a [Map] containing the values provided by [valueTransform] and indexed by [keySelector] functions applied to elements of the given array. + * + * If any two elements would have the same key returned by [keySelector] the last one gets added to the map. + * + * The returned map preserves the entry iteration order of the original array. + */ +public header inline fun CharArray.associateBy(keySelector: (Char) -> K, valueTransform: (Char) -> V): Map + +/** + * Populates and returns the [destination] mutable map with key-value pairs, + * where key is provided by the [keySelector] function applied to each element of the given array + * and value is the element itself. + * + * If any two elements would have the same key returned by [keySelector] the last one gets added to the map. + */ +public header inline fun > Array.associateByTo(destination: M, keySelector: (T) -> K): M + +/** + * Populates and returns the [destination] mutable map with key-value pairs, + * where key is provided by the [keySelector] function applied to each element of the given array + * and value is the element itself. + * + * If any two elements would have the same key returned by [keySelector] the last one gets added to the map. + */ +public header inline fun > ByteArray.associateByTo(destination: M, keySelector: (Byte) -> K): M + +/** + * Populates and returns the [destination] mutable map with key-value pairs, + * where key is provided by the [keySelector] function applied to each element of the given array + * and value is the element itself. + * + * If any two elements would have the same key returned by [keySelector] the last one gets added to the map. + */ +public header inline fun > ShortArray.associateByTo(destination: M, keySelector: (Short) -> K): M + +/** + * Populates and returns the [destination] mutable map with key-value pairs, + * where key is provided by the [keySelector] function applied to each element of the given array + * and value is the element itself. + * + * If any two elements would have the same key returned by [keySelector] the last one gets added to the map. + */ +public header inline fun > IntArray.associateByTo(destination: M, keySelector: (Int) -> K): M + +/** + * Populates and returns the [destination] mutable map with key-value pairs, + * where key is provided by the [keySelector] function applied to each element of the given array + * and value is the element itself. + * + * If any two elements would have the same key returned by [keySelector] the last one gets added to the map. + */ +public header inline fun > LongArray.associateByTo(destination: M, keySelector: (Long) -> K): M + +/** + * Populates and returns the [destination] mutable map with key-value pairs, + * where key is provided by the [keySelector] function applied to each element of the given array + * and value is the element itself. + * + * If any two elements would have the same key returned by [keySelector] the last one gets added to the map. + */ +public header inline fun > FloatArray.associateByTo(destination: M, keySelector: (Float) -> K): M + +/** + * Populates and returns the [destination] mutable map with key-value pairs, + * where key is provided by the [keySelector] function applied to each element of the given array + * and value is the element itself. + * + * If any two elements would have the same key returned by [keySelector] the last one gets added to the map. + */ +public header inline fun > DoubleArray.associateByTo(destination: M, keySelector: (Double) -> K): M + +/** + * Populates and returns the [destination] mutable map with key-value pairs, + * where key is provided by the [keySelector] function applied to each element of the given array + * and value is the element itself. + * + * If any two elements would have the same key returned by [keySelector] the last one gets added to the map. + */ +public header inline fun > BooleanArray.associateByTo(destination: M, keySelector: (Boolean) -> K): M + +/** + * Populates and returns the [destination] mutable map with key-value pairs, + * where key is provided by the [keySelector] function applied to each element of the given array + * and value is the element itself. + * + * If any two elements would have the same key returned by [keySelector] the last one gets added to the map. + */ +public header inline fun > CharArray.associateByTo(destination: M, keySelector: (Char) -> K): M + +/** + * Populates and returns the [destination] mutable map with key-value pairs, + * where key is provided by the [keySelector] function and + * and value is provided by the [valueTransform] function applied to elements of the given array. + * + * If any two elements would have the same key returned by [keySelector] the last one gets added to the map. + */ +public header inline fun > Array.associateByTo(destination: M, keySelector: (T) -> K, valueTransform: (T) -> V): M + +/** + * Populates and returns the [destination] mutable map with key-value pairs, + * where key is provided by the [keySelector] function and + * and value is provided by the [valueTransform] function applied to elements of the given array. + * + * If any two elements would have the same key returned by [keySelector] the last one gets added to the map. + */ +public header inline fun > ByteArray.associateByTo(destination: M, keySelector: (Byte) -> K, valueTransform: (Byte) -> V): M + +/** + * Populates and returns the [destination] mutable map with key-value pairs, + * where key is provided by the [keySelector] function and + * and value is provided by the [valueTransform] function applied to elements of the given array. + * + * If any two elements would have the same key returned by [keySelector] the last one gets added to the map. + */ +public header inline fun > ShortArray.associateByTo(destination: M, keySelector: (Short) -> K, valueTransform: (Short) -> V): M + +/** + * Populates and returns the [destination] mutable map with key-value pairs, + * where key is provided by the [keySelector] function and + * and value is provided by the [valueTransform] function applied to elements of the given array. + * + * If any two elements would have the same key returned by [keySelector] the last one gets added to the map. + */ +public header inline fun > IntArray.associateByTo(destination: M, keySelector: (Int) -> K, valueTransform: (Int) -> V): M + +/** + * Populates and returns the [destination] mutable map with key-value pairs, + * where key is provided by the [keySelector] function and + * and value is provided by the [valueTransform] function applied to elements of the given array. + * + * If any two elements would have the same key returned by [keySelector] the last one gets added to the map. + */ +public header inline fun > LongArray.associateByTo(destination: M, keySelector: (Long) -> K, valueTransform: (Long) -> V): M + +/** + * Populates and returns the [destination] mutable map with key-value pairs, + * where key is provided by the [keySelector] function and + * and value is provided by the [valueTransform] function applied to elements of the given array. + * + * If any two elements would have the same key returned by [keySelector] the last one gets added to the map. + */ +public header inline fun > FloatArray.associateByTo(destination: M, keySelector: (Float) -> K, valueTransform: (Float) -> V): M + +/** + * Populates and returns the [destination] mutable map with key-value pairs, + * where key is provided by the [keySelector] function and + * and value is provided by the [valueTransform] function applied to elements of the given array. + * + * If any two elements would have the same key returned by [keySelector] the last one gets added to the map. + */ +public header inline fun > DoubleArray.associateByTo(destination: M, keySelector: (Double) -> K, valueTransform: (Double) -> V): M + +/** + * Populates and returns the [destination] mutable map with key-value pairs, + * where key is provided by the [keySelector] function and + * and value is provided by the [valueTransform] function applied to elements of the given array. + * + * If any two elements would have the same key returned by [keySelector] the last one gets added to the map. + */ +public header inline fun > BooleanArray.associateByTo(destination: M, keySelector: (Boolean) -> K, valueTransform: (Boolean) -> V): M + +/** + * Populates and returns the [destination] mutable map with key-value pairs, + * where key is provided by the [keySelector] function and + * and value is provided by the [valueTransform] function applied to elements of the given array. + * + * If any two elements would have the same key returned by [keySelector] the last one gets added to the map. + */ +public header inline fun > CharArray.associateByTo(destination: M, keySelector: (Char) -> K, valueTransform: (Char) -> V): M + +/** + * Populates and returns the [destination] mutable map with key-value pairs + * provided by [transform] function applied to each element of the given array. + * + * If any of two pairs would have the same key the last one gets added to the map. + */ +public header inline fun > Array.associateTo(destination: M, transform: (T) -> Pair): M + +/** + * Populates and returns the [destination] mutable map with key-value pairs + * provided by [transform] function applied to each element of the given array. + * + * If any of two pairs would have the same key the last one gets added to the map. + */ +public header inline fun > ByteArray.associateTo(destination: M, transform: (Byte) -> Pair): M + +/** + * Populates and returns the [destination] mutable map with key-value pairs + * provided by [transform] function applied to each element of the given array. + * + * If any of two pairs would have the same key the last one gets added to the map. + */ +public header inline fun > ShortArray.associateTo(destination: M, transform: (Short) -> Pair): M + +/** + * Populates and returns the [destination] mutable map with key-value pairs + * provided by [transform] function applied to each element of the given array. + * + * If any of two pairs would have the same key the last one gets added to the map. + */ +public header inline fun > IntArray.associateTo(destination: M, transform: (Int) -> Pair): M + +/** + * Populates and returns the [destination] mutable map with key-value pairs + * provided by [transform] function applied to each element of the given array. + * + * If any of two pairs would have the same key the last one gets added to the map. + */ +public header inline fun > LongArray.associateTo(destination: M, transform: (Long) -> Pair): M + +/** + * Populates and returns the [destination] mutable map with key-value pairs + * provided by [transform] function applied to each element of the given array. + * + * If any of two pairs would have the same key the last one gets added to the map. + */ +public header inline fun > FloatArray.associateTo(destination: M, transform: (Float) -> Pair): M + +/** + * Populates and returns the [destination] mutable map with key-value pairs + * provided by [transform] function applied to each element of the given array. + * + * If any of two pairs would have the same key the last one gets added to the map. + */ +public header inline fun > DoubleArray.associateTo(destination: M, transform: (Double) -> Pair): M + +/** + * Populates and returns the [destination] mutable map with key-value pairs + * provided by [transform] function applied to each element of the given array. + * + * If any of two pairs would have the same key the last one gets added to the map. + */ +public header inline fun > BooleanArray.associateTo(destination: M, transform: (Boolean) -> Pair): M + +/** + * Populates and returns the [destination] mutable map with key-value pairs + * provided by [transform] function applied to each element of the given array. + * + * If any of two pairs would have the same key the last one gets added to the map. + */ +public header inline fun > CharArray.associateTo(destination: M, transform: (Char) -> Pair): M + +/** + * Appends all elements to the given [destination] collection. + */ +public header fun > Array.toCollection(destination: C): C + +/** + * Appends all elements to the given [destination] collection. + */ +public header fun > ByteArray.toCollection(destination: C): C + +/** + * Appends all elements to the given [destination] collection. + */ +public header fun > ShortArray.toCollection(destination: C): C + +/** + * Appends all elements to the given [destination] collection. + */ +public header fun > IntArray.toCollection(destination: C): C + +/** + * Appends all elements to the given [destination] collection. + */ +public header fun > LongArray.toCollection(destination: C): C + +/** + * Appends all elements to the given [destination] collection. + */ +public header fun > FloatArray.toCollection(destination: C): C + +/** + * Appends all elements to the given [destination] collection. + */ +public header fun > DoubleArray.toCollection(destination: C): C + +/** + * Appends all elements to the given [destination] collection. + */ +public header fun > BooleanArray.toCollection(destination: C): C + +/** + * Appends all elements to the given [destination] collection. + */ +public header fun > CharArray.toCollection(destination: C): C + +/** + * Returns a [HashSet] of all elements. + */ +public header fun Array.toHashSet(): HashSet + +/** + * Returns a [HashSet] of all elements. + */ +public header fun ByteArray.toHashSet(): HashSet + +/** + * Returns a [HashSet] of all elements. + */ +public header fun ShortArray.toHashSet(): HashSet + +/** + * Returns a [HashSet] of all elements. + */ +public header fun IntArray.toHashSet(): HashSet + +/** + * Returns a [HashSet] of all elements. + */ +public header fun LongArray.toHashSet(): HashSet + +/** + * Returns a [HashSet] of all elements. + */ +public header fun FloatArray.toHashSet(): HashSet + +/** + * Returns a [HashSet] of all elements. + */ +public header fun DoubleArray.toHashSet(): HashSet + +/** + * Returns a [HashSet] of all elements. + */ +public header fun BooleanArray.toHashSet(): HashSet + +/** + * Returns a [HashSet] of all elements. + */ +public header fun CharArray.toHashSet(): HashSet + +/** + * Returns a [List] containing all elements. + */ +public header fun Array.toList(): List + +/** + * Returns a [List] containing all elements. + */ +public header fun ByteArray.toList(): List + +/** + * Returns a [List] containing all elements. + */ +public header fun ShortArray.toList(): List + +/** + * Returns a [List] containing all elements. + */ +public header fun IntArray.toList(): List + +/** + * Returns a [List] containing all elements. + */ +public header fun LongArray.toList(): List + +/** + * Returns a [List] containing all elements. + */ +public header fun FloatArray.toList(): List + +/** + * Returns a [List] containing all elements. + */ +public header fun DoubleArray.toList(): List + +/** + * Returns a [List] containing all elements. + */ +public header fun BooleanArray.toList(): List + +/** + * Returns a [List] containing all elements. + */ +public header fun CharArray.toList(): List + +/** + * Returns a [MutableList] filled with all elements of this array. + */ +public header fun Array.toMutableList(): MutableList + +/** + * Returns a [MutableList] filled with all elements of this array. + */ +public header fun ByteArray.toMutableList(): MutableList + +/** + * Returns a [MutableList] filled with all elements of this array. + */ +public header fun ShortArray.toMutableList(): MutableList + +/** + * Returns a [MutableList] filled with all elements of this array. + */ +public header fun IntArray.toMutableList(): MutableList + +/** + * Returns a [MutableList] filled with all elements of this array. + */ +public header fun LongArray.toMutableList(): MutableList + +/** + * Returns a [MutableList] filled with all elements of this array. + */ +public header fun FloatArray.toMutableList(): MutableList + +/** + * Returns a [MutableList] filled with all elements of this array. + */ +public header fun DoubleArray.toMutableList(): MutableList + +/** + * Returns a [MutableList] filled with all elements of this array. + */ +public header fun BooleanArray.toMutableList(): MutableList + +/** + * Returns a [MutableList] filled with all elements of this array. + */ +public header fun CharArray.toMutableList(): MutableList + +/** + * Returns a [Set] of all elements. + * + * The returned set preserves the element iteration order of the original array. + */ +public header fun Array.toSet(): Set + +/** + * Returns a [Set] of all elements. + * + * The returned set preserves the element iteration order of the original array. + */ +public header fun ByteArray.toSet(): Set + +/** + * Returns a [Set] of all elements. + * + * The returned set preserves the element iteration order of the original array. + */ +public header fun ShortArray.toSet(): Set + +/** + * Returns a [Set] of all elements. + * + * The returned set preserves the element iteration order of the original array. + */ +public header fun IntArray.toSet(): Set + +/** + * Returns a [Set] of all elements. + * + * The returned set preserves the element iteration order of the original array. + */ +public header fun LongArray.toSet(): Set + +/** + * Returns a [Set] of all elements. + * + * The returned set preserves the element iteration order of the original array. + */ +public header fun FloatArray.toSet(): Set + +/** + * Returns a [Set] of all elements. + * + * The returned set preserves the element iteration order of the original array. + */ +public header fun DoubleArray.toSet(): Set + +/** + * Returns a [Set] of all elements. + * + * The returned set preserves the element iteration order of the original array. + */ +public header fun BooleanArray.toSet(): Set + +/** + * Returns a [Set] of all elements. + * + * The returned set preserves the element iteration order of the original array. + */ +public header fun CharArray.toSet(): Set + +/** + * Returns a single list of all elements yielded from results of [transform] function being invoked on each element of original array. + */ +public header inline fun Array.flatMap(transform: (T) -> Iterable): List + +/** + * Returns a single list of all elements yielded from results of [transform] function being invoked on each element of original array. + */ +public header inline fun ByteArray.flatMap(transform: (Byte) -> Iterable): List + +/** + * Returns a single list of all elements yielded from results of [transform] function being invoked on each element of original array. + */ +public header inline fun ShortArray.flatMap(transform: (Short) -> Iterable): List + +/** + * Returns a single list of all elements yielded from results of [transform] function being invoked on each element of original array. + */ +public header inline fun IntArray.flatMap(transform: (Int) -> Iterable): List + +/** + * Returns a single list of all elements yielded from results of [transform] function being invoked on each element of original array. + */ +public header inline fun LongArray.flatMap(transform: (Long) -> Iterable): List + +/** + * Returns a single list of all elements yielded from results of [transform] function being invoked on each element of original array. + */ +public header inline fun FloatArray.flatMap(transform: (Float) -> Iterable): List + +/** + * Returns a single list of all elements yielded from results of [transform] function being invoked on each element of original array. + */ +public header inline fun DoubleArray.flatMap(transform: (Double) -> Iterable): List + +/** + * Returns a single list of all elements yielded from results of [transform] function being invoked on each element of original array. + */ +public header inline fun BooleanArray.flatMap(transform: (Boolean) -> Iterable): List + +/** + * Returns a single list of all elements yielded from results of [transform] function being invoked on each element of original array. + */ +public header inline fun CharArray.flatMap(transform: (Char) -> Iterable): List + +/** + * Appends all elements yielded from results of [transform] function being invoked on each element of original array, to the given [destination]. + */ +public header inline fun > Array.flatMapTo(destination: C, transform: (T) -> Iterable): C + +/** + * Appends all elements yielded from results of [transform] function being invoked on each element of original array, to the given [destination]. + */ +public header inline fun > ByteArray.flatMapTo(destination: C, transform: (Byte) -> Iterable): C + +/** + * Appends all elements yielded from results of [transform] function being invoked on each element of original array, to the given [destination]. + */ +public header inline fun > ShortArray.flatMapTo(destination: C, transform: (Short) -> Iterable): C + +/** + * Appends all elements yielded from results of [transform] function being invoked on each element of original array, to the given [destination]. + */ +public header inline fun > IntArray.flatMapTo(destination: C, transform: (Int) -> Iterable): C + +/** + * Appends all elements yielded from results of [transform] function being invoked on each element of original array, to the given [destination]. + */ +public header inline fun > LongArray.flatMapTo(destination: C, transform: (Long) -> Iterable): C + +/** + * Appends all elements yielded from results of [transform] function being invoked on each element of original array, to the given [destination]. + */ +public header inline fun > FloatArray.flatMapTo(destination: C, transform: (Float) -> Iterable): C + +/** + * Appends all elements yielded from results of [transform] function being invoked on each element of original array, to the given [destination]. + */ +public header inline fun > DoubleArray.flatMapTo(destination: C, transform: (Double) -> Iterable): C + +/** + * Appends all elements yielded from results of [transform] function being invoked on each element of original array, to the given [destination]. + */ +public header inline fun > BooleanArray.flatMapTo(destination: C, transform: (Boolean) -> Iterable): C + +/** + * Appends all elements yielded from results of [transform] function being invoked on each element of original array, to the given [destination]. + */ +public header inline fun > CharArray.flatMapTo(destination: C, transform: (Char) -> Iterable): C + +/** + * Groups elements of the original array by the key returned by the given [keySelector] function + * applied to each element and returns a map where each group key is associated with a list of corresponding elements. + * + * The returned map preserves the entry iteration order of the keys produced from the original array. + * + * @sample samples.collections.Collections.Transformations.groupBy + */ +public header inline fun Array.groupBy(keySelector: (T) -> K): Map> + +/** + * Groups elements of the original array by the key returned by the given [keySelector] function + * applied to each element and returns a map where each group key is associated with a list of corresponding elements. + * + * The returned map preserves the entry iteration order of the keys produced from the original array. + * + * @sample samples.collections.Collections.Transformations.groupBy + */ +public header inline fun ByteArray.groupBy(keySelector: (Byte) -> K): Map> + +/** + * Groups elements of the original array by the key returned by the given [keySelector] function + * applied to each element and returns a map where each group key is associated with a list of corresponding elements. + * + * The returned map preserves the entry iteration order of the keys produced from the original array. + * + * @sample samples.collections.Collections.Transformations.groupBy + */ +public header inline fun ShortArray.groupBy(keySelector: (Short) -> K): Map> + +/** + * Groups elements of the original array by the key returned by the given [keySelector] function + * applied to each element and returns a map where each group key is associated with a list of corresponding elements. + * + * The returned map preserves the entry iteration order of the keys produced from the original array. + * + * @sample samples.collections.Collections.Transformations.groupBy + */ +public header inline fun IntArray.groupBy(keySelector: (Int) -> K): Map> + +/** + * Groups elements of the original array by the key returned by the given [keySelector] function + * applied to each element and returns a map where each group key is associated with a list of corresponding elements. + * + * The returned map preserves the entry iteration order of the keys produced from the original array. + * + * @sample samples.collections.Collections.Transformations.groupBy + */ +public header inline fun LongArray.groupBy(keySelector: (Long) -> K): Map> + +/** + * Groups elements of the original array by the key returned by the given [keySelector] function + * applied to each element and returns a map where each group key is associated with a list of corresponding elements. + * + * The returned map preserves the entry iteration order of the keys produced from the original array. + * + * @sample samples.collections.Collections.Transformations.groupBy + */ +public header inline fun FloatArray.groupBy(keySelector: (Float) -> K): Map> + +/** + * Groups elements of the original array by the key returned by the given [keySelector] function + * applied to each element and returns a map where each group key is associated with a list of corresponding elements. + * + * The returned map preserves the entry iteration order of the keys produced from the original array. + * + * @sample samples.collections.Collections.Transformations.groupBy + */ +public header inline fun DoubleArray.groupBy(keySelector: (Double) -> K): Map> + +/** + * Groups elements of the original array by the key returned by the given [keySelector] function + * applied to each element and returns a map where each group key is associated with a list of corresponding elements. + * + * The returned map preserves the entry iteration order of the keys produced from the original array. + * + * @sample samples.collections.Collections.Transformations.groupBy + */ +public header inline fun BooleanArray.groupBy(keySelector: (Boolean) -> K): Map> + +/** + * Groups elements of the original array by the key returned by the given [keySelector] function + * applied to each element and returns a map where each group key is associated with a list of corresponding elements. + * + * The returned map preserves the entry iteration order of the keys produced from the original array. + * + * @sample samples.collections.Collections.Transformations.groupBy + */ +public header inline fun CharArray.groupBy(keySelector: (Char) -> K): Map> + +/** + * Groups values returned by the [valueTransform] function applied to each element of the original array + * by the key returned by the given [keySelector] function applied to the element + * and returns a map where each group key is associated with a list of corresponding values. + * + * The returned map preserves the entry iteration order of the keys produced from the original array. + * + * @sample samples.collections.Collections.Transformations.groupByKeysAndValues + */ +public header inline fun Array.groupBy(keySelector: (T) -> K, valueTransform: (T) -> V): Map> + +/** + * Groups values returned by the [valueTransform] function applied to each element of the original array + * by the key returned by the given [keySelector] function applied to the element + * and returns a map where each group key is associated with a list of corresponding values. + * + * The returned map preserves the entry iteration order of the keys produced from the original array. + * + * @sample samples.collections.Collections.Transformations.groupByKeysAndValues + */ +public header inline fun ByteArray.groupBy(keySelector: (Byte) -> K, valueTransform: (Byte) -> V): Map> + +/** + * Groups values returned by the [valueTransform] function applied to each element of the original array + * by the key returned by the given [keySelector] function applied to the element + * and returns a map where each group key is associated with a list of corresponding values. + * + * The returned map preserves the entry iteration order of the keys produced from the original array. + * + * @sample samples.collections.Collections.Transformations.groupByKeysAndValues + */ +public header inline fun ShortArray.groupBy(keySelector: (Short) -> K, valueTransform: (Short) -> V): Map> + +/** + * Groups values returned by the [valueTransform] function applied to each element of the original array + * by the key returned by the given [keySelector] function applied to the element + * and returns a map where each group key is associated with a list of corresponding values. + * + * The returned map preserves the entry iteration order of the keys produced from the original array. + * + * @sample samples.collections.Collections.Transformations.groupByKeysAndValues + */ +public header inline fun IntArray.groupBy(keySelector: (Int) -> K, valueTransform: (Int) -> V): Map> + +/** + * Groups values returned by the [valueTransform] function applied to each element of the original array + * by the key returned by the given [keySelector] function applied to the element + * and returns a map where each group key is associated with a list of corresponding values. + * + * The returned map preserves the entry iteration order of the keys produced from the original array. + * + * @sample samples.collections.Collections.Transformations.groupByKeysAndValues + */ +public header inline fun LongArray.groupBy(keySelector: (Long) -> K, valueTransform: (Long) -> V): Map> + +/** + * Groups values returned by the [valueTransform] function applied to each element of the original array + * by the key returned by the given [keySelector] function applied to the element + * and returns a map where each group key is associated with a list of corresponding values. + * + * The returned map preserves the entry iteration order of the keys produced from the original array. + * + * @sample samples.collections.Collections.Transformations.groupByKeysAndValues + */ +public header inline fun FloatArray.groupBy(keySelector: (Float) -> K, valueTransform: (Float) -> V): Map> + +/** + * Groups values returned by the [valueTransform] function applied to each element of the original array + * by the key returned by the given [keySelector] function applied to the element + * and returns a map where each group key is associated with a list of corresponding values. + * + * The returned map preserves the entry iteration order of the keys produced from the original array. + * + * @sample samples.collections.Collections.Transformations.groupByKeysAndValues + */ +public header inline fun DoubleArray.groupBy(keySelector: (Double) -> K, valueTransform: (Double) -> V): Map> + +/** + * Groups values returned by the [valueTransform] function applied to each element of the original array + * by the key returned by the given [keySelector] function applied to the element + * and returns a map where each group key is associated with a list of corresponding values. + * + * The returned map preserves the entry iteration order of the keys produced from the original array. + * + * @sample samples.collections.Collections.Transformations.groupByKeysAndValues + */ +public header inline fun BooleanArray.groupBy(keySelector: (Boolean) -> K, valueTransform: (Boolean) -> V): Map> + +/** + * Groups values returned by the [valueTransform] function applied to each element of the original array + * by the key returned by the given [keySelector] function applied to the element + * and returns a map where each group key is associated with a list of corresponding values. + * + * The returned map preserves the entry iteration order of the keys produced from the original array. + * + * @sample samples.collections.Collections.Transformations.groupByKeysAndValues + */ +public header inline fun CharArray.groupBy(keySelector: (Char) -> K, valueTransform: (Char) -> V): Map> + +/** + * Groups elements of the original array by the key returned by the given [keySelector] function + * applied to each element and puts to the [destination] map each group key associated with a list of corresponding elements. + * + * @return The [destination] map. + * + * @sample samples.collections.Collections.Transformations.groupBy + */ +public header inline fun >> Array.groupByTo(destination: M, keySelector: (T) -> K): M + +/** + * Groups elements of the original array by the key returned by the given [keySelector] function + * applied to each element and puts to the [destination] map each group key associated with a list of corresponding elements. + * + * @return The [destination] map. + * + * @sample samples.collections.Collections.Transformations.groupBy + */ +public header inline fun >> ByteArray.groupByTo(destination: M, keySelector: (Byte) -> K): M + +/** + * Groups elements of the original array by the key returned by the given [keySelector] function + * applied to each element and puts to the [destination] map each group key associated with a list of corresponding elements. + * + * @return The [destination] map. + * + * @sample samples.collections.Collections.Transformations.groupBy + */ +public header inline fun >> ShortArray.groupByTo(destination: M, keySelector: (Short) -> K): M + +/** + * Groups elements of the original array by the key returned by the given [keySelector] function + * applied to each element and puts to the [destination] map each group key associated with a list of corresponding elements. + * + * @return The [destination] map. + * + * @sample samples.collections.Collections.Transformations.groupBy + */ +public header inline fun >> IntArray.groupByTo(destination: M, keySelector: (Int) -> K): M + +/** + * Groups elements of the original array by the key returned by the given [keySelector] function + * applied to each element and puts to the [destination] map each group key associated with a list of corresponding elements. + * + * @return The [destination] map. + * + * @sample samples.collections.Collections.Transformations.groupBy + */ +public header inline fun >> LongArray.groupByTo(destination: M, keySelector: (Long) -> K): M + +/** + * Groups elements of the original array by the key returned by the given [keySelector] function + * applied to each element and puts to the [destination] map each group key associated with a list of corresponding elements. + * + * @return The [destination] map. + * + * @sample samples.collections.Collections.Transformations.groupBy + */ +public header inline fun >> FloatArray.groupByTo(destination: M, keySelector: (Float) -> K): M + +/** + * Groups elements of the original array by the key returned by the given [keySelector] function + * applied to each element and puts to the [destination] map each group key associated with a list of corresponding elements. + * + * @return The [destination] map. + * + * @sample samples.collections.Collections.Transformations.groupBy + */ +public header inline fun >> DoubleArray.groupByTo(destination: M, keySelector: (Double) -> K): M + +/** + * Groups elements of the original array by the key returned by the given [keySelector] function + * applied to each element and puts to the [destination] map each group key associated with a list of corresponding elements. + * + * @return The [destination] map. + * + * @sample samples.collections.Collections.Transformations.groupBy + */ +public header inline fun >> BooleanArray.groupByTo(destination: M, keySelector: (Boolean) -> K): M + +/** + * Groups elements of the original array by the key returned by the given [keySelector] function + * applied to each element and puts to the [destination] map each group key associated with a list of corresponding elements. + * + * @return The [destination] map. + * + * @sample samples.collections.Collections.Transformations.groupBy + */ +public header inline fun >> CharArray.groupByTo(destination: M, keySelector: (Char) -> K): M + +/** + * Groups values returned by the [valueTransform] function applied to each element of the original array + * by the key returned by the given [keySelector] function applied to the element + * and puts to the [destination] map each group key associated with a list of corresponding values. + * + * @return The [destination] map. + * + * @sample samples.collections.Collections.Transformations.groupByKeysAndValues + */ +public header inline fun >> Array.groupByTo(destination: M, keySelector: (T) -> K, valueTransform: (T) -> V): M + +/** + * Groups values returned by the [valueTransform] function applied to each element of the original array + * by the key returned by the given [keySelector] function applied to the element + * and puts to the [destination] map each group key associated with a list of corresponding values. + * + * @return The [destination] map. + * + * @sample samples.collections.Collections.Transformations.groupByKeysAndValues + */ +public header inline fun >> ByteArray.groupByTo(destination: M, keySelector: (Byte) -> K, valueTransform: (Byte) -> V): M + +/** + * Groups values returned by the [valueTransform] function applied to each element of the original array + * by the key returned by the given [keySelector] function applied to the element + * and puts to the [destination] map each group key associated with a list of corresponding values. + * + * @return The [destination] map. + * + * @sample samples.collections.Collections.Transformations.groupByKeysAndValues + */ +public header inline fun >> ShortArray.groupByTo(destination: M, keySelector: (Short) -> K, valueTransform: (Short) -> V): M + +/** + * Groups values returned by the [valueTransform] function applied to each element of the original array + * by the key returned by the given [keySelector] function applied to the element + * and puts to the [destination] map each group key associated with a list of corresponding values. + * + * @return The [destination] map. + * + * @sample samples.collections.Collections.Transformations.groupByKeysAndValues + */ +public header inline fun >> IntArray.groupByTo(destination: M, keySelector: (Int) -> K, valueTransform: (Int) -> V): M + +/** + * Groups values returned by the [valueTransform] function applied to each element of the original array + * by the key returned by the given [keySelector] function applied to the element + * and puts to the [destination] map each group key associated with a list of corresponding values. + * + * @return The [destination] map. + * + * @sample samples.collections.Collections.Transformations.groupByKeysAndValues + */ +public header inline fun >> LongArray.groupByTo(destination: M, keySelector: (Long) -> K, valueTransform: (Long) -> V): M + +/** + * Groups values returned by the [valueTransform] function applied to each element of the original array + * by the key returned by the given [keySelector] function applied to the element + * and puts to the [destination] map each group key associated with a list of corresponding values. + * + * @return The [destination] map. + * + * @sample samples.collections.Collections.Transformations.groupByKeysAndValues + */ +public header inline fun >> FloatArray.groupByTo(destination: M, keySelector: (Float) -> K, valueTransform: (Float) -> V): M + +/** + * Groups values returned by the [valueTransform] function applied to each element of the original array + * by the key returned by the given [keySelector] function applied to the element + * and puts to the [destination] map each group key associated with a list of corresponding values. + * + * @return The [destination] map. + * + * @sample samples.collections.Collections.Transformations.groupByKeysAndValues + */ +public header inline fun >> DoubleArray.groupByTo(destination: M, keySelector: (Double) -> K, valueTransform: (Double) -> V): M + +/** + * Groups values returned by the [valueTransform] function applied to each element of the original array + * by the key returned by the given [keySelector] function applied to the element + * and puts to the [destination] map each group key associated with a list of corresponding values. + * + * @return The [destination] map. + * + * @sample samples.collections.Collections.Transformations.groupByKeysAndValues + */ +public header inline fun >> BooleanArray.groupByTo(destination: M, keySelector: (Boolean) -> K, valueTransform: (Boolean) -> V): M + +/** + * Groups values returned by the [valueTransform] function applied to each element of the original array + * by the key returned by the given [keySelector] function applied to the element + * and puts to the [destination] map each group key associated with a list of corresponding values. + * + * @return The [destination] map. + * + * @sample samples.collections.Collections.Transformations.groupByKeysAndValues + */ +public header inline fun >> CharArray.groupByTo(destination: M, keySelector: (Char) -> K, valueTransform: (Char) -> V): M + +/** + * Returns a list containing the results of applying the given [transform] function + * to each element in the original array. + */ +public header inline fun Array.map(transform: (T) -> R): List + +/** + * Returns a list containing the results of applying the given [transform] function + * to each element in the original array. + */ +public header inline fun ByteArray.map(transform: (Byte) -> R): List + +/** + * Returns a list containing the results of applying the given [transform] function + * to each element in the original array. + */ +public header inline fun ShortArray.map(transform: (Short) -> R): List + +/** + * Returns a list containing the results of applying the given [transform] function + * to each element in the original array. + */ +public header inline fun IntArray.map(transform: (Int) -> R): List + +/** + * Returns a list containing the results of applying the given [transform] function + * to each element in the original array. + */ +public header inline fun LongArray.map(transform: (Long) -> R): List + +/** + * Returns a list containing the results of applying the given [transform] function + * to each element in the original array. + */ +public header inline fun FloatArray.map(transform: (Float) -> R): List + +/** + * Returns a list containing the results of applying the given [transform] function + * to each element in the original array. + */ +public header inline fun DoubleArray.map(transform: (Double) -> R): List + +/** + * Returns a list containing the results of applying the given [transform] function + * to each element in the original array. + */ +public header inline fun BooleanArray.map(transform: (Boolean) -> R): List + +/** + * Returns a list containing the results of applying the given [transform] function + * to each element in the original array. + */ +public header inline fun CharArray.map(transform: (Char) -> R): List + +/** + * Returns a list containing the results of applying the given [transform] function + * to each element and its index in the original array. + * @param [transform] function that takes the index of an element and the element itself + * and returns the result of the transform applied to the element. + */ +public header inline fun Array.mapIndexed(transform: (Int, T) -> R): List + +/** + * Returns a list containing the results of applying the given [transform] function + * to each element and its index in the original array. + * @param [transform] function that takes the index of an element and the element itself + * and returns the result of the transform applied to the element. + */ +public header inline fun ByteArray.mapIndexed(transform: (Int, Byte) -> R): List + +/** + * Returns a list containing the results of applying the given [transform] function + * to each element and its index in the original array. + * @param [transform] function that takes the index of an element and the element itself + * and returns the result of the transform applied to the element. + */ +public header inline fun ShortArray.mapIndexed(transform: (Int, Short) -> R): List + +/** + * Returns a list containing the results of applying the given [transform] function + * to each element and its index in the original array. + * @param [transform] function that takes the index of an element and the element itself + * and returns the result of the transform applied to the element. + */ +public header inline fun IntArray.mapIndexed(transform: (Int, Int) -> R): List + +/** + * Returns a list containing the results of applying the given [transform] function + * to each element and its index in the original array. + * @param [transform] function that takes the index of an element and the element itself + * and returns the result of the transform applied to the element. + */ +public header inline fun LongArray.mapIndexed(transform: (Int, Long) -> R): List + +/** + * Returns a list containing the results of applying the given [transform] function + * to each element and its index in the original array. + * @param [transform] function that takes the index of an element and the element itself + * and returns the result of the transform applied to the element. + */ +public header inline fun FloatArray.mapIndexed(transform: (Int, Float) -> R): List + +/** + * Returns a list containing the results of applying the given [transform] function + * to each element and its index in the original array. + * @param [transform] function that takes the index of an element and the element itself + * and returns the result of the transform applied to the element. + */ +public header inline fun DoubleArray.mapIndexed(transform: (Int, Double) -> R): List + +/** + * Returns a list containing the results of applying the given [transform] function + * to each element and its index in the original array. + * @param [transform] function that takes the index of an element and the element itself + * and returns the result of the transform applied to the element. + */ +public header inline fun BooleanArray.mapIndexed(transform: (Int, Boolean) -> R): List + +/** + * Returns a list containing the results of applying the given [transform] function + * to each element and its index in the original array. + * @param [transform] function that takes the index of an element and the element itself + * and returns the result of the transform applied to the element. + */ +public header inline fun CharArray.mapIndexed(transform: (Int, Char) -> R): List + +/** + * Returns a list containing only the non-null results of applying the given [transform] function + * to each element and its index in the original array. + * @param [transform] function that takes the index of an element and the element itself + * and returns the result of the transform applied to the element. + */ +public header inline fun Array.mapIndexedNotNull(transform: (Int, T) -> R?): List + +/** + * Applies the given [transform] function to each element and its index in the original array + * and appends only the non-null results to the given [destination]. + * @param [transform] function that takes the index of an element and the element itself + * and returns the result of the transform applied to the element. + */ +public header inline fun > Array.mapIndexedNotNullTo(destination: C, transform: (Int, T) -> R?): C + +/** + * Applies the given [transform] function to each element and its index in the original array + * and appends the results to the given [destination]. + * @param [transform] function that takes the index of an element and the element itself + * and returns the result of the transform applied to the element. + */ +public header inline fun > Array.mapIndexedTo(destination: C, transform: (Int, T) -> R): C + +/** + * Applies the given [transform] function to each element and its index in the original array + * and appends the results to the given [destination]. + * @param [transform] function that takes the index of an element and the element itself + * and returns the result of the transform applied to the element. + */ +public header inline fun > ByteArray.mapIndexedTo(destination: C, transform: (Int, Byte) -> R): C + +/** + * Applies the given [transform] function to each element and its index in the original array + * and appends the results to the given [destination]. + * @param [transform] function that takes the index of an element and the element itself + * and returns the result of the transform applied to the element. + */ +public header inline fun > ShortArray.mapIndexedTo(destination: C, transform: (Int, Short) -> R): C + +/** + * Applies the given [transform] function to each element and its index in the original array + * and appends the results to the given [destination]. + * @param [transform] function that takes the index of an element and the element itself + * and returns the result of the transform applied to the element. + */ +public header inline fun > IntArray.mapIndexedTo(destination: C, transform: (Int, Int) -> R): C + +/** + * Applies the given [transform] function to each element and its index in the original array + * and appends the results to the given [destination]. + * @param [transform] function that takes the index of an element and the element itself + * and returns the result of the transform applied to the element. + */ +public header inline fun > LongArray.mapIndexedTo(destination: C, transform: (Int, Long) -> R): C + +/** + * Applies the given [transform] function to each element and its index in the original array + * and appends the results to the given [destination]. + * @param [transform] function that takes the index of an element and the element itself + * and returns the result of the transform applied to the element. + */ +public header inline fun > FloatArray.mapIndexedTo(destination: C, transform: (Int, Float) -> R): C + +/** + * Applies the given [transform] function to each element and its index in the original array + * and appends the results to the given [destination]. + * @param [transform] function that takes the index of an element and the element itself + * and returns the result of the transform applied to the element. + */ +public header inline fun > DoubleArray.mapIndexedTo(destination: C, transform: (Int, Double) -> R): C + +/** + * Applies the given [transform] function to each element and its index in the original array + * and appends the results to the given [destination]. + * @param [transform] function that takes the index of an element and the element itself + * and returns the result of the transform applied to the element. + */ +public header inline fun > BooleanArray.mapIndexedTo(destination: C, transform: (Int, Boolean) -> R): C + +/** + * Applies the given [transform] function to each element and its index in the original array + * and appends the results to the given [destination]. + * @param [transform] function that takes the index of an element and the element itself + * and returns the result of the transform applied to the element. + */ +public header inline fun > CharArray.mapIndexedTo(destination: C, transform: (Int, Char) -> R): C + +/** + * Returns a list containing only the non-null results of applying the given [transform] function + * to each element in the original array. + */ +public header inline fun Array.mapNotNull(transform: (T) -> R?): List + +/** + * Applies the given [transform] function to each element in the original array + * and appends only the non-null results to the given [destination]. + */ +public header inline fun > Array.mapNotNullTo(destination: C, transform: (T) -> R?): C + +/** + * Applies the given [transform] function to each element of the original array + * and appends the results to the given [destination]. + */ +public header inline fun > Array.mapTo(destination: C, transform: (T) -> R): C + +/** + * Applies the given [transform] function to each element of the original array + * and appends the results to the given [destination]. + */ +public header inline fun > ByteArray.mapTo(destination: C, transform: (Byte) -> R): C + +/** + * Applies the given [transform] function to each element of the original array + * and appends the results to the given [destination]. + */ +public header inline fun > ShortArray.mapTo(destination: C, transform: (Short) -> R): C + +/** + * Applies the given [transform] function to each element of the original array + * and appends the results to the given [destination]. + */ +public header inline fun > IntArray.mapTo(destination: C, transform: (Int) -> R): C + +/** + * Applies the given [transform] function to each element of the original array + * and appends the results to the given [destination]. + */ +public header inline fun > LongArray.mapTo(destination: C, transform: (Long) -> R): C + +/** + * Applies the given [transform] function to each element of the original array + * and appends the results to the given [destination]. + */ +public header inline fun > FloatArray.mapTo(destination: C, transform: (Float) -> R): C + +/** + * Applies the given [transform] function to each element of the original array + * and appends the results to the given [destination]. + */ +public header inline fun > DoubleArray.mapTo(destination: C, transform: (Double) -> R): C + +/** + * Applies the given [transform] function to each element of the original array + * and appends the results to the given [destination]. + */ +public header inline fun > BooleanArray.mapTo(destination: C, transform: (Boolean) -> R): C + +/** + * Applies the given [transform] function to each element of the original array + * and appends the results to the given [destination]. + */ +public header inline fun > CharArray.mapTo(destination: C, transform: (Char) -> R): C + +/** + * Returns a lazy [Iterable] of [IndexedValue] for each element of the original array. + */ +public header fun Array.withIndex(): Iterable> + +/** + * Returns a lazy [Iterable] of [IndexedValue] for each element of the original array. + */ +public header fun ByteArray.withIndex(): Iterable> + +/** + * Returns a lazy [Iterable] of [IndexedValue] for each element of the original array. + */ +public header fun ShortArray.withIndex(): Iterable> + +/** + * Returns a lazy [Iterable] of [IndexedValue] for each element of the original array. + */ +public header fun IntArray.withIndex(): Iterable> + +/** + * Returns a lazy [Iterable] of [IndexedValue] for each element of the original array. + */ +public header fun LongArray.withIndex(): Iterable> + +/** + * Returns a lazy [Iterable] of [IndexedValue] for each element of the original array. + */ +public header fun FloatArray.withIndex(): Iterable> + +/** + * Returns a lazy [Iterable] of [IndexedValue] for each element of the original array. + */ +public header fun DoubleArray.withIndex(): Iterable> + +/** + * Returns a lazy [Iterable] of [IndexedValue] for each element of the original array. + */ +public header fun BooleanArray.withIndex(): Iterable> + +/** + * Returns a lazy [Iterable] of [IndexedValue] for each element of the original array. + */ +public header fun CharArray.withIndex(): Iterable> + +/** + * Returns a list containing only distinct elements from the given array. + * + * The elements in the resulting list are in the same order as they were in the source array. + */ +public header fun Array.distinct(): List + +/** + * Returns a list containing only distinct elements from the given array. + * + * The elements in the resulting list are in the same order as they were in the source array. + */ +public header fun ByteArray.distinct(): List + +/** + * Returns a list containing only distinct elements from the given array. + * + * The elements in the resulting list are in the same order as they were in the source array. + */ +public header fun ShortArray.distinct(): List + +/** + * Returns a list containing only distinct elements from the given array. + * + * The elements in the resulting list are in the same order as they were in the source array. + */ +public header fun IntArray.distinct(): List + +/** + * Returns a list containing only distinct elements from the given array. + * + * The elements in the resulting list are in the same order as they were in the source array. + */ +public header fun LongArray.distinct(): List + +/** + * Returns a list containing only distinct elements from the given array. + * + * The elements in the resulting list are in the same order as they were in the source array. + */ +public header fun FloatArray.distinct(): List + +/** + * Returns a list containing only distinct elements from the given array. + * + * The elements in the resulting list are in the same order as they were in the source array. + */ +public header fun DoubleArray.distinct(): List + +/** + * Returns a list containing only distinct elements from the given array. + * + * The elements in the resulting list are in the same order as they were in the source array. + */ +public header fun BooleanArray.distinct(): List + +/** + * Returns a list containing only distinct elements from the given array. + * + * The elements in the resulting list are in the same order as they were in the source array. + */ +public header fun CharArray.distinct(): List + +/** + * Returns a list containing only elements from the given array + * having distinct keys returned by the given [selector] function. + * + * The elements in the resulting list are in the same order as they were in the source array. + */ +public header inline fun Array.distinctBy(selector: (T) -> K): List + +/** + * Returns a list containing only elements from the given array + * having distinct keys returned by the given [selector] function. + * + * The elements in the resulting list are in the same order as they were in the source array. + */ +public header inline fun ByteArray.distinctBy(selector: (Byte) -> K): List + +/** + * Returns a list containing only elements from the given array + * having distinct keys returned by the given [selector] function. + * + * The elements in the resulting list are in the same order as they were in the source array. + */ +public header inline fun ShortArray.distinctBy(selector: (Short) -> K): List + +/** + * Returns a list containing only elements from the given array + * having distinct keys returned by the given [selector] function. + * + * The elements in the resulting list are in the same order as they were in the source array. + */ +public header inline fun IntArray.distinctBy(selector: (Int) -> K): List + +/** + * Returns a list containing only elements from the given array + * having distinct keys returned by the given [selector] function. + * + * The elements in the resulting list are in the same order as they were in the source array. + */ +public header inline fun LongArray.distinctBy(selector: (Long) -> K): List + +/** + * Returns a list containing only elements from the given array + * having distinct keys returned by the given [selector] function. + * + * The elements in the resulting list are in the same order as they were in the source array. + */ +public header inline fun FloatArray.distinctBy(selector: (Float) -> K): List + +/** + * Returns a list containing only elements from the given array + * having distinct keys returned by the given [selector] function. + * + * The elements in the resulting list are in the same order as they were in the source array. + */ +public header inline fun DoubleArray.distinctBy(selector: (Double) -> K): List + +/** + * Returns a list containing only elements from the given array + * having distinct keys returned by the given [selector] function. + * + * The elements in the resulting list are in the same order as they were in the source array. + */ +public header inline fun BooleanArray.distinctBy(selector: (Boolean) -> K): List + +/** + * Returns a list containing only elements from the given array + * having distinct keys returned by the given [selector] function. + * + * The elements in the resulting list are in the same order as they were in the source array. + */ +public header inline fun CharArray.distinctBy(selector: (Char) -> K): List + +/** + * Returns a set containing all elements that are contained by both this set and the specified collection. + * + * The returned set preserves the element iteration order of the original array. + */ +public header infix fun Array.intersect(other: Iterable): Set + +/** + * Returns a set containing all elements that are contained by both this set and the specified collection. + * + * The returned set preserves the element iteration order of the original array. + */ +public header infix fun ByteArray.intersect(other: Iterable): Set + +/** + * Returns a set containing all elements that are contained by both this set and the specified collection. + * + * The returned set preserves the element iteration order of the original array. + */ +public header infix fun ShortArray.intersect(other: Iterable): Set + +/** + * Returns a set containing all elements that are contained by both this set and the specified collection. + * + * The returned set preserves the element iteration order of the original array. + */ +public header infix fun IntArray.intersect(other: Iterable): Set + +/** + * Returns a set containing all elements that are contained by both this set and the specified collection. + * + * The returned set preserves the element iteration order of the original array. + */ +public header infix fun LongArray.intersect(other: Iterable): Set + +/** + * Returns a set containing all elements that are contained by both this set and the specified collection. + * + * The returned set preserves the element iteration order of the original array. + */ +public header infix fun FloatArray.intersect(other: Iterable): Set + +/** + * Returns a set containing all elements that are contained by both this set and the specified collection. + * + * The returned set preserves the element iteration order of the original array. + */ +public header infix fun DoubleArray.intersect(other: Iterable): Set + +/** + * Returns a set containing all elements that are contained by both this set and the specified collection. + * + * The returned set preserves the element iteration order of the original array. + */ +public header infix fun BooleanArray.intersect(other: Iterable): Set + +/** + * Returns a set containing all elements that are contained by both this set and the specified collection. + * + * The returned set preserves the element iteration order of the original array. + */ +public header infix fun CharArray.intersect(other: Iterable): Set + +/** + * Returns a set containing all elements that are contained by this array and not contained by the specified collection. + * + * The returned set preserves the element iteration order of the original array. + */ +public header infix fun Array.subtract(other: Iterable): Set + +/** + * Returns a set containing all elements that are contained by this array and not contained by the specified collection. + * + * The returned set preserves the element iteration order of the original array. + */ +public header infix fun ByteArray.subtract(other: Iterable): Set + +/** + * Returns a set containing all elements that are contained by this array and not contained by the specified collection. + * + * The returned set preserves the element iteration order of the original array. + */ +public header infix fun ShortArray.subtract(other: Iterable): Set + +/** + * Returns a set containing all elements that are contained by this array and not contained by the specified collection. + * + * The returned set preserves the element iteration order of the original array. + */ +public header infix fun IntArray.subtract(other: Iterable): Set + +/** + * Returns a set containing all elements that are contained by this array and not contained by the specified collection. + * + * The returned set preserves the element iteration order of the original array. + */ +public header infix fun LongArray.subtract(other: Iterable): Set + +/** + * Returns a set containing all elements that are contained by this array and not contained by the specified collection. + * + * The returned set preserves the element iteration order of the original array. + */ +public header infix fun FloatArray.subtract(other: Iterable): Set + +/** + * Returns a set containing all elements that are contained by this array and not contained by the specified collection. + * + * The returned set preserves the element iteration order of the original array. + */ +public header infix fun DoubleArray.subtract(other: Iterable): Set + +/** + * Returns a set containing all elements that are contained by this array and not contained by the specified collection. + * + * The returned set preserves the element iteration order of the original array. + */ +public header infix fun BooleanArray.subtract(other: Iterable): Set + +/** + * Returns a set containing all elements that are contained by this array and not contained by the specified collection. + * + * The returned set preserves the element iteration order of the original array. + */ +public header infix fun CharArray.subtract(other: Iterable): Set + +/** + * Returns a mutable set containing all distinct elements from the given array. + * + * The returned set preserves the element iteration order of the original array. + */ +public header fun Array.toMutableSet(): MutableSet + +/** + * Returns a mutable set containing all distinct elements from the given array. + * + * The returned set preserves the element iteration order of the original array. + */ +public header fun ByteArray.toMutableSet(): MutableSet + +/** + * Returns a mutable set containing all distinct elements from the given array. + * + * The returned set preserves the element iteration order of the original array. + */ +public header fun ShortArray.toMutableSet(): MutableSet + +/** + * Returns a mutable set containing all distinct elements from the given array. + * + * The returned set preserves the element iteration order of the original array. + */ +public header fun IntArray.toMutableSet(): MutableSet + +/** + * Returns a mutable set containing all distinct elements from the given array. + * + * The returned set preserves the element iteration order of the original array. + */ +public header fun LongArray.toMutableSet(): MutableSet + +/** + * Returns a mutable set containing all distinct elements from the given array. + * + * The returned set preserves the element iteration order of the original array. + */ +public header fun FloatArray.toMutableSet(): MutableSet + +/** + * Returns a mutable set containing all distinct elements from the given array. + * + * The returned set preserves the element iteration order of the original array. + */ +public header fun DoubleArray.toMutableSet(): MutableSet + +/** + * Returns a mutable set containing all distinct elements from the given array. + * + * The returned set preserves the element iteration order of the original array. + */ +public header fun BooleanArray.toMutableSet(): MutableSet + +/** + * Returns a mutable set containing all distinct elements from the given array. + * + * The returned set preserves the element iteration order of the original array. + */ +public header fun CharArray.toMutableSet(): MutableSet + +/** + * Returns a set containing all distinct elements from both collections. + * + * The returned set preserves the element iteration order of the original array. + * Those elements of the [other] collection that are unique are iterated in the end + * in the order of the [other] collection. + */ +public header infix fun Array.union(other: Iterable): Set + +/** + * Returns a set containing all distinct elements from both collections. + * + * The returned set preserves the element iteration order of the original array. + * Those elements of the [other] collection that are unique are iterated in the end + * in the order of the [other] collection. + */ +public header infix fun ByteArray.union(other: Iterable): Set + +/** + * Returns a set containing all distinct elements from both collections. + * + * The returned set preserves the element iteration order of the original array. + * Those elements of the [other] collection that are unique are iterated in the end + * in the order of the [other] collection. + */ +public header infix fun ShortArray.union(other: Iterable): Set + +/** + * Returns a set containing all distinct elements from both collections. + * + * The returned set preserves the element iteration order of the original array. + * Those elements of the [other] collection that are unique are iterated in the end + * in the order of the [other] collection. + */ +public header infix fun IntArray.union(other: Iterable): Set + +/** + * Returns a set containing all distinct elements from both collections. + * + * The returned set preserves the element iteration order of the original array. + * Those elements of the [other] collection that are unique are iterated in the end + * in the order of the [other] collection. + */ +public header infix fun LongArray.union(other: Iterable): Set + +/** + * Returns a set containing all distinct elements from both collections. + * + * The returned set preserves the element iteration order of the original array. + * Those elements of the [other] collection that are unique are iterated in the end + * in the order of the [other] collection. + */ +public header infix fun FloatArray.union(other: Iterable): Set + +/** + * Returns a set containing all distinct elements from both collections. + * + * The returned set preserves the element iteration order of the original array. + * Those elements of the [other] collection that are unique are iterated in the end + * in the order of the [other] collection. + */ +public header infix fun DoubleArray.union(other: Iterable): Set + +/** + * Returns a set containing all distinct elements from both collections. + * + * The returned set preserves the element iteration order of the original array. + * Those elements of the [other] collection that are unique are iterated in the end + * in the order of the [other] collection. + */ +public header infix fun BooleanArray.union(other: Iterable): Set + +/** + * Returns a set containing all distinct elements from both collections. + * + * The returned set preserves the element iteration order of the original array. + * Those elements of the [other] collection that are unique are iterated in the end + * in the order of the [other] collection. + */ +public header infix fun CharArray.union(other: Iterable): Set + +/** + * Returns `true` if all elements match the given [predicate]. + */ +public header inline fun Array.all(predicate: (T) -> Boolean): Boolean + +/** + * Returns `true` if all elements match the given [predicate]. + */ +public header inline fun ByteArray.all(predicate: (Byte) -> Boolean): Boolean + +/** + * Returns `true` if all elements match the given [predicate]. + */ +public header inline fun ShortArray.all(predicate: (Short) -> Boolean): Boolean + +/** + * Returns `true` if all elements match the given [predicate]. + */ +public header inline fun IntArray.all(predicate: (Int) -> Boolean): Boolean + +/** + * Returns `true` if all elements match the given [predicate]. + */ +public header inline fun LongArray.all(predicate: (Long) -> Boolean): Boolean + +/** + * Returns `true` if all elements match the given [predicate]. + */ +public header inline fun FloatArray.all(predicate: (Float) -> Boolean): Boolean + +/** + * Returns `true` if all elements match the given [predicate]. + */ +public header inline fun DoubleArray.all(predicate: (Double) -> Boolean): Boolean + +/** + * Returns `true` if all elements match the given [predicate]. + */ +public header inline fun BooleanArray.all(predicate: (Boolean) -> Boolean): Boolean + +/** + * Returns `true` if all elements match the given [predicate]. + */ +public header inline fun CharArray.all(predicate: (Char) -> Boolean): Boolean + +/** + * Returns `true` if array has at least one element. + */ +public header fun Array.any(): Boolean + +/** + * Returns `true` if array has at least one element. + */ +public header fun ByteArray.any(): Boolean + +/** + * Returns `true` if array has at least one element. + */ +public header fun ShortArray.any(): Boolean + +/** + * Returns `true` if array has at least one element. + */ +public header fun IntArray.any(): Boolean + +/** + * Returns `true` if array has at least one element. + */ +public header fun LongArray.any(): Boolean + +/** + * Returns `true` if array has at least one element. + */ +public header fun FloatArray.any(): Boolean + +/** + * Returns `true` if array has at least one element. + */ +public header fun DoubleArray.any(): Boolean + +/** + * Returns `true` if array has at least one element. + */ +public header fun BooleanArray.any(): Boolean + +/** + * Returns `true` if array has at least one element. + */ +public header fun CharArray.any(): Boolean + +/** + * Returns `true` if at least one element matches the given [predicate]. + */ +public header inline fun Array.any(predicate: (T) -> Boolean): Boolean + +/** + * Returns `true` if at least one element matches the given [predicate]. + */ +public header inline fun ByteArray.any(predicate: (Byte) -> Boolean): Boolean + +/** + * Returns `true` if at least one element matches the given [predicate]. + */ +public header inline fun ShortArray.any(predicate: (Short) -> Boolean): Boolean + +/** + * Returns `true` if at least one element matches the given [predicate]. + */ +public header inline fun IntArray.any(predicate: (Int) -> Boolean): Boolean + +/** + * Returns `true` if at least one element matches the given [predicate]. + */ +public header inline fun LongArray.any(predicate: (Long) -> Boolean): Boolean + +/** + * Returns `true` if at least one element matches the given [predicate]. + */ +public header inline fun FloatArray.any(predicate: (Float) -> Boolean): Boolean + +/** + * Returns `true` if at least one element matches the given [predicate]. + */ +public header inline fun DoubleArray.any(predicate: (Double) -> Boolean): Boolean + +/** + * Returns `true` if at least one element matches the given [predicate]. + */ +public header inline fun BooleanArray.any(predicate: (Boolean) -> Boolean): Boolean + +/** + * Returns `true` if at least one element matches the given [predicate]. + */ +public header inline fun CharArray.any(predicate: (Char) -> Boolean): Boolean + +/** + * Returns the number of elements in this array. + */ +@kotlin.internal.InlineOnly +public header inline fun Array.count(): Int + +/** + * Returns the number of elements in this array. + */ +@kotlin.internal.InlineOnly +public header inline fun ByteArray.count(): Int + +/** + * Returns the number of elements in this array. + */ +@kotlin.internal.InlineOnly +public header inline fun ShortArray.count(): Int + +/** + * Returns the number of elements in this array. + */ +@kotlin.internal.InlineOnly +public header inline fun IntArray.count(): Int + +/** + * Returns the number of elements in this array. + */ +@kotlin.internal.InlineOnly +public header inline fun LongArray.count(): Int + +/** + * Returns the number of elements in this array. + */ +@kotlin.internal.InlineOnly +public header inline fun FloatArray.count(): Int + +/** + * Returns the number of elements in this array. + */ +@kotlin.internal.InlineOnly +public header inline fun DoubleArray.count(): Int + +/** + * Returns the number of elements in this array. + */ +@kotlin.internal.InlineOnly +public header inline fun BooleanArray.count(): Int + +/** + * Returns the number of elements in this array. + */ +@kotlin.internal.InlineOnly +public header inline fun CharArray.count(): Int + +/** + * Returns the number of elements matching the given [predicate]. + */ +public header inline fun Array.count(predicate: (T) -> Boolean): Int + +/** + * Returns the number of elements matching the given [predicate]. + */ +public header inline fun ByteArray.count(predicate: (Byte) -> Boolean): Int + +/** + * Returns the number of elements matching the given [predicate]. + */ +public header inline fun ShortArray.count(predicate: (Short) -> Boolean): Int + +/** + * Returns the number of elements matching the given [predicate]. + */ +public header inline fun IntArray.count(predicate: (Int) -> Boolean): Int + +/** + * Returns the number of elements matching the given [predicate]. + */ +public header inline fun LongArray.count(predicate: (Long) -> Boolean): Int + +/** + * Returns the number of elements matching the given [predicate]. + */ +public header inline fun FloatArray.count(predicate: (Float) -> Boolean): Int + +/** + * Returns the number of elements matching the given [predicate]. + */ +public header inline fun DoubleArray.count(predicate: (Double) -> Boolean): Int + +/** + * Returns the number of elements matching the given [predicate]. + */ +public header inline fun BooleanArray.count(predicate: (Boolean) -> Boolean): Int + +/** + * Returns the number of elements matching the given [predicate]. + */ +public header inline fun CharArray.count(predicate: (Char) -> Boolean): Int + +/** + * Accumulates value starting with [initial] value and applying [operation] from left to right to current accumulator value and each element. + */ +public header inline fun Array.fold(initial: R, operation: (R, T) -> R): R + +/** + * Accumulates value starting with [initial] value and applying [operation] from left to right to current accumulator value and each element. + */ +public header inline fun ByteArray.fold(initial: R, operation: (R, Byte) -> R): R + +/** + * Accumulates value starting with [initial] value and applying [operation] from left to right to current accumulator value and each element. + */ +public header inline fun ShortArray.fold(initial: R, operation: (R, Short) -> R): R + +/** + * Accumulates value starting with [initial] value and applying [operation] from left to right to current accumulator value and each element. + */ +public header inline fun IntArray.fold(initial: R, operation: (R, Int) -> R): R + +/** + * Accumulates value starting with [initial] value and applying [operation] from left to right to current accumulator value and each element. + */ +public header inline fun LongArray.fold(initial: R, operation: (R, Long) -> R): R + +/** + * Accumulates value starting with [initial] value and applying [operation] from left to right to current accumulator value and each element. + */ +public header inline fun FloatArray.fold(initial: R, operation: (R, Float) -> R): R + +/** + * Accumulates value starting with [initial] value and applying [operation] from left to right to current accumulator value and each element. + */ +public header inline fun DoubleArray.fold(initial: R, operation: (R, Double) -> R): R + +/** + * Accumulates value starting with [initial] value and applying [operation] from left to right to current accumulator value and each element. + */ +public header inline fun BooleanArray.fold(initial: R, operation: (R, Boolean) -> R): R + +/** + * Accumulates value starting with [initial] value and applying [operation] from left to right to current accumulator value and each element. + */ +public header inline fun CharArray.fold(initial: R, operation: (R, Char) -> R): R + +/** + * Accumulates value starting with [initial] value and applying [operation] from left to right + * to current accumulator value and each element with its index in the original array. + * @param [operation] function that takes the index of an element, current accumulator value + * and the element itself, and calculates the next accumulator value. + */ +public header inline fun Array.foldIndexed(initial: R, operation: (Int, R, T) -> R): R + +/** + * Accumulates value starting with [initial] value and applying [operation] from left to right + * to current accumulator value and each element with its index in the original array. + * @param [operation] function that takes the index of an element, current accumulator value + * and the element itself, and calculates the next accumulator value. + */ +public header inline fun ByteArray.foldIndexed(initial: R, operation: (Int, R, Byte) -> R): R + +/** + * Accumulates value starting with [initial] value and applying [operation] from left to right + * to current accumulator value and each element with its index in the original array. + * @param [operation] function that takes the index of an element, current accumulator value + * and the element itself, and calculates the next accumulator value. + */ +public header inline fun ShortArray.foldIndexed(initial: R, operation: (Int, R, Short) -> R): R + +/** + * Accumulates value starting with [initial] value and applying [operation] from left to right + * to current accumulator value and each element with its index in the original array. + * @param [operation] function that takes the index of an element, current accumulator value + * and the element itself, and calculates the next accumulator value. + */ +public header inline fun IntArray.foldIndexed(initial: R, operation: (Int, R, Int) -> R): R + +/** + * Accumulates value starting with [initial] value and applying [operation] from left to right + * to current accumulator value and each element with its index in the original array. + * @param [operation] function that takes the index of an element, current accumulator value + * and the element itself, and calculates the next accumulator value. + */ +public header inline fun LongArray.foldIndexed(initial: R, operation: (Int, R, Long) -> R): R + +/** + * Accumulates value starting with [initial] value and applying [operation] from left to right + * to current accumulator value and each element with its index in the original array. + * @param [operation] function that takes the index of an element, current accumulator value + * and the element itself, and calculates the next accumulator value. + */ +public header inline fun FloatArray.foldIndexed(initial: R, operation: (Int, R, Float) -> R): R + +/** + * Accumulates value starting with [initial] value and applying [operation] from left to right + * to current accumulator value and each element with its index in the original array. + * @param [operation] function that takes the index of an element, current accumulator value + * and the element itself, and calculates the next accumulator value. + */ +public header inline fun DoubleArray.foldIndexed(initial: R, operation: (Int, R, Double) -> R): R + +/** + * Accumulates value starting with [initial] value and applying [operation] from left to right + * to current accumulator value and each element with its index in the original array. + * @param [operation] function that takes the index of an element, current accumulator value + * and the element itself, and calculates the next accumulator value. + */ +public header inline fun BooleanArray.foldIndexed(initial: R, operation: (Int, R, Boolean) -> R): R + +/** + * Accumulates value starting with [initial] value and applying [operation] from left to right + * to current accumulator value and each element with its index in the original array. + * @param [operation] function that takes the index of an element, current accumulator value + * and the element itself, and calculates the next accumulator value. + */ +public header inline fun CharArray.foldIndexed(initial: R, operation: (Int, R, Char) -> R): R + +/** + * Accumulates value starting with [initial] value and applying [operation] from right to left to each element and current accumulator value. + */ +public header inline fun Array.foldRight(initial: R, operation: (T, R) -> R): R + +/** + * Accumulates value starting with [initial] value and applying [operation] from right to left to each element and current accumulator value. + */ +public header inline fun ByteArray.foldRight(initial: R, operation: (Byte, R) -> R): R + +/** + * Accumulates value starting with [initial] value and applying [operation] from right to left to each element and current accumulator value. + */ +public header inline fun ShortArray.foldRight(initial: R, operation: (Short, R) -> R): R + +/** + * Accumulates value starting with [initial] value and applying [operation] from right to left to each element and current accumulator value. + */ +public header inline fun IntArray.foldRight(initial: R, operation: (Int, R) -> R): R + +/** + * Accumulates value starting with [initial] value and applying [operation] from right to left to each element and current accumulator value. + */ +public header inline fun LongArray.foldRight(initial: R, operation: (Long, R) -> R): R + +/** + * Accumulates value starting with [initial] value and applying [operation] from right to left to each element and current accumulator value. + */ +public header inline fun FloatArray.foldRight(initial: R, operation: (Float, R) -> R): R + +/** + * Accumulates value starting with [initial] value and applying [operation] from right to left to each element and current accumulator value. + */ +public header inline fun DoubleArray.foldRight(initial: R, operation: (Double, R) -> R): R + +/** + * Accumulates value starting with [initial] value and applying [operation] from right to left to each element and current accumulator value. + */ +public header inline fun BooleanArray.foldRight(initial: R, operation: (Boolean, R) -> R): R + +/** + * Accumulates value starting with [initial] value and applying [operation] from right to left to each element and current accumulator value. + */ +public header inline fun CharArray.foldRight(initial: R, operation: (Char, R) -> R): R + +/** + * Accumulates value starting with [initial] value and applying [operation] from right to left + * to each element with its index in the original array and current accumulator value. + * @param [operation] function that takes the index of an element, the element itself + * and current accumulator value, and calculates the next accumulator value. + */ +public header inline fun Array.foldRightIndexed(initial: R, operation: (Int, T, R) -> R): R + +/** + * Accumulates value starting with [initial] value and applying [operation] from right to left + * to each element with its index in the original array and current accumulator value. + * @param [operation] function that takes the index of an element, the element itself + * and current accumulator value, and calculates the next accumulator value. + */ +public header inline fun ByteArray.foldRightIndexed(initial: R, operation: (Int, Byte, R) -> R): R + +/** + * Accumulates value starting with [initial] value and applying [operation] from right to left + * to each element with its index in the original array and current accumulator value. + * @param [operation] function that takes the index of an element, the element itself + * and current accumulator value, and calculates the next accumulator value. + */ +public header inline fun ShortArray.foldRightIndexed(initial: R, operation: (Int, Short, R) -> R): R + +/** + * Accumulates value starting with [initial] value and applying [operation] from right to left + * to each element with its index in the original array and current accumulator value. + * @param [operation] function that takes the index of an element, the element itself + * and current accumulator value, and calculates the next accumulator value. + */ +public header inline fun IntArray.foldRightIndexed(initial: R, operation: (Int, Int, R) -> R): R + +/** + * Accumulates value starting with [initial] value and applying [operation] from right to left + * to each element with its index in the original array and current accumulator value. + * @param [operation] function that takes the index of an element, the element itself + * and current accumulator value, and calculates the next accumulator value. + */ +public header inline fun LongArray.foldRightIndexed(initial: R, operation: (Int, Long, R) -> R): R + +/** + * Accumulates value starting with [initial] value and applying [operation] from right to left + * to each element with its index in the original array and current accumulator value. + * @param [operation] function that takes the index of an element, the element itself + * and current accumulator value, and calculates the next accumulator value. + */ +public header inline fun FloatArray.foldRightIndexed(initial: R, operation: (Int, Float, R) -> R): R + +/** + * Accumulates value starting with [initial] value and applying [operation] from right to left + * to each element with its index in the original array and current accumulator value. + * @param [operation] function that takes the index of an element, the element itself + * and current accumulator value, and calculates the next accumulator value. + */ +public header inline fun DoubleArray.foldRightIndexed(initial: R, operation: (Int, Double, R) -> R): R + +/** + * Accumulates value starting with [initial] value and applying [operation] from right to left + * to each element with its index in the original array and current accumulator value. + * @param [operation] function that takes the index of an element, the element itself + * and current accumulator value, and calculates the next accumulator value. + */ +public header inline fun BooleanArray.foldRightIndexed(initial: R, operation: (Int, Boolean, R) -> R): R + +/** + * Accumulates value starting with [initial] value and applying [operation] from right to left + * to each element with its index in the original array and current accumulator value. + * @param [operation] function that takes the index of an element, the element itself + * and current accumulator value, and calculates the next accumulator value. + */ +public header inline fun CharArray.foldRightIndexed(initial: R, operation: (Int, Char, R) -> R): R + +/** + * Performs the given [action] on each element. + */ +public header inline fun Array.forEach(action: (T) -> Unit): Unit + +/** + * Performs the given [action] on each element. + */ +public header inline fun ByteArray.forEach(action: (Byte) -> Unit): Unit + +/** + * Performs the given [action] on each element. + */ +public header inline fun ShortArray.forEach(action: (Short) -> Unit): Unit + +/** + * Performs the given [action] on each element. + */ +public header inline fun IntArray.forEach(action: (Int) -> Unit): Unit + +/** + * Performs the given [action] on each element. + */ +public header inline fun LongArray.forEach(action: (Long) -> Unit): Unit + +/** + * Performs the given [action] on each element. + */ +public header inline fun FloatArray.forEach(action: (Float) -> Unit): Unit + +/** + * Performs the given [action] on each element. + */ +public header inline fun DoubleArray.forEach(action: (Double) -> Unit): Unit + +/** + * Performs the given [action] on each element. + */ +public header inline fun BooleanArray.forEach(action: (Boolean) -> Unit): Unit + +/** + * Performs the given [action] on each element. + */ +public header inline fun CharArray.forEach(action: (Char) -> Unit): Unit + +/** + * Performs the given [action] on each element, providing sequential index with the element. + * @param [action] function that takes the index of an element and the element itself + * and performs the desired action on the element. + */ +public header inline fun Array.forEachIndexed(action: (Int, T) -> Unit): Unit + +/** + * Performs the given [action] on each element, providing sequential index with the element. + * @param [action] function that takes the index of an element and the element itself + * and performs the desired action on the element. + */ +public header inline fun ByteArray.forEachIndexed(action: (Int, Byte) -> Unit): Unit + +/** + * Performs the given [action] on each element, providing sequential index with the element. + * @param [action] function that takes the index of an element and the element itself + * and performs the desired action on the element. + */ +public header inline fun ShortArray.forEachIndexed(action: (Int, Short) -> Unit): Unit + +/** + * Performs the given [action] on each element, providing sequential index with the element. + * @param [action] function that takes the index of an element and the element itself + * and performs the desired action on the element. + */ +public header inline fun IntArray.forEachIndexed(action: (Int, Int) -> Unit): Unit + +/** + * Performs the given [action] on each element, providing sequential index with the element. + * @param [action] function that takes the index of an element and the element itself + * and performs the desired action on the element. + */ +public header inline fun LongArray.forEachIndexed(action: (Int, Long) -> Unit): Unit + +/** + * Performs the given [action] on each element, providing sequential index with the element. + * @param [action] function that takes the index of an element and the element itself + * and performs the desired action on the element. + */ +public header inline fun FloatArray.forEachIndexed(action: (Int, Float) -> Unit): Unit + +/** + * Performs the given [action] on each element, providing sequential index with the element. + * @param [action] function that takes the index of an element and the element itself + * and performs the desired action on the element. + */ +public header inline fun DoubleArray.forEachIndexed(action: (Int, Double) -> Unit): Unit + +/** + * Performs the given [action] on each element, providing sequential index with the element. + * @param [action] function that takes the index of an element and the element itself + * and performs the desired action on the element. + */ +public header inline fun BooleanArray.forEachIndexed(action: (Int, Boolean) -> Unit): Unit + +/** + * Performs the given [action] on each element, providing sequential index with the element. + * @param [action] function that takes the index of an element and the element itself + * and performs the desired action on the element. + */ +public header inline fun CharArray.forEachIndexed(action: (Int, Char) -> Unit): Unit + +/** + * Returns the largest element or `null` if there are no elements. + */ +public header fun > Array.max(): T? + +/** + * Returns the largest element or `null` if there are no elements. + */ +public header fun ByteArray.max(): Byte? + +/** + * Returns the largest element or `null` if there are no elements. + */ +public header fun ShortArray.max(): Short? + +/** + * Returns the largest element or `null` if there are no elements. + */ +public header fun IntArray.max(): Int? + +/** + * Returns the largest element or `null` if there are no elements. + */ +public header fun LongArray.max(): Long? + +/** + * Returns the largest element or `null` if there are no elements. + */ +public header fun FloatArray.max(): Float? + +/** + * Returns the largest element or `null` if there are no elements. + */ +public header fun DoubleArray.max(): Double? + +/** + * Returns the largest element or `null` if there are no elements. + */ +public header fun CharArray.max(): Char? + +/** + * Returns the first element yielding the largest value of the given function or `null` if there are no elements. + */ +public header inline fun > Array.maxBy(selector: (T) -> R): T? + +/** + * Returns the first element yielding the largest value of the given function or `null` if there are no elements. + */ +public header inline fun > ByteArray.maxBy(selector: (Byte) -> R): Byte? + +/** + * Returns the first element yielding the largest value of the given function or `null` if there are no elements. + */ +public header inline fun > ShortArray.maxBy(selector: (Short) -> R): Short? + +/** + * Returns the first element yielding the largest value of the given function or `null` if there are no elements. + */ +public header inline fun > IntArray.maxBy(selector: (Int) -> R): Int? + +/** + * Returns the first element yielding the largest value of the given function or `null` if there are no elements. + */ +public header inline fun > LongArray.maxBy(selector: (Long) -> R): Long? + +/** + * Returns the first element yielding the largest value of the given function or `null` if there are no elements. + */ +public header inline fun > FloatArray.maxBy(selector: (Float) -> R): Float? + +/** + * Returns the first element yielding the largest value of the given function or `null` if there are no elements. + */ +public header inline fun > DoubleArray.maxBy(selector: (Double) -> R): Double? + +/** + * Returns the first element yielding the largest value of the given function or `null` if there are no elements. + */ +public header inline fun > BooleanArray.maxBy(selector: (Boolean) -> R): Boolean? + +/** + * Returns the first element yielding the largest value of the given function or `null` if there are no elements. + */ +public header inline fun > CharArray.maxBy(selector: (Char) -> R): Char? + +/** + * Returns the first element having the largest value according to the provided [comparator] or `null` if there are no elements. + */ +public header fun Array.maxWith(comparator: Comparator): T? + +/** + * Returns the first element having the largest value according to the provided [comparator] or `null` if there are no elements. + */ +public header fun ByteArray.maxWith(comparator: Comparator): Byte? + +/** + * Returns the first element having the largest value according to the provided [comparator] or `null` if there are no elements. + */ +public header fun ShortArray.maxWith(comparator: Comparator): Short? + +/** + * Returns the first element having the largest value according to the provided [comparator] or `null` if there are no elements. + */ +public header fun IntArray.maxWith(comparator: Comparator): Int? + +/** + * Returns the first element having the largest value according to the provided [comparator] or `null` if there are no elements. + */ +public header fun LongArray.maxWith(comparator: Comparator): Long? + +/** + * Returns the first element having the largest value according to the provided [comparator] or `null` if there are no elements. + */ +public header fun FloatArray.maxWith(comparator: Comparator): Float? + +/** + * Returns the first element having the largest value according to the provided [comparator] or `null` if there are no elements. + */ +public header fun DoubleArray.maxWith(comparator: Comparator): Double? + +/** + * Returns the first element having the largest value according to the provided [comparator] or `null` if there are no elements. + */ +public header fun BooleanArray.maxWith(comparator: Comparator): Boolean? + +/** + * Returns the first element having the largest value according to the provided [comparator] or `null` if there are no elements. + */ +public header fun CharArray.maxWith(comparator: Comparator): Char? + +/** + * Returns the smallest element or `null` if there are no elements. + */ +public header fun > Array.min(): T? + +/** + * Returns the smallest element or `null` if there are no elements. + */ +public header fun ByteArray.min(): Byte? + +/** + * Returns the smallest element or `null` if there are no elements. + */ +public header fun ShortArray.min(): Short? + +/** + * Returns the smallest element or `null` if there are no elements. + */ +public header fun IntArray.min(): Int? + +/** + * Returns the smallest element or `null` if there are no elements. + */ +public header fun LongArray.min(): Long? + +/** + * Returns the smallest element or `null` if there are no elements. + */ +public header fun FloatArray.min(): Float? + +/** + * Returns the smallest element or `null` if there are no elements. + */ +public header fun DoubleArray.min(): Double? + +/** + * Returns the smallest element or `null` if there are no elements. + */ +public header fun CharArray.min(): Char? + +/** + * Returns the first element yielding the smallest value of the given function or `null` if there are no elements. + */ +public header inline fun > Array.minBy(selector: (T) -> R): T? + +/** + * Returns the first element yielding the smallest value of the given function or `null` if there are no elements. + */ +public header inline fun > ByteArray.minBy(selector: (Byte) -> R): Byte? + +/** + * Returns the first element yielding the smallest value of the given function or `null` if there are no elements. + */ +public header inline fun > ShortArray.minBy(selector: (Short) -> R): Short? + +/** + * Returns the first element yielding the smallest value of the given function or `null` if there are no elements. + */ +public header inline fun > IntArray.minBy(selector: (Int) -> R): Int? + +/** + * Returns the first element yielding the smallest value of the given function or `null` if there are no elements. + */ +public header inline fun > LongArray.minBy(selector: (Long) -> R): Long? + +/** + * Returns the first element yielding the smallest value of the given function or `null` if there are no elements. + */ +public header inline fun > FloatArray.minBy(selector: (Float) -> R): Float? + +/** + * Returns the first element yielding the smallest value of the given function or `null` if there are no elements. + */ +public header inline fun > DoubleArray.minBy(selector: (Double) -> R): Double? + +/** + * Returns the first element yielding the smallest value of the given function or `null` if there are no elements. + */ +public header inline fun > BooleanArray.minBy(selector: (Boolean) -> R): Boolean? + +/** + * Returns the first element yielding the smallest value of the given function or `null` if there are no elements. + */ +public header inline fun > CharArray.minBy(selector: (Char) -> R): Char? + +/** + * Returns the first element having the smallest value according to the provided [comparator] or `null` if there are no elements. + */ +public header fun Array.minWith(comparator: Comparator): T? + +/** + * Returns the first element having the smallest value according to the provided [comparator] or `null` if there are no elements. + */ +public header fun ByteArray.minWith(comparator: Comparator): Byte? + +/** + * Returns the first element having the smallest value according to the provided [comparator] or `null` if there are no elements. + */ +public header fun ShortArray.minWith(comparator: Comparator): Short? + +/** + * Returns the first element having the smallest value according to the provided [comparator] or `null` if there are no elements. + */ +public header fun IntArray.minWith(comparator: Comparator): Int? + +/** + * Returns the first element having the smallest value according to the provided [comparator] or `null` if there are no elements. + */ +public header fun LongArray.minWith(comparator: Comparator): Long? + +/** + * Returns the first element having the smallest value according to the provided [comparator] or `null` if there are no elements. + */ +public header fun FloatArray.minWith(comparator: Comparator): Float? + +/** + * Returns the first element having the smallest value according to the provided [comparator] or `null` if there are no elements. + */ +public header fun DoubleArray.minWith(comparator: Comparator): Double? + +/** + * Returns the first element having the smallest value according to the provided [comparator] or `null` if there are no elements. + */ +public header fun BooleanArray.minWith(comparator: Comparator): Boolean? + +/** + * Returns the first element having the smallest value according to the provided [comparator] or `null` if there are no elements. + */ +public header fun CharArray.minWith(comparator: Comparator): Char? + +/** + * Returns `true` if the array has no elements. + */ +public header fun Array.none(): Boolean + +/** + * Returns `true` if the array has no elements. + */ +public header fun ByteArray.none(): Boolean + +/** + * Returns `true` if the array has no elements. + */ +public header fun ShortArray.none(): Boolean + +/** + * Returns `true` if the array has no elements. + */ +public header fun IntArray.none(): Boolean + +/** + * Returns `true` if the array has no elements. + */ +public header fun LongArray.none(): Boolean + +/** + * Returns `true` if the array has no elements. + */ +public header fun FloatArray.none(): Boolean + +/** + * Returns `true` if the array has no elements. + */ +public header fun DoubleArray.none(): Boolean + +/** + * Returns `true` if the array has no elements. + */ +public header fun BooleanArray.none(): Boolean + +/** + * Returns `true` if the array has no elements. + */ +public header fun CharArray.none(): Boolean + +/** + * Returns `true` if no elements match the given [predicate]. + */ +public header inline fun Array.none(predicate: (T) -> Boolean): Boolean + +/** + * Returns `true` if no elements match the given [predicate]. + */ +public header inline fun ByteArray.none(predicate: (Byte) -> Boolean): Boolean + +/** + * Returns `true` if no elements match the given [predicate]. + */ +public header inline fun ShortArray.none(predicate: (Short) -> Boolean): Boolean + +/** + * Returns `true` if no elements match the given [predicate]. + */ +public header inline fun IntArray.none(predicate: (Int) -> Boolean): Boolean + +/** + * Returns `true` if no elements match the given [predicate]. + */ +public header inline fun LongArray.none(predicate: (Long) -> Boolean): Boolean + +/** + * Returns `true` if no elements match the given [predicate]. + */ +public header inline fun FloatArray.none(predicate: (Float) -> Boolean): Boolean + +/** + * Returns `true` if no elements match the given [predicate]. + */ +public header inline fun DoubleArray.none(predicate: (Double) -> Boolean): Boolean + +/** + * Returns `true` if no elements match the given [predicate]. + */ +public header inline fun BooleanArray.none(predicate: (Boolean) -> Boolean): Boolean + +/** + * Returns `true` if no elements match the given [predicate]. + */ +public header inline fun CharArray.none(predicate: (Char) -> Boolean): Boolean + +/** + * Accumulates value starting with the first element and applying [operation] from left to right to current accumulator value and each element. + */ +public header inline fun Array.reduce(operation: (S, T) -> S): S + +/** + * Accumulates value starting with the first element and applying [operation] from left to right to current accumulator value and each element. + */ +public header inline fun ByteArray.reduce(operation: (Byte, Byte) -> Byte): Byte + +/** + * Accumulates value starting with the first element and applying [operation] from left to right to current accumulator value and each element. + */ +public header inline fun ShortArray.reduce(operation: (Short, Short) -> Short): Short + +/** + * Accumulates value starting with the first element and applying [operation] from left to right to current accumulator value and each element. + */ +public header inline fun IntArray.reduce(operation: (Int, Int) -> Int): Int + +/** + * Accumulates value starting with the first element and applying [operation] from left to right to current accumulator value and each element. + */ +public header inline fun LongArray.reduce(operation: (Long, Long) -> Long): Long + +/** + * Accumulates value starting with the first element and applying [operation] from left to right to current accumulator value and each element. + */ +public header inline fun FloatArray.reduce(operation: (Float, Float) -> Float): Float + +/** + * Accumulates value starting with the first element and applying [operation] from left to right to current accumulator value and each element. + */ +public header inline fun DoubleArray.reduce(operation: (Double, Double) -> Double): Double + +/** + * Accumulates value starting with the first element and applying [operation] from left to right to current accumulator value and each element. + */ +public header inline fun BooleanArray.reduce(operation: (Boolean, Boolean) -> Boolean): Boolean + +/** + * Accumulates value starting with the first element and applying [operation] from left to right to current accumulator value and each element. + */ +public header inline fun CharArray.reduce(operation: (Char, Char) -> Char): Char + +/** + * Accumulates value starting with the first element and applying [operation] from left to right + * to current accumulator value and each element with its index in the original array. + * @param [operation] function that takes the index of an element, current accumulator value + * and the element itself and calculates the next accumulator value. + */ +public header inline fun Array.reduceIndexed(operation: (Int, S, T) -> S): S + +/** + * Accumulates value starting with the first element and applying [operation] from left to right + * to current accumulator value and each element with its index in the original array. + * @param [operation] function that takes the index of an element, current accumulator value + * and the element itself and calculates the next accumulator value. + */ +public header inline fun ByteArray.reduceIndexed(operation: (Int, Byte, Byte) -> Byte): Byte + +/** + * Accumulates value starting with the first element and applying [operation] from left to right + * to current accumulator value and each element with its index in the original array. + * @param [operation] function that takes the index of an element, current accumulator value + * and the element itself and calculates the next accumulator value. + */ +public header inline fun ShortArray.reduceIndexed(operation: (Int, Short, Short) -> Short): Short + +/** + * Accumulates value starting with the first element and applying [operation] from left to right + * to current accumulator value and each element with its index in the original array. + * @param [operation] function that takes the index of an element, current accumulator value + * and the element itself and calculates the next accumulator value. + */ +public header inline fun IntArray.reduceIndexed(operation: (Int, Int, Int) -> Int): Int + +/** + * Accumulates value starting with the first element and applying [operation] from left to right + * to current accumulator value and each element with its index in the original array. + * @param [operation] function that takes the index of an element, current accumulator value + * and the element itself and calculates the next accumulator value. + */ +public header inline fun LongArray.reduceIndexed(operation: (Int, Long, Long) -> Long): Long + +/** + * Accumulates value starting with the first element and applying [operation] from left to right + * to current accumulator value and each element with its index in the original array. + * @param [operation] function that takes the index of an element, current accumulator value + * and the element itself and calculates the next accumulator value. + */ +public header inline fun FloatArray.reduceIndexed(operation: (Int, Float, Float) -> Float): Float + +/** + * Accumulates value starting with the first element and applying [operation] from left to right + * to current accumulator value and each element with its index in the original array. + * @param [operation] function that takes the index of an element, current accumulator value + * and the element itself and calculates the next accumulator value. + */ +public header inline fun DoubleArray.reduceIndexed(operation: (Int, Double, Double) -> Double): Double + +/** + * Accumulates value starting with the first element and applying [operation] from left to right + * to current accumulator value and each element with its index in the original array. + * @param [operation] function that takes the index of an element, current accumulator value + * and the element itself and calculates the next accumulator value. + */ +public header inline fun BooleanArray.reduceIndexed(operation: (Int, Boolean, Boolean) -> Boolean): Boolean + +/** + * Accumulates value starting with the first element and applying [operation] from left to right + * to current accumulator value and each element with its index in the original array. + * @param [operation] function that takes the index of an element, current accumulator value + * and the element itself and calculates the next accumulator value. + */ +public header inline fun CharArray.reduceIndexed(operation: (Int, Char, Char) -> Char): Char + +/** + * Accumulates value starting with last element and applying [operation] from right to left to each element and current accumulator value. + */ +public header inline fun Array.reduceRight(operation: (T, S) -> S): S + +/** + * Accumulates value starting with last element and applying [operation] from right to left to each element and current accumulator value. + */ +public header inline fun ByteArray.reduceRight(operation: (Byte, Byte) -> Byte): Byte + +/** + * Accumulates value starting with last element and applying [operation] from right to left to each element and current accumulator value. + */ +public header inline fun ShortArray.reduceRight(operation: (Short, Short) -> Short): Short + +/** + * Accumulates value starting with last element and applying [operation] from right to left to each element and current accumulator value. + */ +public header inline fun IntArray.reduceRight(operation: (Int, Int) -> Int): Int + +/** + * Accumulates value starting with last element and applying [operation] from right to left to each element and current accumulator value. + */ +public header inline fun LongArray.reduceRight(operation: (Long, Long) -> Long): Long + +/** + * Accumulates value starting with last element and applying [operation] from right to left to each element and current accumulator value. + */ +public header inline fun FloatArray.reduceRight(operation: (Float, Float) -> Float): Float + +/** + * Accumulates value starting with last element and applying [operation] from right to left to each element and current accumulator value. + */ +public header inline fun DoubleArray.reduceRight(operation: (Double, Double) -> Double): Double + +/** + * Accumulates value starting with last element and applying [operation] from right to left to each element and current accumulator value. + */ +public header inline fun BooleanArray.reduceRight(operation: (Boolean, Boolean) -> Boolean): Boolean + +/** + * Accumulates value starting with last element and applying [operation] from right to left to each element and current accumulator value. + */ +public header inline fun CharArray.reduceRight(operation: (Char, Char) -> Char): Char + +/** + * Accumulates value starting with last element and applying [operation] from right to left + * to each element with its index in the original array and current accumulator value. + * @param [operation] function that takes the index of an element, the element itself + * and current accumulator value, and calculates the next accumulator value. + */ +public header inline fun Array.reduceRightIndexed(operation: (Int, T, S) -> S): S + +/** + * Accumulates value starting with last element and applying [operation] from right to left + * to each element with its index in the original array and current accumulator value. + * @param [operation] function that takes the index of an element, the element itself + * and current accumulator value, and calculates the next accumulator value. + */ +public header inline fun ByteArray.reduceRightIndexed(operation: (Int, Byte, Byte) -> Byte): Byte + +/** + * Accumulates value starting with last element and applying [operation] from right to left + * to each element with its index in the original array and current accumulator value. + * @param [operation] function that takes the index of an element, the element itself + * and current accumulator value, and calculates the next accumulator value. + */ +public header inline fun ShortArray.reduceRightIndexed(operation: (Int, Short, Short) -> Short): Short + +/** + * Accumulates value starting with last element and applying [operation] from right to left + * to each element with its index in the original array and current accumulator value. + * @param [operation] function that takes the index of an element, the element itself + * and current accumulator value, and calculates the next accumulator value. + */ +public header inline fun IntArray.reduceRightIndexed(operation: (Int, Int, Int) -> Int): Int + +/** + * Accumulates value starting with last element and applying [operation] from right to left + * to each element with its index in the original array and current accumulator value. + * @param [operation] function that takes the index of an element, the element itself + * and current accumulator value, and calculates the next accumulator value. + */ +public header inline fun LongArray.reduceRightIndexed(operation: (Int, Long, Long) -> Long): Long + +/** + * Accumulates value starting with last element and applying [operation] from right to left + * to each element with its index in the original array and current accumulator value. + * @param [operation] function that takes the index of an element, the element itself + * and current accumulator value, and calculates the next accumulator value. + */ +public header inline fun FloatArray.reduceRightIndexed(operation: (Int, Float, Float) -> Float): Float + +/** + * Accumulates value starting with last element and applying [operation] from right to left + * to each element with its index in the original array and current accumulator value. + * @param [operation] function that takes the index of an element, the element itself + * and current accumulator value, and calculates the next accumulator value. + */ +public header inline fun DoubleArray.reduceRightIndexed(operation: (Int, Double, Double) -> Double): Double + +/** + * Accumulates value starting with last element and applying [operation] from right to left + * to each element with its index in the original array and current accumulator value. + * @param [operation] function that takes the index of an element, the element itself + * and current accumulator value, and calculates the next accumulator value. + */ +public header inline fun BooleanArray.reduceRightIndexed(operation: (Int, Boolean, Boolean) -> Boolean): Boolean + +/** + * Accumulates value starting with last element and applying [operation] from right to left + * to each element with its index in the original array and current accumulator value. + * @param [operation] function that takes the index of an element, the element itself + * and current accumulator value, and calculates the next accumulator value. + */ +public header inline fun CharArray.reduceRightIndexed(operation: (Int, Char, Char) -> Char): Char + +/** + * Returns the sum of all values produced by [selector] function applied to each element in the array. + */ +public header inline fun Array.sumBy(selector: (T) -> Int): Int + +/** + * Returns the sum of all values produced by [selector] function applied to each element in the array. + */ +public header inline fun ByteArray.sumBy(selector: (Byte) -> Int): Int + +/** + * Returns the sum of all values produced by [selector] function applied to each element in the array. + */ +public header inline fun ShortArray.sumBy(selector: (Short) -> Int): Int + +/** + * Returns the sum of all values produced by [selector] function applied to each element in the array. + */ +public header inline fun IntArray.sumBy(selector: (Int) -> Int): Int + +/** + * Returns the sum of all values produced by [selector] function applied to each element in the array. + */ +public header inline fun LongArray.sumBy(selector: (Long) -> Int): Int + +/** + * Returns the sum of all values produced by [selector] function applied to each element in the array. + */ +public header inline fun FloatArray.sumBy(selector: (Float) -> Int): Int + +/** + * Returns the sum of all values produced by [selector] function applied to each element in the array. + */ +public header inline fun DoubleArray.sumBy(selector: (Double) -> Int): Int + +/** + * Returns the sum of all values produced by [selector] function applied to each element in the array. + */ +public header inline fun BooleanArray.sumBy(selector: (Boolean) -> Int): Int + +/** + * Returns the sum of all values produced by [selector] function applied to each element in the array. + */ +public header inline fun CharArray.sumBy(selector: (Char) -> Int): Int + +/** + * Returns the sum of all values produced by [selector] function applied to each element in the array. + */ +public header inline fun Array.sumByDouble(selector: (T) -> Double): Double + +/** + * Returns the sum of all values produced by [selector] function applied to each element in the array. + */ +public header inline fun ByteArray.sumByDouble(selector: (Byte) -> Double): Double + +/** + * Returns the sum of all values produced by [selector] function applied to each element in the array. + */ +public header inline fun ShortArray.sumByDouble(selector: (Short) -> Double): Double + +/** + * Returns the sum of all values produced by [selector] function applied to each element in the array. + */ +public header inline fun IntArray.sumByDouble(selector: (Int) -> Double): Double + +/** + * Returns the sum of all values produced by [selector] function applied to each element in the array. + */ +public header inline fun LongArray.sumByDouble(selector: (Long) -> Double): Double + +/** + * Returns the sum of all values produced by [selector] function applied to each element in the array. + */ +public header inline fun FloatArray.sumByDouble(selector: (Float) -> Double): Double + +/** + * Returns the sum of all values produced by [selector] function applied to each element in the array. + */ +public header inline fun DoubleArray.sumByDouble(selector: (Double) -> Double): Double + +/** + * Returns the sum of all values produced by [selector] function applied to each element in the array. + */ +public header inline fun BooleanArray.sumByDouble(selector: (Boolean) -> Double): Double + +/** + * Returns the sum of all values produced by [selector] function applied to each element in the array. + */ +public header inline fun CharArray.sumByDouble(selector: (Char) -> Double): Double + +/** + * Returns an original collection containing all the non-`null` elements, throwing an [IllegalArgumentException] if there are any `null` elements. + */ +public header fun Array.requireNoNulls(): Array + +/** + * Splits the original array into pair of lists, + * where *first* list contains elements for which [predicate] yielded `true`, + * while *second* list contains elements for which [predicate] yielded `false`. + */ +public header inline fun Array.partition(predicate: (T) -> Boolean): Pair, List> + +/** + * Splits the original array into pair of lists, + * where *first* list contains elements for which [predicate] yielded `true`, + * while *second* list contains elements for which [predicate] yielded `false`. + */ +public header inline fun ByteArray.partition(predicate: (Byte) -> Boolean): Pair, List> + +/** + * Splits the original array into pair of lists, + * where *first* list contains elements for which [predicate] yielded `true`, + * while *second* list contains elements for which [predicate] yielded `false`. + */ +public header inline fun ShortArray.partition(predicate: (Short) -> Boolean): Pair, List> + +/** + * Splits the original array into pair of lists, + * where *first* list contains elements for which [predicate] yielded `true`, + * while *second* list contains elements for which [predicate] yielded `false`. + */ +public header inline fun IntArray.partition(predicate: (Int) -> Boolean): Pair, List> + +/** + * Splits the original array into pair of lists, + * where *first* list contains elements for which [predicate] yielded `true`, + * while *second* list contains elements for which [predicate] yielded `false`. + */ +public header inline fun LongArray.partition(predicate: (Long) -> Boolean): Pair, List> + +/** + * Splits the original array into pair of lists, + * where *first* list contains elements for which [predicate] yielded `true`, + * while *second* list contains elements for which [predicate] yielded `false`. + */ +public header inline fun FloatArray.partition(predicate: (Float) -> Boolean): Pair, List> + +/** + * Splits the original array into pair of lists, + * where *first* list contains elements for which [predicate] yielded `true`, + * while *second* list contains elements for which [predicate] yielded `false`. + */ +public header inline fun DoubleArray.partition(predicate: (Double) -> Boolean): Pair, List> + +/** + * Splits the original array into pair of lists, + * where *first* list contains elements for which [predicate] yielded `true`, + * while *second* list contains elements for which [predicate] yielded `false`. + */ +public header inline fun BooleanArray.partition(predicate: (Boolean) -> Boolean): Pair, List> + +/** + * Splits the original array into pair of lists, + * where *first* list contains elements for which [predicate] yielded `true`, + * while *second* list contains elements for which [predicate] yielded `false`. + */ +public header inline fun CharArray.partition(predicate: (Char) -> Boolean): Pair, List> + +/** + * Returns a list of pairs built from elements of both collections with same indexes. List has length of shortest collection. + */ +public header infix fun Array.zip(other: Array): List> + +/** + * Returns a list of pairs built from elements of both collections with same indexes. List has length of shortest collection. + */ +public header infix fun ByteArray.zip(other: Array): List> + +/** + * Returns a list of pairs built from elements of both collections with same indexes. List has length of shortest collection. + */ +public header infix fun ShortArray.zip(other: Array): List> + +/** + * Returns a list of pairs built from elements of both collections with same indexes. List has length of shortest collection. + */ +public header infix fun IntArray.zip(other: Array): List> + +/** + * Returns a list of pairs built from elements of both collections with same indexes. List has length of shortest collection. + */ +public header infix fun LongArray.zip(other: Array): List> + +/** + * Returns a list of pairs built from elements of both collections with same indexes. List has length of shortest collection. + */ +public header infix fun FloatArray.zip(other: Array): List> + +/** + * Returns a list of pairs built from elements of both collections with same indexes. List has length of shortest collection. + */ +public header infix fun DoubleArray.zip(other: Array): List> + +/** + * Returns a list of pairs built from elements of both collections with same indexes. List has length of shortest collection. + */ +public header infix fun BooleanArray.zip(other: Array): List> + +/** + * Returns a list of pairs built from elements of both collections with same indexes. List has length of shortest collection. + */ +public header infix fun CharArray.zip(other: Array): List> + +/** + * Returns a list of values built from elements of both collections with same indexes using provided [transform]. List has length of shortest collection. + */ +public header inline fun Array.zip(other: Array, transform: (T, R) -> V): List + +/** + * Returns a list of values built from elements of both collections with same indexes using provided [transform]. List has length of shortest collection. + */ +public header inline fun ByteArray.zip(other: Array, transform: (Byte, R) -> V): List + +/** + * Returns a list of values built from elements of both collections with same indexes using provided [transform]. List has length of shortest collection. + */ +public header inline fun ShortArray.zip(other: Array, transform: (Short, R) -> V): List + +/** + * Returns a list of values built from elements of both collections with same indexes using provided [transform]. List has length of shortest collection. + */ +public header inline fun IntArray.zip(other: Array, transform: (Int, R) -> V): List + +/** + * Returns a list of values built from elements of both collections with same indexes using provided [transform]. List has length of shortest collection. + */ +public header inline fun LongArray.zip(other: Array, transform: (Long, R) -> V): List + +/** + * Returns a list of values built from elements of both collections with same indexes using provided [transform]. List has length of shortest collection. + */ +public header inline fun FloatArray.zip(other: Array, transform: (Float, R) -> V): List + +/** + * Returns a list of values built from elements of both collections with same indexes using provided [transform]. List has length of shortest collection. + */ +public header inline fun DoubleArray.zip(other: Array, transform: (Double, R) -> V): List + +/** + * Returns a list of values built from elements of both collections with same indexes using provided [transform]. List has length of shortest collection. + */ +public header inline fun BooleanArray.zip(other: Array, transform: (Boolean, R) -> V): List + +/** + * Returns a list of values built from elements of both collections with same indexes using provided [transform]. List has length of shortest collection. + */ +public header inline fun CharArray.zip(other: Array, transform: (Char, R) -> V): List + +/** + * Returns a list of pairs built from elements of both collections with same indexes. List has length of shortest collection. + */ +public header infix fun Array.zip(other: Iterable): List> + +/** + * Returns a list of pairs built from elements of both collections with same indexes. List has length of shortest collection. + */ +public header infix fun ByteArray.zip(other: Iterable): List> + +/** + * Returns a list of pairs built from elements of both collections with same indexes. List has length of shortest collection. + */ +public header infix fun ShortArray.zip(other: Iterable): List> + +/** + * Returns a list of pairs built from elements of both collections with same indexes. List has length of shortest collection. + */ +public header infix fun IntArray.zip(other: Iterable): List> + +/** + * Returns a list of pairs built from elements of both collections with same indexes. List has length of shortest collection. + */ +public header infix fun LongArray.zip(other: Iterable): List> + +/** + * Returns a list of pairs built from elements of both collections with same indexes. List has length of shortest collection. + */ +public header infix fun FloatArray.zip(other: Iterable): List> + +/** + * Returns a list of pairs built from elements of both collections with same indexes. List has length of shortest collection. + */ +public header infix fun DoubleArray.zip(other: Iterable): List> + +/** + * Returns a list of pairs built from elements of both collections with same indexes. List has length of shortest collection. + */ +public header infix fun BooleanArray.zip(other: Iterable): List> + +/** + * Returns a list of pairs built from elements of both collections with same indexes. List has length of shortest collection. + */ +public header infix fun CharArray.zip(other: Iterable): List> + +/** + * Returns a list of values built from elements of both collections with same indexes using provided [transform]. List has length of shortest collection. + */ +public header inline fun Array.zip(other: Iterable, transform: (T, R) -> V): List + +/** + * Returns a list of values built from elements of both collections with same indexes using provided [transform]. List has length of shortest collection. + */ +public header inline fun ByteArray.zip(other: Iterable, transform: (Byte, R) -> V): List + +/** + * Returns a list of values built from elements of both collections with same indexes using provided [transform]. List has length of shortest collection. + */ +public header inline fun ShortArray.zip(other: Iterable, transform: (Short, R) -> V): List + +/** + * Returns a list of values built from elements of both collections with same indexes using provided [transform]. List has length of shortest collection. + */ +public header inline fun IntArray.zip(other: Iterable, transform: (Int, R) -> V): List + +/** + * Returns a list of values built from elements of both collections with same indexes using provided [transform]. List has length of shortest collection. + */ +public header inline fun LongArray.zip(other: Iterable, transform: (Long, R) -> V): List + +/** + * Returns a list of values built from elements of both collections with same indexes using provided [transform]. List has length of shortest collection. + */ +public header inline fun FloatArray.zip(other: Iterable, transform: (Float, R) -> V): List + +/** + * Returns a list of values built from elements of both collections with same indexes using provided [transform]. List has length of shortest collection. + */ +public header inline fun DoubleArray.zip(other: Iterable, transform: (Double, R) -> V): List + +/** + * Returns a list of values built from elements of both collections with same indexes using provided [transform]. List has length of shortest collection. + */ +public header inline fun BooleanArray.zip(other: Iterable, transform: (Boolean, R) -> V): List + +/** + * Returns a list of values built from elements of both collections with same indexes using provided [transform]. List has length of shortest collection. + */ +public header inline fun CharArray.zip(other: Iterable, transform: (Char, R) -> V): List + +/** + * Returns a list of pairs built from elements of both collections with same indexes. List has length of shortest collection. + */ +public header infix fun ByteArray.zip(other: ByteArray): List> + +/** + * Returns a list of pairs built from elements of both collections with same indexes. List has length of shortest collection. + */ +public header infix fun ShortArray.zip(other: ShortArray): List> + +/** + * Returns a list of pairs built from elements of both collections with same indexes. List has length of shortest collection. + */ +public header infix fun IntArray.zip(other: IntArray): List> + +/** + * Returns a list of pairs built from elements of both collections with same indexes. List has length of shortest collection. + */ +public header infix fun LongArray.zip(other: LongArray): List> + +/** + * Returns a list of pairs built from elements of both collections with same indexes. List has length of shortest collection. + */ +public header infix fun FloatArray.zip(other: FloatArray): List> + +/** + * Returns a list of pairs built from elements of both collections with same indexes. List has length of shortest collection. + */ +public header infix fun DoubleArray.zip(other: DoubleArray): List> + +/** + * Returns a list of pairs built from elements of both collections with same indexes. List has length of shortest collection. + */ +public header infix fun BooleanArray.zip(other: BooleanArray): List> + +/** + * Returns a list of pairs built from elements of both collections with same indexes. List has length of shortest collection. + */ +public header infix fun CharArray.zip(other: CharArray): List> + +/** + * Returns a list of values built from elements of both collections with same indexes using provided [transform]. List has length of shortest collection. + */ +public header inline fun ByteArray.zip(other: ByteArray, transform: (Byte, Byte) -> V): List + +/** + * Returns a list of values built from elements of both collections with same indexes using provided [transform]. List has length of shortest collection. + */ +public header inline fun ShortArray.zip(other: ShortArray, transform: (Short, Short) -> V): List + +/** + * Returns a list of values built from elements of both collections with same indexes using provided [transform]. List has length of shortest collection. + */ +public header inline fun IntArray.zip(other: IntArray, transform: (Int, Int) -> V): List + +/** + * Returns a list of values built from elements of both collections with same indexes using provided [transform]. List has length of shortest collection. + */ +public header inline fun LongArray.zip(other: LongArray, transform: (Long, Long) -> V): List + +/** + * Returns a list of values built from elements of both collections with same indexes using provided [transform]. List has length of shortest collection. + */ +public header inline fun FloatArray.zip(other: FloatArray, transform: (Float, Float) -> V): List + +/** + * Returns a list of values built from elements of both collections with same indexes using provided [transform]. List has length of shortest collection. + */ +public header inline fun DoubleArray.zip(other: DoubleArray, transform: (Double, Double) -> V): List + +/** + * Returns a list of values built from elements of both collections with same indexes using provided [transform]. List has length of shortest collection. + */ +public header inline fun BooleanArray.zip(other: BooleanArray, transform: (Boolean, Boolean) -> V): List + +/** + * Returns a list of values built from elements of both collections with same indexes using provided [transform]. List has length of shortest collection. + */ +public header inline fun CharArray.zip(other: CharArray, transform: (Char, Char) -> V): List + +/** + * Appends the string from all the elements separated using [separator] and using the given [prefix] and [postfix] if supplied. + * + * If the collection could be huge, you can specify a non-negative value of [limit], in which case only the first [limit] + * elements will be appended, followed by the [truncated] string (which defaults to "..."). + */ +public header fun Array.joinTo(buffer: A, separator: CharSequence = ", ", prefix: CharSequence = "", postfix: CharSequence = "", limit: Int = -1, truncated: CharSequence = "...", transform: ((T) -> CharSequence)? = null): A + +/** + * Appends the string from all the elements separated using [separator] and using the given [prefix] and [postfix] if supplied. + * + * If the collection could be huge, you can specify a non-negative value of [limit], in which case only the first [limit] + * elements will be appended, followed by the [truncated] string (which defaults to "..."). + */ +public header fun ByteArray.joinTo(buffer: A, separator: CharSequence = ", ", prefix: CharSequence = "", postfix: CharSequence = "", limit: Int = -1, truncated: CharSequence = "...", transform: ((Byte) -> CharSequence)? = null): A + +/** + * Appends the string from all the elements separated using [separator] and using the given [prefix] and [postfix] if supplied. + * + * If the collection could be huge, you can specify a non-negative value of [limit], in which case only the first [limit] + * elements will be appended, followed by the [truncated] string (which defaults to "..."). + */ +public header fun ShortArray.joinTo(buffer: A, separator: CharSequence = ", ", prefix: CharSequence = "", postfix: CharSequence = "", limit: Int = -1, truncated: CharSequence = "...", transform: ((Short) -> CharSequence)? = null): A + +/** + * Appends the string from all the elements separated using [separator] and using the given [prefix] and [postfix] if supplied. + * + * If the collection could be huge, you can specify a non-negative value of [limit], in which case only the first [limit] + * elements will be appended, followed by the [truncated] string (which defaults to "..."). + */ +public header fun IntArray.joinTo(buffer: A, separator: CharSequence = ", ", prefix: CharSequence = "", postfix: CharSequence = "", limit: Int = -1, truncated: CharSequence = "...", transform: ((Int) -> CharSequence)? = null): A + +/** + * Appends the string from all the elements separated using [separator] and using the given [prefix] and [postfix] if supplied. + * + * If the collection could be huge, you can specify a non-negative value of [limit], in which case only the first [limit] + * elements will be appended, followed by the [truncated] string (which defaults to "..."). + */ +public header fun LongArray.joinTo(buffer: A, separator: CharSequence = ", ", prefix: CharSequence = "", postfix: CharSequence = "", limit: Int = -1, truncated: CharSequence = "...", transform: ((Long) -> CharSequence)? = null): A + +/** + * Appends the string from all the elements separated using [separator] and using the given [prefix] and [postfix] if supplied. + * + * If the collection could be huge, you can specify a non-negative value of [limit], in which case only the first [limit] + * elements will be appended, followed by the [truncated] string (which defaults to "..."). + */ +public header fun FloatArray.joinTo(buffer: A, separator: CharSequence = ", ", prefix: CharSequence = "", postfix: CharSequence = "", limit: Int = -1, truncated: CharSequence = "...", transform: ((Float) -> CharSequence)? = null): A + +/** + * Appends the string from all the elements separated using [separator] and using the given [prefix] and [postfix] if supplied. + * + * If the collection could be huge, you can specify a non-negative value of [limit], in which case only the first [limit] + * elements will be appended, followed by the [truncated] string (which defaults to "..."). + */ +public header fun DoubleArray.joinTo(buffer: A, separator: CharSequence = ", ", prefix: CharSequence = "", postfix: CharSequence = "", limit: Int = -1, truncated: CharSequence = "...", transform: ((Double) -> CharSequence)? = null): A + +/** + * Appends the string from all the elements separated using [separator] and using the given [prefix] and [postfix] if supplied. + * + * If the collection could be huge, you can specify a non-negative value of [limit], in which case only the first [limit] + * elements will be appended, followed by the [truncated] string (which defaults to "..."). + */ +public header fun BooleanArray.joinTo(buffer: A, separator: CharSequence = ", ", prefix: CharSequence = "", postfix: CharSequence = "", limit: Int = -1, truncated: CharSequence = "...", transform: ((Boolean) -> CharSequence)? = null): A + +/** + * Appends the string from all the elements separated using [separator] and using the given [prefix] and [postfix] if supplied. + * + * If the collection could be huge, you can specify a non-negative value of [limit], in which case only the first [limit] + * elements will be appended, followed by the [truncated] string (which defaults to "..."). + */ +public header fun CharArray.joinTo(buffer: A, separator: CharSequence = ", ", prefix: CharSequence = "", postfix: CharSequence = "", limit: Int = -1, truncated: CharSequence = "...", transform: ((Char) -> CharSequence)? = null): A + +/** + * Creates a string from all the elements separated using [separator] and using the given [prefix] and [postfix] if supplied. + * + * If the collection could be huge, you can specify a non-negative value of [limit], in which case only the first [limit] + * elements will be appended, followed by the [truncated] string (which defaults to "..."). + */ +public header fun Array.joinToString(separator: CharSequence = ", ", prefix: CharSequence = "", postfix: CharSequence = "", limit: Int = -1, truncated: CharSequence = "...", transform: ((T) -> CharSequence)? = null): String + +/** + * Creates a string from all the elements separated using [separator] and using the given [prefix] and [postfix] if supplied. + * + * If the collection could be huge, you can specify a non-negative value of [limit], in which case only the first [limit] + * elements will be appended, followed by the [truncated] string (which defaults to "..."). + */ +public header fun ByteArray.joinToString(separator: CharSequence = ", ", prefix: CharSequence = "", postfix: CharSequence = "", limit: Int = -1, truncated: CharSequence = "...", transform: ((Byte) -> CharSequence)? = null): String + +/** + * Creates a string from all the elements separated using [separator] and using the given [prefix] and [postfix] if supplied. + * + * If the collection could be huge, you can specify a non-negative value of [limit], in which case only the first [limit] + * elements will be appended, followed by the [truncated] string (which defaults to "..."). + */ +public header fun ShortArray.joinToString(separator: CharSequence = ", ", prefix: CharSequence = "", postfix: CharSequence = "", limit: Int = -1, truncated: CharSequence = "...", transform: ((Short) -> CharSequence)? = null): String + +/** + * Creates a string from all the elements separated using [separator] and using the given [prefix] and [postfix] if supplied. + * + * If the collection could be huge, you can specify a non-negative value of [limit], in which case only the first [limit] + * elements will be appended, followed by the [truncated] string (which defaults to "..."). + */ +public header fun IntArray.joinToString(separator: CharSequence = ", ", prefix: CharSequence = "", postfix: CharSequence = "", limit: Int = -1, truncated: CharSequence = "...", transform: ((Int) -> CharSequence)? = null): String + +/** + * Creates a string from all the elements separated using [separator] and using the given [prefix] and [postfix] if supplied. + * + * If the collection could be huge, you can specify a non-negative value of [limit], in which case only the first [limit] + * elements will be appended, followed by the [truncated] string (which defaults to "..."). + */ +public header fun LongArray.joinToString(separator: CharSequence = ", ", prefix: CharSequence = "", postfix: CharSequence = "", limit: Int = -1, truncated: CharSequence = "...", transform: ((Long) -> CharSequence)? = null): String + +/** + * Creates a string from all the elements separated using [separator] and using the given [prefix] and [postfix] if supplied. + * + * If the collection could be huge, you can specify a non-negative value of [limit], in which case only the first [limit] + * elements will be appended, followed by the [truncated] string (which defaults to "..."). + */ +public header fun FloatArray.joinToString(separator: CharSequence = ", ", prefix: CharSequence = "", postfix: CharSequence = "", limit: Int = -1, truncated: CharSequence = "...", transform: ((Float) -> CharSequence)? = null): String + +/** + * Creates a string from all the elements separated using [separator] and using the given [prefix] and [postfix] if supplied. + * + * If the collection could be huge, you can specify a non-negative value of [limit], in which case only the first [limit] + * elements will be appended, followed by the [truncated] string (which defaults to "..."). + */ +public header fun DoubleArray.joinToString(separator: CharSequence = ", ", prefix: CharSequence = "", postfix: CharSequence = "", limit: Int = -1, truncated: CharSequence = "...", transform: ((Double) -> CharSequence)? = null): String + +/** + * Creates a string from all the elements separated using [separator] and using the given [prefix] and [postfix] if supplied. + * + * If the collection could be huge, you can specify a non-negative value of [limit], in which case only the first [limit] + * elements will be appended, followed by the [truncated] string (which defaults to "..."). + */ +public header fun BooleanArray.joinToString(separator: CharSequence = ", ", prefix: CharSequence = "", postfix: CharSequence = "", limit: Int = -1, truncated: CharSequence = "...", transform: ((Boolean) -> CharSequence)? = null): String + +/** + * Creates a string from all the elements separated using [separator] and using the given [prefix] and [postfix] if supplied. + * + * If the collection could be huge, you can specify a non-negative value of [limit], in which case only the first [limit] + * elements will be appended, followed by the [truncated] string (which defaults to "..."). + */ +public header fun CharArray.joinToString(separator: CharSequence = ", ", prefix: CharSequence = "", postfix: CharSequence = "", limit: Int = -1, truncated: CharSequence = "...", transform: ((Char) -> CharSequence)? = null): String + +/** + * Creates an [Iterable] instance that wraps the original array returning its elements when being iterated. + */ +public header fun Array.asIterable(): Iterable + +/** + * Creates an [Iterable] instance that wraps the original array returning its elements when being iterated. + */ +public header fun ByteArray.asIterable(): Iterable + +/** + * Creates an [Iterable] instance that wraps the original array returning its elements when being iterated. + */ +public header fun ShortArray.asIterable(): Iterable + +/** + * Creates an [Iterable] instance that wraps the original array returning its elements when being iterated. + */ +public header fun IntArray.asIterable(): Iterable + +/** + * Creates an [Iterable] instance that wraps the original array returning its elements when being iterated. + */ +public header fun LongArray.asIterable(): Iterable + +/** + * Creates an [Iterable] instance that wraps the original array returning its elements when being iterated. + */ +public header fun FloatArray.asIterable(): Iterable + +/** + * Creates an [Iterable] instance that wraps the original array returning its elements when being iterated. + */ +public header fun DoubleArray.asIterable(): Iterable + +/** + * Creates an [Iterable] instance that wraps the original array returning its elements when being iterated. + */ +public header fun BooleanArray.asIterable(): Iterable + +/** + * Creates an [Iterable] instance that wraps the original array returning its elements when being iterated. + */ +public header fun CharArray.asIterable(): Iterable + +/** + * Creates a [Sequence] instance that wraps the original array returning its elements when being iterated. + */ +public header fun Array.asSequence(): Sequence + +/** + * Creates a [Sequence] instance that wraps the original array returning its elements when being iterated. + */ +public header fun ByteArray.asSequence(): Sequence + +/** + * Creates a [Sequence] instance that wraps the original array returning its elements when being iterated. + */ +public header fun ShortArray.asSequence(): Sequence + +/** + * Creates a [Sequence] instance that wraps the original array returning its elements when being iterated. + */ +public header fun IntArray.asSequence(): Sequence + +/** + * Creates a [Sequence] instance that wraps the original array returning its elements when being iterated. + */ +public header fun LongArray.asSequence(): Sequence + +/** + * Creates a [Sequence] instance that wraps the original array returning its elements when being iterated. + */ +public header fun FloatArray.asSequence(): Sequence + +/** + * Creates a [Sequence] instance that wraps the original array returning its elements when being iterated. + */ +public header fun DoubleArray.asSequence(): Sequence + +/** + * Creates a [Sequence] instance that wraps the original array returning its elements when being iterated. + */ +public header fun BooleanArray.asSequence(): Sequence + +/** + * Creates a [Sequence] instance that wraps the original array returning its elements when being iterated. + */ +public header fun CharArray.asSequence(): Sequence + +/** + * Returns an average value of elements in the array. + */ +@kotlin.jvm.JvmName("averageOfByte") +public header fun Array.average(): Double + +/** + * Returns an average value of elements in the array. + */ +@kotlin.jvm.JvmName("averageOfShort") +public header fun Array.average(): Double + +/** + * Returns an average value of elements in the array. + */ +@kotlin.jvm.JvmName("averageOfInt") +public header fun Array.average(): Double + +/** + * Returns an average value of elements in the array. + */ +@kotlin.jvm.JvmName("averageOfLong") +public header fun Array.average(): Double + +/** + * Returns an average value of elements in the array. + */ +@kotlin.jvm.JvmName("averageOfFloat") +public header fun Array.average(): Double + +/** + * Returns an average value of elements in the array. + */ +@kotlin.jvm.JvmName("averageOfDouble") +public header fun Array.average(): Double + +/** + * Returns an average value of elements in the array. + */ +public header fun ByteArray.average(): Double + +/** + * Returns an average value of elements in the array. + */ +public header fun ShortArray.average(): Double + +/** + * Returns an average value of elements in the array. + */ +public header fun IntArray.average(): Double + +/** + * Returns an average value of elements in the array. + */ +public header fun LongArray.average(): Double + +/** + * Returns an average value of elements in the array. + */ +public header fun FloatArray.average(): Double + +/** + * Returns an average value of elements in the array. + */ +public header fun DoubleArray.average(): Double + +/** + * Returns the sum of all elements in the array. + */ +@kotlin.jvm.JvmName("sumOfByte") +public header fun Array.sum(): Int + +/** + * Returns the sum of all elements in the array. + */ +@kotlin.jvm.JvmName("sumOfShort") +public header fun Array.sum(): Int + +/** + * Returns the sum of all elements in the array. + */ +@kotlin.jvm.JvmName("sumOfInt") +public header fun Array.sum(): Int + +/** + * Returns the sum of all elements in the array. + */ +@kotlin.jvm.JvmName("sumOfLong") +public header fun Array.sum(): Long + +/** + * Returns the sum of all elements in the array. + */ +@kotlin.jvm.JvmName("sumOfFloat") +public header fun Array.sum(): Float + +/** + * Returns the sum of all elements in the array. + */ +@kotlin.jvm.JvmName("sumOfDouble") +public header fun Array.sum(): Double + +/** + * Returns the sum of all elements in the array. + */ +public header fun ByteArray.sum(): Int + +/** + * Returns the sum of all elements in the array. + */ +public header fun ShortArray.sum(): Int + +/** + * Returns the sum of all elements in the array. + */ +public header fun IntArray.sum(): Int + +/** + * Returns the sum of all elements in the array. + */ +public header fun LongArray.sum(): Long + +/** + * Returns the sum of all elements in the array. + */ +public header fun FloatArray.sum(): Float + +/** + * Returns the sum of all elements in the array. + */ +public header fun DoubleArray.sum(): Double + +/** + * Returns a [List] that wraps the original array. + */ +public header fun Array.asList(): List + +/** + * Returns a [List] that wraps the original array. + */ +public header fun ByteArray.asList(): List + +/** + * Returns a [List] that wraps the original array. + */ +public header fun ShortArray.asList(): List + +/** + * Returns a [List] that wraps the original array. + */ +public header fun IntArray.asList(): List + +/** + * Returns a [List] that wraps the original array. + */ +public header fun LongArray.asList(): List + +/** + * Returns a [List] that wraps the original array. + */ +public header fun FloatArray.asList(): List + +/** + * Returns a [List] that wraps the original array. + */ +public header fun DoubleArray.asList(): List + +/** + * Returns a [List] that wraps the original array. + */ +public header fun BooleanArray.asList(): List + +/** + * Returns a [List] that wraps the original array. + */ +public header fun CharArray.asList(): List + +/** + * Returns new array which is a copy of the original array. + */ +public header fun Array.copyOf(): Array + +/** + * Returns new array which is a copy of the original array. + */ +public header fun ByteArray.copyOf(): ByteArray + +/** + * Returns new array which is a copy of the original array. + */ +public header fun ShortArray.copyOf(): ShortArray + +/** + * Returns new array which is a copy of the original array. + */ +public header fun IntArray.copyOf(): IntArray + +/** + * Returns new array which is a copy of the original array. + */ +public header fun LongArray.copyOf(): LongArray + +/** + * Returns new array which is a copy of the original array. + */ +public header fun FloatArray.copyOf(): FloatArray + +/** + * Returns new array which is a copy of the original array. + */ +public header fun DoubleArray.copyOf(): DoubleArray + +/** + * Returns new array which is a copy of the original array. + */ +public header fun BooleanArray.copyOf(): BooleanArray + +/** + * Returns new array which is a copy of the original array. + */ +public header fun CharArray.copyOf(): CharArray + +/** + * Returns new array which is a copy of the original array, resized to the given [newSize]. + */ +public header fun ByteArray.copyOf(newSize: Int): ByteArray + +/** + * Returns new array which is a copy of the original array, resized to the given [newSize]. + */ +public header fun ShortArray.copyOf(newSize: Int): ShortArray + +/** + * Returns new array which is a copy of the original array, resized to the given [newSize]. + */ +public header fun IntArray.copyOf(newSize: Int): IntArray + +/** + * Returns new array which is a copy of the original array, resized to the given [newSize]. + */ +public header fun LongArray.copyOf(newSize: Int): LongArray + +/** + * Returns new array which is a copy of the original array, resized to the given [newSize]. + */ +public header fun FloatArray.copyOf(newSize: Int): FloatArray + +/** + * Returns new array which is a copy of the original array, resized to the given [newSize]. + */ +public header fun DoubleArray.copyOf(newSize: Int): DoubleArray + +/** + * Returns new array which is a copy of the original array, resized to the given [newSize]. + */ +public header fun BooleanArray.copyOf(newSize: Int): BooleanArray + +/** + * Returns new array which is a copy of the original array, resized to the given [newSize]. + */ +public header fun CharArray.copyOf(newSize: Int): CharArray + +/** + * Returns new array which is a copy of the original array, resized to the given [newSize]. + */ +public header fun Array.copyOf(newSize: Int): Array + +/** + * Returns new array which is a copy of range of original array. + */ +public header fun Array.copyOfRange(fromIndex: Int, toIndex: Int): Array + +/** + * Returns new array which is a copy of range of original array. + */ +public header fun ByteArray.copyOfRange(fromIndex: Int, toIndex: Int): ByteArray + +/** + * Returns new array which is a copy of range of original array. + */ +public header fun ShortArray.copyOfRange(fromIndex: Int, toIndex: Int): ShortArray + +/** + * Returns new array which is a copy of range of original array. + */ +public header fun IntArray.copyOfRange(fromIndex: Int, toIndex: Int): IntArray + +/** + * Returns new array which is a copy of range of original array. + */ +public header fun LongArray.copyOfRange(fromIndex: Int, toIndex: Int): LongArray + +/** + * Returns new array which is a copy of range of original array. + */ +public header fun FloatArray.copyOfRange(fromIndex: Int, toIndex: Int): FloatArray + +/** + * Returns new array which is a copy of range of original array. + */ +public header fun DoubleArray.copyOfRange(fromIndex: Int, toIndex: Int): DoubleArray + +/** + * Returns new array which is a copy of range of original array. + */ +public header fun BooleanArray.copyOfRange(fromIndex: Int, toIndex: Int): BooleanArray + +/** + * Returns new array which is a copy of range of original array. + */ +public header fun CharArray.copyOfRange(fromIndex: Int, toIndex: Int): CharArray + +/** + * Returns an array containing all elements of the original array and then the given [element]. + */ +public header operator fun Array.plus(element: T): Array + +/** + * Returns an array containing all elements of the original array and then the given [element]. + */ +public header operator fun ByteArray.plus(element: Byte): ByteArray + +/** + * Returns an array containing all elements of the original array and then the given [element]. + */ +public header operator fun ShortArray.plus(element: Short): ShortArray + +/** + * Returns an array containing all elements of the original array and then the given [element]. + */ +public header operator fun IntArray.plus(element: Int): IntArray + +/** + * Returns an array containing all elements of the original array and then the given [element]. + */ +public header operator fun LongArray.plus(element: Long): LongArray + +/** + * Returns an array containing all elements of the original array and then the given [element]. + */ +public header operator fun FloatArray.plus(element: Float): FloatArray + +/** + * Returns an array containing all elements of the original array and then the given [element]. + */ +public header operator fun DoubleArray.plus(element: Double): DoubleArray + +/** + * Returns an array containing all elements of the original array and then the given [element]. + */ +public header operator fun BooleanArray.plus(element: Boolean): BooleanArray + +/** + * Returns an array containing all elements of the original array and then the given [element]. + */ +public header operator fun CharArray.plus(element: Char): CharArray + +/** + * Returns an array containing all elements of the original array and then all elements of the given [elements] collection. + */ +public header operator fun Array.plus(elements: Collection): Array + +/** + * Returns an array containing all elements of the original array and then all elements of the given [elements] collection. + */ +public header operator fun ByteArray.plus(elements: Collection): ByteArray + +/** + * Returns an array containing all elements of the original array and then all elements of the given [elements] collection. + */ +public header operator fun ShortArray.plus(elements: Collection): ShortArray + +/** + * Returns an array containing all elements of the original array and then all elements of the given [elements] collection. + */ +public header operator fun IntArray.plus(elements: Collection): IntArray + +/** + * Returns an array containing all elements of the original array and then all elements of the given [elements] collection. + */ +public header operator fun LongArray.plus(elements: Collection): LongArray + +/** + * Returns an array containing all elements of the original array and then all elements of the given [elements] collection. + */ +public header operator fun FloatArray.plus(elements: Collection): FloatArray + +/** + * Returns an array containing all elements of the original array and then all elements of the given [elements] collection. + */ +public header operator fun DoubleArray.plus(elements: Collection): DoubleArray + +/** + * Returns an array containing all elements of the original array and then all elements of the given [elements] collection. + */ +public header operator fun BooleanArray.plus(elements: Collection): BooleanArray + +/** + * Returns an array containing all elements of the original array and then all elements of the given [elements] collection. + */ +public header operator fun CharArray.plus(elements: Collection): CharArray + +/** + * Returns an array containing all elements of the original array and then all elements of the given [elements] array. + */ +public header operator fun Array.plus(elements: Array): Array + +/** + * Returns an array containing all elements of the original array and then all elements of the given [elements] array. + */ +public header operator fun ByteArray.plus(elements: ByteArray): ByteArray + +/** + * Returns an array containing all elements of the original array and then all elements of the given [elements] array. + */ +public header operator fun ShortArray.plus(elements: ShortArray): ShortArray + +/** + * Returns an array containing all elements of the original array and then all elements of the given [elements] array. + */ +public header operator fun IntArray.plus(elements: IntArray): IntArray + +/** + * Returns an array containing all elements of the original array and then all elements of the given [elements] array. + */ +public header operator fun LongArray.plus(elements: LongArray): LongArray + +/** + * Returns an array containing all elements of the original array and then all elements of the given [elements] array. + */ +public header operator fun FloatArray.plus(elements: FloatArray): FloatArray + +/** + * Returns an array containing all elements of the original array and then all elements of the given [elements] array. + */ +public header operator fun DoubleArray.plus(elements: DoubleArray): DoubleArray + +/** + * Returns an array containing all elements of the original array and then all elements of the given [elements] array. + */ +public header operator fun BooleanArray.plus(elements: BooleanArray): BooleanArray + +/** + * Returns an array containing all elements of the original array and then all elements of the given [elements] array. + */ +public header operator fun CharArray.plus(elements: CharArray): CharArray + +/** + * Returns an array containing all elements of the original array and then the given [element]. + */ +public header fun Array.plusElement(element: T): Array + +/** + * Sorts the array in-place. + */ +public header fun IntArray.sort(): Unit + +/** + * Sorts the array in-place. + */ +public header fun LongArray.sort(): Unit + +/** + * Sorts the array in-place. + */ +public header fun ByteArray.sort(): Unit + +/** + * Sorts the array in-place. + */ +public header fun ShortArray.sort(): Unit + +/** + * Sorts the array in-place. + */ +public header fun DoubleArray.sort(): Unit + +/** + * Sorts the array in-place. + */ +public header fun FloatArray.sort(): Unit + +/** + * Sorts the array in-place. + */ +public header fun CharArray.sort(): Unit + +/** + * Sorts the array in-place according to the natural order of its elements. + */ +public header fun > Array.sort(): Unit + +/** + * Sorts the array in-place according to the order specified by the given [comparator]. + */ +public header fun Array.sortWith(comparator: Comparator): Unit + +/** + * Returns a *typed* object array containing all of the elements of this primitive array. + */ +public header fun ByteArray.toTypedArray(): Array + +/** + * Returns a *typed* object array containing all of the elements of this primitive array. + */ +public header fun ShortArray.toTypedArray(): Array + +/** + * Returns a *typed* object array containing all of the elements of this primitive array. + */ +public header fun IntArray.toTypedArray(): Array + +/** + * Returns a *typed* object array containing all of the elements of this primitive array. + */ +public header fun LongArray.toTypedArray(): Array + +/** + * Returns a *typed* object array containing all of the elements of this primitive array. + */ +public header fun FloatArray.toTypedArray(): Array + +/** + * Returns a *typed* object array containing all of the elements of this primitive array. + */ +public header fun DoubleArray.toTypedArray(): Array + +/** + * Returns a *typed* object array containing all of the elements of this primitive array. + */ +public header fun BooleanArray.toTypedArray(): Array + +/** + * Returns a *typed* object array containing all of the elements of this primitive array. + */ +public header fun CharArray.toTypedArray(): Array + +/** + * Sorts the array in-place according to the order specified by the given [comparison] function. + */ +public header inline fun Array.sort(noinline comparison: (T, T) -> Int): Unit + +/** + * Sorts the array in-place according to the order specified by the given [comparison] function. + */ +public header inline fun ByteArray.sort(noinline comparison: (Byte, Byte) -> Int): Unit + +/** + * Sorts the array in-place according to the order specified by the given [comparison] function. + */ +public header inline fun ShortArray.sort(noinline comparison: (Short, Short) -> Int): Unit + +/** + * Sorts the array in-place according to the order specified by the given [comparison] function. + */ +public header inline fun IntArray.sort(noinline comparison: (Int, Int) -> Int): Unit + +/** + * Sorts the array in-place according to the order specified by the given [comparison] function. + */ +public header inline fun LongArray.sort(noinline comparison: (Long, Long) -> Int): Unit + +/** + * Sorts the array in-place according to the order specified by the given [comparison] function. + */ +public header inline fun FloatArray.sort(noinline comparison: (Float, Float) -> Int): Unit + +/** + * Sorts the array in-place according to the order specified by the given [comparison] function. + */ +public header inline fun DoubleArray.sort(noinline comparison: (Double, Double) -> Int): Unit + +/** + * Sorts the array in-place according to the order specified by the given [comparison] function. + */ +public header inline fun CharArray.sort(noinline comparison: (Char, Char) -> Int): Unit + diff --git a/libraries/stdlib/common/src/generated/_Collections.kt b/libraries/stdlib/common/src/generated/_Collections.kt new file mode 100644 index 00000000000..452789a2e26 --- /dev/null +++ b/libraries/stdlib/common/src/generated/_Collections.kt @@ -0,0 +1,1063 @@ +@file:kotlin.jvm.JvmMultifileClass +@file:kotlin.jvm.JvmName("CollectionsKt") + +package kotlin.collections + +// +// NOTE THIS FILE IS AUTO-GENERATED by the GenerateStandardLib.kt +// See: https://github.com/JetBrains/kotlin/tree/master/libraries/stdlib +// + +import kotlin.comparisons.* + +/** + * Returns 1st *element* from the collection. + */ +@kotlin.internal.InlineOnly +public header inline operator fun List.component1(): T + +/** + * Returns 2nd *element* from the collection. + */ +@kotlin.internal.InlineOnly +public header inline operator fun List.component2(): T + +/** + * Returns 3rd *element* from the collection. + */ +@kotlin.internal.InlineOnly +public header inline operator fun List.component3(): T + +/** + * Returns 4th *element* from the collection. + */ +@kotlin.internal.InlineOnly +public header inline operator fun List.component4(): T + +/** + * Returns 5th *element* from the collection. + */ +@kotlin.internal.InlineOnly +public header inline operator fun List.component5(): T + +/** + * Returns `true` if [element] is found in the collection. + */ +public header operator fun <@kotlin.internal.OnlyInputTypes T> Iterable.contains(element: T): Boolean + +/** + * Returns an element at the given [index] or throws an [IndexOutOfBoundsException] if the [index] is out of bounds of this collection. + */ +public header fun Iterable.elementAt(index: Int): T + +/** + * Returns an element at the given [index] or throws an [IndexOutOfBoundsException] if the [index] is out of bounds of this list. + */ +@kotlin.internal.InlineOnly +public header inline fun List.elementAt(index: Int): T + +/** + * Returns an element at the given [index] or the result of calling the [defaultValue] function if the [index] is out of bounds of this collection. + */ +public header fun Iterable.elementAtOrElse(index: Int, defaultValue: (Int) -> T): T + +/** + * Returns an element at the given [index] or the result of calling the [defaultValue] function if the [index] is out of bounds of this list. + */ +@kotlin.internal.InlineOnly +public header inline fun List.elementAtOrElse(index: Int, defaultValue: (Int) -> T): T + +/** + * Returns an element at the given [index] or `null` if the [index] is out of bounds of this collection. + */ +public header fun Iterable.elementAtOrNull(index: Int): T? + +/** + * Returns an element at the given [index] or `null` if the [index] is out of bounds of this list. + */ +@kotlin.internal.InlineOnly +public header inline fun List.elementAtOrNull(index: Int): T? + +/** + * Returns the first element matching the given [predicate], or `null` if no such element was found. + */ +@kotlin.internal.InlineOnly +public header inline fun Iterable.find(predicate: (T) -> Boolean): T? + +/** + * Returns the last element matching the given [predicate], or `null` if no such element was found. + */ +@kotlin.internal.InlineOnly +public header inline fun Iterable.findLast(predicate: (T) -> Boolean): T? + +/** + * Returns the last element matching the given [predicate], or `null` if no such element was found. + */ +@kotlin.internal.InlineOnly +public header inline fun List.findLast(predicate: (T) -> Boolean): T? + +/** + * Returns first element. + * @throws [NoSuchElementException] if the collection is empty. + */ +public header fun Iterable.first(): T + +/** + * Returns first element. + * @throws [NoSuchElementException] if the list is empty. + */ +public header fun List.first(): T + +/** + * Returns the first element matching the given [predicate]. + * @throws [NoSuchElementException] if no such element is found. + */ +public header inline fun Iterable.first(predicate: (T) -> Boolean): T + +/** + * Returns the first element, or `null` if the collection is empty. + */ +public header fun Iterable.firstOrNull(): T? + +/** + * Returns the first element, or `null` if the list is empty. + */ +public header fun List.firstOrNull(): T? + +/** + * Returns the first element matching the given [predicate], or `null` if element was not found. + */ +public header inline fun Iterable.firstOrNull(predicate: (T) -> Boolean): T? + +/** + * Returns an element at the given [index] or the result of calling the [defaultValue] function if the [index] is out of bounds of this list. + */ +@kotlin.internal.InlineOnly +public header inline fun List.getOrElse(index: Int, defaultValue: (Int) -> T): T + +/** + * Returns an element at the given [index] or `null` if the [index] is out of bounds of this list. + */ +public header fun List.getOrNull(index: Int): T? + +/** + * Returns first index of [element], or -1 if the collection does not contain element. + */ +public header fun <@kotlin.internal.OnlyInputTypes T> Iterable.indexOf(element: T): Int + +/** + * Returns first index of [element], or -1 if the list does not contain element. + */ +public header fun <@kotlin.internal.OnlyInputTypes T> List.indexOf(element: T): Int + +/** + * Returns index of the first element matching the given [predicate], or -1 if the collection does not contain such element. + */ +public header inline fun Iterable.indexOfFirst(predicate: (T) -> Boolean): Int + +/** + * Returns index of the first element matching the given [predicate], or -1 if the list does not contain such element. + */ +public header inline fun List.indexOfFirst(predicate: (T) -> Boolean): Int + +/** + * Returns index of the last element matching the given [predicate], or -1 if the collection does not contain such element. + */ +public header inline fun Iterable.indexOfLast(predicate: (T) -> Boolean): Int + +/** + * Returns index of the last element matching the given [predicate], or -1 if the list does not contain such element. + */ +public header inline fun List.indexOfLast(predicate: (T) -> Boolean): Int + +/** + * Returns the last element. + * @throws [NoSuchElementException] if the collection is empty. + */ +public header fun Iterable.last(): T + +/** + * Returns the last element. + * @throws [NoSuchElementException] if the list is empty. + */ +public header fun List.last(): T + +/** + * Returns the last element matching the given [predicate]. + * @throws [NoSuchElementException] if no such element is found. + */ +public header inline fun Iterable.last(predicate: (T) -> Boolean): T + +/** + * Returns the last element matching the given [predicate]. + * @throws [NoSuchElementException] if no such element is found. + */ +public header inline fun List.last(predicate: (T) -> Boolean): T + +/** + * Returns last index of [element], or -1 if the collection does not contain element. + */ +public header fun <@kotlin.internal.OnlyInputTypes T> Iterable.lastIndexOf(element: T): Int + +/** + * Returns last index of [element], or -1 if the list does not contain element. + */ +public header fun <@kotlin.internal.OnlyInputTypes T> List.lastIndexOf(element: T): Int + +/** + * Returns the last element, or `null` if the collection is empty. + */ +public header fun Iterable.lastOrNull(): T? + +/** + * Returns the last element, or `null` if the list is empty. + */ +public header fun List.lastOrNull(): T? + +/** + * Returns the last element matching the given [predicate], or `null` if no such element was found. + */ +public header inline fun Iterable.lastOrNull(predicate: (T) -> Boolean): T? + +/** + * Returns the last element matching the given [predicate], or `null` if no such element was found. + */ +public header inline fun List.lastOrNull(predicate: (T) -> Boolean): T? + +/** + * Returns the single element, or throws an exception if the collection is empty or has more than one element. + */ +public header fun Iterable.single(): T + +/** + * Returns the single element, or throws an exception if the list is empty or has more than one element. + */ +public header fun List.single(): T + +/** + * Returns the single element matching the given [predicate], or throws exception if there is no or more than one matching element. + */ +public header inline fun Iterable.single(predicate: (T) -> Boolean): T + +/** + * Returns single element, or `null` if the collection is empty or has more than one element. + */ +public header fun Iterable.singleOrNull(): T? + +/** + * Returns single element, or `null` if the list is empty or has more than one element. + */ +public header fun List.singleOrNull(): T? + +/** + * Returns the single element matching the given [predicate], or `null` if element was not found or more than one element was found. + */ +public header inline fun Iterable.singleOrNull(predicate: (T) -> Boolean): T? + +/** + * Returns a list containing all elements except first [n] elements. + */ +public header fun Iterable.drop(n: Int): List + +/** + * Returns a list containing all elements except last [n] elements. + */ +public header fun List.dropLast(n: Int): List + +/** + * Returns a list containing all elements except last elements that satisfy the given [predicate]. + */ +public header inline fun List.dropLastWhile(predicate: (T) -> Boolean): List + +/** + * Returns a list containing all elements except first elements that satisfy the given [predicate]. + */ +public header inline fun Iterable.dropWhile(predicate: (T) -> Boolean): List + +/** + * Returns a list containing only elements matching the given [predicate]. + */ +public header inline fun Iterable.filter(predicate: (T) -> Boolean): List + +/** + * Returns a list containing only elements matching the given [predicate]. + * @param [predicate] function that takes the index of an element and the element itself + * and returns the result of predicate evaluation on the element. + */ +public header inline fun Iterable.filterIndexed(predicate: (Int, T) -> Boolean): List + +/** + * Appends all elements matching the given [predicate] to the given [destination]. + * @param [predicate] function that takes the index of an element and the element itself + * and returns the result of predicate evaluation on the element. + */ +public header inline fun > Iterable.filterIndexedTo(destination: C, predicate: (Int, T) -> Boolean): C + +/** + * Returns a list containing all elements that are instances of specified type parameter R. + */ +public header inline fun Iterable<*>.filterIsInstance(): List<@kotlin.internal.NoInfer R> + +/** + * Appends all elements that are instances of specified type parameter R to the given [destination]. + */ +public header inline fun > Iterable<*>.filterIsInstanceTo(destination: C): C + +/** + * Returns a list containing all elements not matching the given [predicate]. + */ +public header inline fun Iterable.filterNot(predicate: (T) -> Boolean): List + +/** + * Returns a list containing all elements that are not `null`. + */ +public header fun Iterable.filterNotNull(): List + +/** + * Appends all elements that are not `null` to the given [destination]. + */ +public header fun , T : Any> Iterable.filterNotNullTo(destination: C): C + +/** + * Appends all elements not matching the given [predicate] to the given [destination]. + */ +public header inline fun > Iterable.filterNotTo(destination: C, predicate: (T) -> Boolean): C + +/** + * Appends all elements matching the given [predicate] to the given [destination]. + */ +public header inline fun > Iterable.filterTo(destination: C, predicate: (T) -> Boolean): C + +/** + * Returns a list containing elements at indices in the specified [indices] range. + */ +public header fun List.slice(indices: IntRange): List + +/** + * Returns a list containing elements at specified [indices]. + */ +public header fun List.slice(indices: Iterable): List + +/** + * Returns a list containing first [n] elements. + */ +public header fun Iterable.take(n: Int): List + +/** + * Returns a list containing last [n] elements. + */ +public header fun List.takeLast(n: Int): List + +/** + * Returns a list containing last elements satisfying the given [predicate]. + */ +public header inline fun List.takeLastWhile(predicate: (T) -> Boolean): List + +/** + * Returns a list containing first elements satisfying the given [predicate]. + */ +public header inline fun Iterable.takeWhile(predicate: (T) -> Boolean): List + +/** + * Reverses elements in the list in-place. + */ +public header fun MutableList.reverse(): Unit + +/** + * Returns a list with elements in reversed order. + */ +public header fun Iterable.reversed(): List + +/** + * Sorts elements in the list in-place according to natural sort order of the value returned by specified [selector] function. + */ +public header inline fun > MutableList.sortBy(crossinline selector: (T) -> R?): Unit + +/** + * Sorts elements in the list in-place descending according to natural sort order of the value returned by specified [selector] function. + */ +public header inline fun > MutableList.sortByDescending(crossinline selector: (T) -> R?): Unit + +/** + * Sorts elements in the list in-place descending according to their natural sort order. + */ +public header fun > MutableList.sortDescending(): Unit + +/** + * Returns a list of all elements sorted according to their natural sort order. + */ +public header fun > Iterable.sorted(): List + +/** + * Returns a list of all elements sorted according to natural sort order of the value returned by specified [selector] function. + */ +public header inline fun > Iterable.sortedBy(crossinline selector: (T) -> R?): List + +/** + * Returns a list of all elements sorted descending according to natural sort order of the value returned by specified [selector] function. + */ +public header inline fun > Iterable.sortedByDescending(crossinline selector: (T) -> R?): List + +/** + * Returns a list of all elements sorted descending according to their natural sort order. + */ +public header fun > Iterable.sortedDescending(): List + +/** + * Returns a list of all elements sorted according to the specified [comparator]. + */ +public header fun Iterable.sortedWith(comparator: Comparator): List + +/** + * Returns an array of Boolean containing all of the elements of this collection. + */ +public header fun Collection.toBooleanArray(): BooleanArray + +/** + * Returns an array of Byte containing all of the elements of this collection. + */ +public header fun Collection.toByteArray(): ByteArray + +/** + * Returns an array of Char containing all of the elements of this collection. + */ +public header fun Collection.toCharArray(): CharArray + +/** + * Returns an array of Double containing all of the elements of this collection. + */ +public header fun Collection.toDoubleArray(): DoubleArray + +/** + * Returns an array of Float containing all of the elements of this collection. + */ +public header fun Collection.toFloatArray(): FloatArray + +/** + * Returns an array of Int containing all of the elements of this collection. + */ +public header fun Collection.toIntArray(): IntArray + +/** + * Returns an array of Long containing all of the elements of this collection. + */ +public header fun Collection.toLongArray(): LongArray + +/** + * Returns an array of Short containing all of the elements of this collection. + */ +public header fun Collection.toShortArray(): ShortArray + +/** + * Returns a [Map] containing key-value pairs provided by [transform] function + * applied to elements of the given collection. + * + * If any of two pairs would have the same key the last one gets added to the map. + * + * The returned map preserves the entry iteration order of the original collection. + */ +public header inline fun Iterable.associate(transform: (T) -> Pair): Map + +/** + * Returns a [Map] containing the elements from the given collection indexed by the key + * returned from [keySelector] function applied to each element. + * + * If any two elements would have the same key returned by [keySelector] the last one gets added to the map. + * + * The returned map preserves the entry iteration order of the original collection. + */ +public header inline fun Iterable.associateBy(keySelector: (T) -> K): Map + +/** + * Returns a [Map] containing the values provided by [valueTransform] and indexed by [keySelector] functions applied to elements of the given collection. + * + * If any two elements would have the same key returned by [keySelector] the last one gets added to the map. + * + * The returned map preserves the entry iteration order of the original collection. + */ +public header inline fun Iterable.associateBy(keySelector: (T) -> K, valueTransform: (T) -> V): Map + +/** + * Populates and returns the [destination] mutable map with key-value pairs, + * where key is provided by the [keySelector] function applied to each element of the given collection + * and value is the element itself. + * + * If any two elements would have the same key returned by [keySelector] the last one gets added to the map. + */ +public header inline fun > Iterable.associateByTo(destination: M, keySelector: (T) -> K): M + +/** + * Populates and returns the [destination] mutable map with key-value pairs, + * where key is provided by the [keySelector] function and + * and value is provided by the [valueTransform] function applied to elements of the given collection. + * + * If any two elements would have the same key returned by [keySelector] the last one gets added to the map. + */ +public header inline fun > Iterable.associateByTo(destination: M, keySelector: (T) -> K, valueTransform: (T) -> V): M + +/** + * Populates and returns the [destination] mutable map with key-value pairs + * provided by [transform] function applied to each element of the given collection. + * + * If any of two pairs would have the same key the last one gets added to the map. + */ +public header inline fun > Iterable.associateTo(destination: M, transform: (T) -> Pair): M + +/** + * Appends all elements to the given [destination] collection. + */ +public header fun > Iterable.toCollection(destination: C): C + +/** + * Returns a [HashSet] of all elements. + */ +public header fun Iterable.toHashSet(): HashSet + +/** + * Returns a [List] containing all elements. + */ +public header fun Iterable.toList(): List + +/** + * Returns a [MutableList] filled with all elements of this collection. + */ +public header fun Iterable.toMutableList(): MutableList + +/** + * Returns a [MutableList] filled with all elements of this collection. + */ +public header fun Collection.toMutableList(): MutableList + +/** + * Returns a [Set] of all elements. + * + * The returned set preserves the element iteration order of the original collection. + */ +public header fun Iterable.toSet(): Set + +/** + * Returns a single list of all elements yielded from results of [transform] function being invoked on each element of original collection. + */ +public header inline fun Iterable.flatMap(transform: (T) -> Iterable): List + +/** + * Appends all elements yielded from results of [transform] function being invoked on each element of original collection, to the given [destination]. + */ +public header inline fun > Iterable.flatMapTo(destination: C, transform: (T) -> Iterable): C + +/** + * Groups elements of the original collection by the key returned by the given [keySelector] function + * applied to each element and returns a map where each group key is associated with a list of corresponding elements. + * + * The returned map preserves the entry iteration order of the keys produced from the original collection. + * + * @sample samples.collections.Collections.Transformations.groupBy + */ +public header inline fun Iterable.groupBy(keySelector: (T) -> K): Map> + +/** + * Groups values returned by the [valueTransform] function applied to each element of the original collection + * by the key returned by the given [keySelector] function applied to the element + * and returns a map where each group key is associated with a list of corresponding values. + * + * The returned map preserves the entry iteration order of the keys produced from the original collection. + * + * @sample samples.collections.Collections.Transformations.groupByKeysAndValues + */ +public header inline fun Iterable.groupBy(keySelector: (T) -> K, valueTransform: (T) -> V): Map> + +/** + * Groups elements of the original collection by the key returned by the given [keySelector] function + * applied to each element and puts to the [destination] map each group key associated with a list of corresponding elements. + * + * @return The [destination] map. + * + * @sample samples.collections.Collections.Transformations.groupBy + */ +public header inline fun >> Iterable.groupByTo(destination: M, keySelector: (T) -> K): M + +/** + * Groups values returned by the [valueTransform] function applied to each element of the original collection + * by the key returned by the given [keySelector] function applied to the element + * and puts to the [destination] map each group key associated with a list of corresponding values. + * + * @return The [destination] map. + * + * @sample samples.collections.Collections.Transformations.groupByKeysAndValues + */ +public header inline fun >> Iterable.groupByTo(destination: M, keySelector: (T) -> K, valueTransform: (T) -> V): M + +/** + * Returns a list containing the results of applying the given [transform] function + * to each element in the original collection. + */ +@Suppress("NON_PUBLIC_CALL_FROM_PUBLIC_INLINE") +public header inline fun Iterable.map(transform: (T) -> R): List + +/** + * Returns a list containing the results of applying the given [transform] function + * to each element and its index in the original collection. + * @param [transform] function that takes the index of an element and the element itself + * and returns the result of the transform applied to the element. + */ +@Suppress("NON_PUBLIC_CALL_FROM_PUBLIC_INLINE") +public header inline fun Iterable.mapIndexed(transform: (Int, T) -> R): List + +/** + * Returns a list containing only the non-null results of applying the given [transform] function + * to each element and its index in the original collection. + * @param [transform] function that takes the index of an element and the element itself + * and returns the result of the transform applied to the element. + */ +public header inline fun Iterable.mapIndexedNotNull(transform: (Int, T) -> R?): List + +/** + * Applies the given [transform] function to each element and its index in the original collection + * and appends only the non-null results to the given [destination]. + * @param [transform] function that takes the index of an element and the element itself + * and returns the result of the transform applied to the element. + */ +public header inline fun > Iterable.mapIndexedNotNullTo(destination: C, transform: (Int, T) -> R?): C + +/** + * Applies the given [transform] function to each element and its index in the original collection + * and appends the results to the given [destination]. + * @param [transform] function that takes the index of an element and the element itself + * and returns the result of the transform applied to the element. + */ +public header inline fun > Iterable.mapIndexedTo(destination: C, transform: (Int, T) -> R): C + +/** + * Returns a list containing only the non-null results of applying the given [transform] function + * to each element in the original collection. + */ +public header inline fun Iterable.mapNotNull(transform: (T) -> R?): List + +/** + * Applies the given [transform] function to each element in the original collection + * and appends only the non-null results to the given [destination]. + */ +public header inline fun > Iterable.mapNotNullTo(destination: C, transform: (T) -> R?): C + +/** + * Applies the given [transform] function to each element of the original collection + * and appends the results to the given [destination]. + */ +public header inline fun > Iterable.mapTo(destination: C, transform: (T) -> R): C + +/** + * Returns a lazy [Iterable] of [IndexedValue] for each element of the original collection. + */ +public header fun Iterable.withIndex(): Iterable> + +/** + * Returns a list containing only distinct elements from the given collection. + * + * The elements in the resulting list are in the same order as they were in the source collection. + */ +public header fun Iterable.distinct(): List + +/** + * Returns a list containing only elements from the given collection + * having distinct keys returned by the given [selector] function. + * + * The elements in the resulting list are in the same order as they were in the source collection. + */ +public header inline fun Iterable.distinctBy(selector: (T) -> K): List + +/** + * Returns a set containing all elements that are contained by both this set and the specified collection. + * + * The returned set preserves the element iteration order of the original collection. + */ +public header infix fun Iterable.intersect(other: Iterable): Set + +/** + * Returns a set containing all elements that are contained by this collection and not contained by the specified collection. + * + * The returned set preserves the element iteration order of the original collection. + */ +public header infix fun Iterable.subtract(other: Iterable): Set + +/** + * Returns a mutable set containing all distinct elements from the given collection. + * + * The returned set preserves the element iteration order of the original collection. + */ +public header fun Iterable.toMutableSet(): MutableSet + +/** + * Returns a set containing all distinct elements from both collections. + * + * The returned set preserves the element iteration order of the original collection. + * Those elements of the [other] collection that are unique are iterated in the end + * in the order of the [other] collection. + */ +public header infix fun Iterable.union(other: Iterable): Set + +/** + * Returns `true` if all elements match the given [predicate]. + */ +public header inline fun Iterable.all(predicate: (T) -> Boolean): Boolean + +/** + * Returns `true` if collection has at least one element. + */ +public header fun Iterable.any(): Boolean + +/** + * Returns `true` if at least one element matches the given [predicate]. + */ +public header inline fun Iterable.any(predicate: (T) -> Boolean): Boolean + +/** + * Returns the number of elements in this collection. + */ +public header fun Iterable.count(): Int + +/** + * Returns the number of elements in this collection. + */ +@kotlin.internal.InlineOnly +public header inline fun Collection.count(): Int + +/** + * Returns the number of elements matching the given [predicate]. + */ +public header inline fun Iterable.count(predicate: (T) -> Boolean): Int + +/** + * Accumulates value starting with [initial] value and applying [operation] from left to right to current accumulator value and each element. + */ +public header inline fun Iterable.fold(initial: R, operation: (R, T) -> R): R + +/** + * Accumulates value starting with [initial] value and applying [operation] from left to right + * to current accumulator value and each element with its index in the original collection. + * @param [operation] function that takes the index of an element, current accumulator value + * and the element itself, and calculates the next accumulator value. + */ +public header inline fun Iterable.foldIndexed(initial: R, operation: (Int, R, T) -> R): R + +/** + * Accumulates value starting with [initial] value and applying [operation] from right to left to each element and current accumulator value. + */ +public header inline fun List.foldRight(initial: R, operation: (T, R) -> R): R + +/** + * Accumulates value starting with [initial] value and applying [operation] from right to left + * to each element with its index in the original list and current accumulator value. + * @param [operation] function that takes the index of an element, the element itself + * and current accumulator value, and calculates the next accumulator value. + */ +public header inline fun List.foldRightIndexed(initial: R, operation: (Int, T, R) -> R): R + +/** + * Performs the given [action] on each element. + */ +@kotlin.internal.HidesMembers +public header inline fun Iterable.forEach(action: (T) -> Unit): Unit + +/** + * Performs the given [action] on each element, providing sequential index with the element. + * @param [action] function that takes the index of an element and the element itself + * and performs the desired action on the element. + */ +public header inline fun Iterable.forEachIndexed(action: (Int, T) -> Unit): Unit + +/** + * Returns the largest element or `null` if there are no elements. + */ +public header fun > Iterable.max(): T? + +/** + * Returns the first element yielding the largest value of the given function or `null` if there are no elements. + */ +public header inline fun > Iterable.maxBy(selector: (T) -> R): T? + +/** + * Returns the first element having the largest value according to the provided [comparator] or `null` if there are no elements. + */ +public header fun Iterable.maxWith(comparator: Comparator): T? + +/** + * Returns the smallest element or `null` if there are no elements. + */ +public header fun > Iterable.min(): T? + +/** + * Returns the first element yielding the smallest value of the given function or `null` if there are no elements. + */ +public header inline fun > Iterable.minBy(selector: (T) -> R): T? + +/** + * Returns the first element having the smallest value according to the provided [comparator] or `null` if there are no elements. + */ +public header fun Iterable.minWith(comparator: Comparator): T? + +/** + * Returns `true` if the collection has no elements. + */ +public header fun Iterable.none(): Boolean + +/** + * Returns `true` if no elements match the given [predicate]. + */ +public header inline fun Iterable.none(predicate: (T) -> Boolean): Boolean + +/** + * Performs the given [action] on each element and returns the collection itself afterwards. + */ +@SinceKotlin("1.1") +public header inline fun > C.onEach(action: (T) -> Unit): C + +/** + * Accumulates value starting with the first element and applying [operation] from left to right to current accumulator value and each element. + */ +public header inline fun Iterable.reduce(operation: (S, T) -> S): S + +/** + * Accumulates value starting with the first element and applying [operation] from left to right + * to current accumulator value and each element with its index in the original collection. + * @param [operation] function that takes the index of an element, current accumulator value + * and the element itself and calculates the next accumulator value. + */ +public header inline fun Iterable.reduceIndexed(operation: (Int, S, T) -> S): S + +/** + * Accumulates value starting with last element and applying [operation] from right to left to each element and current accumulator value. + */ +public header inline fun List.reduceRight(operation: (T, S) -> S): S + +/** + * Accumulates value starting with last element and applying [operation] from right to left + * to each element with its index in the original list and current accumulator value. + * @param [operation] function that takes the index of an element, the element itself + * and current accumulator value, and calculates the next accumulator value. + */ +public header inline fun List.reduceRightIndexed(operation: (Int, T, S) -> S): S + +/** + * Returns the sum of all values produced by [selector] function applied to each element in the collection. + */ +public header inline fun Iterable.sumBy(selector: (T) -> Int): Int + +/** + * Returns the sum of all values produced by [selector] function applied to each element in the collection. + */ +public header inline fun Iterable.sumByDouble(selector: (T) -> Double): Double + +/** + * Returns an original collection containing all the non-`null` elements, throwing an [IllegalArgumentException] if there are any `null` elements. + */ +public header fun Iterable.requireNoNulls(): Iterable + +/** + * Returns an original collection containing all the non-`null` elements, throwing an [IllegalArgumentException] if there are any `null` elements. + */ +public header fun List.requireNoNulls(): List + +/** + * Returns a list containing all elements of the original collection without the first occurrence of the given [element]. + */ +public header operator fun Iterable.minus(element: T): List + +/** + * Returns a list containing all elements of the original collection except the elements contained in the given [elements] array. + */ +public header operator fun Iterable.minus(elements: Array): List + +/** + * Returns a list containing all elements of the original collection except the elements contained in the given [elements] collection. + */ +public header operator fun Iterable.minus(elements: Iterable): List + +/** + * Returns a list containing all elements of the original collection except the elements contained in the given [elements] sequence. + */ +public header operator fun Iterable.minus(elements: Sequence): List + +/** + * Returns a list containing all elements of the original collection without the first occurrence of the given [element]. + */ +@kotlin.internal.InlineOnly +public header inline fun Iterable.minusElement(element: T): List + +/** + * Splits the original collection into pair of lists, + * where *first* list contains elements for which [predicate] yielded `true`, + * while *second* list contains elements for which [predicate] yielded `false`. + */ +public header inline fun Iterable.partition(predicate: (T) -> Boolean): Pair, List> + +/** + * Returns a list containing all elements of the original collection and then the given [element]. + */ +public header operator fun Iterable.plus(element: T): List + +/** + * Returns a list containing all elements of the original collection and then the given [element]. + */ +public header operator fun Collection.plus(element: T): List + +/** + * Returns a list containing all elements of the original collection and then all elements of the given [elements] array. + */ +public header operator fun Iterable.plus(elements: Array): List + +/** + * Returns a list containing all elements of the original collection and then all elements of the given [elements] array. + */ +public header operator fun Collection.plus(elements: Array): List + +/** + * Returns a list containing all elements of the original collection and then all elements of the given [elements] collection. + */ +public header operator fun Iterable.plus(elements: Iterable): List + +/** + * Returns a list containing all elements of the original collection and then all elements of the given [elements] collection. + */ +public header operator fun Collection.plus(elements: Iterable): List + +/** + * Returns a list containing all elements of the original collection and then all elements of the given [elements] sequence. + */ +public header operator fun Iterable.plus(elements: Sequence): List + +/** + * Returns a list containing all elements of the original collection and then all elements of the given [elements] sequence. + */ +public header operator fun Collection.plus(elements: Sequence): List + +/** + * Returns a list containing all elements of the original collection and then the given [element]. + */ +@kotlin.internal.InlineOnly +public header inline fun Iterable.plusElement(element: T): List + +/** + * Returns a list containing all elements of the original collection and then the given [element]. + */ +@kotlin.internal.InlineOnly +public header inline fun Collection.plusElement(element: T): List + +/** + * Returns a list of pairs built from elements of both collections with same indexes. List has length of shortest collection. + */ +public header infix fun Iterable.zip(other: Array): List> + +/** + * Returns a list of values built from elements of both collections with same indexes using provided [transform]. List has length of shortest collection. + */ +public header inline fun Iterable.zip(other: Array, transform: (T, R) -> V): List + +/** + * Returns a list of pairs built from elements of both collections with same indexes. List has length of shortest collection. + */ +public header infix fun Iterable.zip(other: Iterable): List> + +/** + * Returns a list of values built from elements of both collections with same indexes using provided [transform]. List has length of shortest collection. + */ +public header inline fun Iterable.zip(other: Iterable, transform: (T, R) -> V): List + +/** + * Appends the string from all the elements separated using [separator] and using the given [prefix] and [postfix] if supplied. + * + * If the collection could be huge, you can specify a non-negative value of [limit], in which case only the first [limit] + * elements will be appended, followed by the [truncated] string (which defaults to "..."). + */ +public header fun Iterable.joinTo(buffer: A, separator: CharSequence = ", ", prefix: CharSequence = "", postfix: CharSequence = "", limit: Int = -1, truncated: CharSequence = "...", transform: ((T) -> CharSequence)? = null): A + +/** + * Creates a string from all the elements separated using [separator] and using the given [prefix] and [postfix] if supplied. + * + * If the collection could be huge, you can specify a non-negative value of [limit], in which case only the first [limit] + * elements will be appended, followed by the [truncated] string (which defaults to "..."). + */ +public header fun Iterable.joinToString(separator: CharSequence = ", ", prefix: CharSequence = "", postfix: CharSequence = "", limit: Int = -1, truncated: CharSequence = "...", transform: ((T) -> CharSequence)? = null): String + +/** + * Returns this collection as an [Iterable]. + */ +@kotlin.internal.InlineOnly +public header inline fun Iterable.asIterable(): Iterable + +/** + * Creates a [Sequence] instance that wraps the original collection returning its elements when being iterated. + */ +public header fun Iterable.asSequence(): Sequence + +/** + * Returns an average value of elements in the collection. + */ +@kotlin.jvm.JvmName("averageOfByte") +public header fun Iterable.average(): Double + +/** + * Returns an average value of elements in the collection. + */ +@kotlin.jvm.JvmName("averageOfShort") +public header fun Iterable.average(): Double + +/** + * Returns an average value of elements in the collection. + */ +@kotlin.jvm.JvmName("averageOfInt") +public header fun Iterable.average(): Double + +/** + * Returns an average value of elements in the collection. + */ +@kotlin.jvm.JvmName("averageOfLong") +public header fun Iterable.average(): Double + +/** + * Returns an average value of elements in the collection. + */ +@kotlin.jvm.JvmName("averageOfFloat") +public header fun Iterable.average(): Double + +/** + * Returns an average value of elements in the collection. + */ +@kotlin.jvm.JvmName("averageOfDouble") +public header fun Iterable.average(): Double + +/** + * Returns the sum of all elements in the collection. + */ +@kotlin.jvm.JvmName("sumOfByte") +public header fun Iterable.sum(): Int + +/** + * Returns the sum of all elements in the collection. + */ +@kotlin.jvm.JvmName("sumOfShort") +public header fun Iterable.sum(): Int + +/** + * Returns the sum of all elements in the collection. + */ +@kotlin.jvm.JvmName("sumOfInt") +public header fun Iterable.sum(): Int + +/** + * Returns the sum of all elements in the collection. + */ +@kotlin.jvm.JvmName("sumOfLong") +public header fun Iterable.sum(): Long + +/** + * Returns the sum of all elements in the collection. + */ +@kotlin.jvm.JvmName("sumOfFloat") +public header fun Iterable.sum(): Float + +/** + * Returns the sum of all elements in the collection. + */ +@kotlin.jvm.JvmName("sumOfDouble") +public header fun Iterable.sum(): Double + diff --git a/libraries/stdlib/common/src/generated/_Maps.kt b/libraries/stdlib/common/src/generated/_Maps.kt new file mode 100644 index 00000000000..9bb0917a0be --- /dev/null +++ b/libraries/stdlib/common/src/generated/_Maps.kt @@ -0,0 +1,132 @@ +@file:kotlin.jvm.JvmMultifileClass +@file:kotlin.jvm.JvmName("MapsKt") + +package kotlin.collections + +// +// NOTE THIS FILE IS AUTO-GENERATED by the GenerateStandardLib.kt +// See: https://github.com/JetBrains/kotlin/tree/master/libraries/stdlib +// + +import kotlin.comparisons.* + +/** + * Returns a [List] containing all key-value pairs. + */ +public header fun Map.toList(): List> + +/** + * Returns a single list of all elements yielded from results of [transform] function being invoked on each entry of original map. + */ +public header inline fun Map.flatMap(transform: (Map.Entry) -> Iterable): List + +/** + * Appends all elements yielded from results of [transform] function being invoked on each entry of original map, to the given [destination]. + */ +public header inline fun > Map.flatMapTo(destination: C, transform: (Map.Entry) -> Iterable): C + +/** + * Returns a list containing the results of applying the given [transform] function + * to each entry in the original map. + */ +public header inline fun Map.map(transform: (Map.Entry) -> R): List + +/** + * Returns a list containing only the non-null results of applying the given [transform] function + * to each entry in the original map. + */ +public header inline fun Map.mapNotNull(transform: (Map.Entry) -> R?): List + +/** + * Applies the given [transform] function to each entry in the original map + * and appends only the non-null results to the given [destination]. + */ +public header inline fun > Map.mapNotNullTo(destination: C, transform: (Map.Entry) -> R?): C + +/** + * Applies the given [transform] function to each entry of the original map + * and appends the results to the given [destination]. + */ +public header inline fun > Map.mapTo(destination: C, transform: (Map.Entry) -> R): C + +/** + * Returns `true` if all entries match the given [predicate]. + */ +public header inline fun Map.all(predicate: (Map.Entry) -> Boolean): Boolean + +/** + * Returns `true` if map has at least one entry. + */ +public header fun Map.any(): Boolean + +/** + * Returns `true` if at least one entry matches the given [predicate]. + */ +public header inline fun Map.any(predicate: (Map.Entry) -> Boolean): Boolean + +/** + * Returns the number of entries in this map. + */ +@kotlin.internal.InlineOnly +public header inline fun Map.count(): Int + +/** + * Returns the number of entries matching the given [predicate]. + */ +public header inline fun Map.count(predicate: (Map.Entry) -> Boolean): Int + +/** + * Performs the given [action] on each entry. + */ +@kotlin.internal.HidesMembers +public header inline fun Map.forEach(action: (Map.Entry) -> Unit): Unit + +/** + * Returns the first entry yielding the largest value of the given function or `null` if there are no entries. + */ +@kotlin.internal.InlineOnly +public header inline fun > Map.maxBy(selector: (Map.Entry) -> R): Map.Entry? + +/** + * Returns the first entry having the largest value according to the provided [comparator] or `null` if there are no entries. + */ +@kotlin.internal.InlineOnly +public header inline fun Map.maxWith(comparator: Comparator>): Map.Entry? + +/** + * Returns the first entry yielding the smallest value of the given function or `null` if there are no entries. + */ +public header inline fun > Map.minBy(selector: (Map.Entry) -> R): Map.Entry? + +/** + * Returns the first entry having the smallest value according to the provided [comparator] or `null` if there are no entries. + */ +public header fun Map.minWith(comparator: Comparator>): Map.Entry? + +/** + * Returns `true` if the map has no entries. + */ +public header fun Map.none(): Boolean + +/** + * Returns `true` if no entries match the given [predicate]. + */ +public header inline fun Map.none(predicate: (Map.Entry) -> Boolean): Boolean + +/** + * Performs the given [action] on each entry and returns the map itself afterwards. + */ +@SinceKotlin("1.1") +public header inline fun > M.onEach(action: (Map.Entry) -> Unit): M + +/** + * Creates an [Iterable] instance that wraps the original map returning its entries when being iterated. + */ +@kotlin.internal.InlineOnly +public header inline fun Map.asIterable(): Iterable> + +/** + * Creates a [Sequence] instance that wraps the original map returning its entries when being iterated. + */ +public header fun Map.asSequence(): Sequence> + diff --git a/libraries/stdlib/common/src/generated/_Ranges.kt b/libraries/stdlib/common/src/generated/_Ranges.kt new file mode 100644 index 00000000000..1c8f7a89983 --- /dev/null +++ b/libraries/stdlib/common/src/generated/_Ranges.kt @@ -0,0 +1,645 @@ +@file:kotlin.jvm.JvmMultifileClass +@file:kotlin.jvm.JvmName("RangesKt") + +package kotlin.ranges + +// +// NOTE THIS FILE IS AUTO-GENERATED by the GenerateStandardLib.kt +// See: https://github.com/JetBrains/kotlin/tree/master/libraries/stdlib +// + +import kotlin.comparisons.* + +/** + * Checks if the specified [value] belongs to this range. + */ +@kotlin.jvm.JvmName("intRangeContains") +public header operator fun ClosedRange.contains(value: Byte): Boolean + +/** + * Checks if the specified [value] belongs to this range. + */ +@kotlin.jvm.JvmName("longRangeContains") +public header operator fun ClosedRange.contains(value: Byte): Boolean + +/** + * Checks if the specified [value] belongs to this range. + */ +@kotlin.jvm.JvmName("shortRangeContains") +public header operator fun ClosedRange.contains(value: Byte): Boolean + +/** + * Checks if the specified [value] belongs to this range. + */ +@kotlin.jvm.JvmName("doubleRangeContains") +public header operator fun ClosedRange.contains(value: Byte): Boolean + +/** + * Checks if the specified [value] belongs to this range. + */ +@kotlin.jvm.JvmName("floatRangeContains") +public header operator fun ClosedRange.contains(value: Byte): Boolean + +/** + * Checks if the specified [value] belongs to this range. + */ +@kotlin.jvm.JvmName("intRangeContains") +public header operator fun ClosedRange.contains(value: Double): Boolean + +/** + * Checks if the specified [value] belongs to this range. + */ +@kotlin.jvm.JvmName("longRangeContains") +public header operator fun ClosedRange.contains(value: Double): Boolean + +/** + * Checks if the specified [value] belongs to this range. + */ +@kotlin.jvm.JvmName("byteRangeContains") +public header operator fun ClosedRange.contains(value: Double): Boolean + +/** + * Checks if the specified [value] belongs to this range. + */ +@kotlin.jvm.JvmName("shortRangeContains") +public header operator fun ClosedRange.contains(value: Double): Boolean + +/** + * Checks if the specified [value] belongs to this range. + */ +@kotlin.jvm.JvmName("floatRangeContains") +public header operator fun ClosedRange.contains(value: Double): Boolean + +/** + * Checks if the specified [value] belongs to this range. + */ +@kotlin.jvm.JvmName("intRangeContains") +public header operator fun ClosedRange.contains(value: Float): Boolean + +/** + * Checks if the specified [value] belongs to this range. + */ +@kotlin.jvm.JvmName("longRangeContains") +public header operator fun ClosedRange.contains(value: Float): Boolean + +/** + * Checks if the specified [value] belongs to this range. + */ +@kotlin.jvm.JvmName("byteRangeContains") +public header operator fun ClosedRange.contains(value: Float): Boolean + +/** + * Checks if the specified [value] belongs to this range. + */ +@kotlin.jvm.JvmName("shortRangeContains") +public header operator fun ClosedRange.contains(value: Float): Boolean + +/** + * Checks if the specified [value] belongs to this range. + */ +@kotlin.jvm.JvmName("doubleRangeContains") +public header operator fun ClosedRange.contains(value: Float): Boolean + +/** + * Checks if the specified [value] belongs to this range. + */ +@kotlin.jvm.JvmName("longRangeContains") +public header operator fun ClosedRange.contains(value: Int): Boolean + +/** + * Checks if the specified [value] belongs to this range. + */ +@kotlin.jvm.JvmName("byteRangeContains") +public header operator fun ClosedRange.contains(value: Int): Boolean + +/** + * Checks if the specified [value] belongs to this range. + */ +@kotlin.jvm.JvmName("shortRangeContains") +public header operator fun ClosedRange.contains(value: Int): Boolean + +/** + * Checks if the specified [value] belongs to this range. + */ +@kotlin.jvm.JvmName("doubleRangeContains") +public header operator fun ClosedRange.contains(value: Int): Boolean + +/** + * Checks if the specified [value] belongs to this range. + */ +@kotlin.jvm.JvmName("floatRangeContains") +public header operator fun ClosedRange.contains(value: Int): Boolean + +/** + * Checks if the specified [value] belongs to this range. + */ +@kotlin.jvm.JvmName("intRangeContains") +public header operator fun ClosedRange.contains(value: Long): Boolean + +/** + * Checks if the specified [value] belongs to this range. + */ +@kotlin.jvm.JvmName("byteRangeContains") +public header operator fun ClosedRange.contains(value: Long): Boolean + +/** + * Checks if the specified [value] belongs to this range. + */ +@kotlin.jvm.JvmName("shortRangeContains") +public header operator fun ClosedRange.contains(value: Long): Boolean + +/** + * Checks if the specified [value] belongs to this range. + */ +@kotlin.jvm.JvmName("doubleRangeContains") +public header operator fun ClosedRange.contains(value: Long): Boolean + +/** + * Checks if the specified [value] belongs to this range. + */ +@kotlin.jvm.JvmName("floatRangeContains") +public header operator fun ClosedRange.contains(value: Long): Boolean + +/** + * Checks if the specified [value] belongs to this range. + */ +@kotlin.jvm.JvmName("intRangeContains") +public header operator fun ClosedRange.contains(value: Short): Boolean + +/** + * Checks if the specified [value] belongs to this range. + */ +@kotlin.jvm.JvmName("longRangeContains") +public header operator fun ClosedRange.contains(value: Short): Boolean + +/** + * Checks if the specified [value] belongs to this range. + */ +@kotlin.jvm.JvmName("byteRangeContains") +public header operator fun ClosedRange.contains(value: Short): Boolean + +/** + * Checks if the specified [value] belongs to this range. + */ +@kotlin.jvm.JvmName("doubleRangeContains") +public header operator fun ClosedRange.contains(value: Short): Boolean + +/** + * Checks if the specified [value] belongs to this range. + */ +@kotlin.jvm.JvmName("floatRangeContains") +public header operator fun ClosedRange.contains(value: Short): Boolean + +/** + * Returns a progression from this value down to the specified [to] value with the step -1. + * + * The [to] value has to be less than this value. + */ +public header infix fun Int.downTo(to: Byte): IntProgression + +/** + * Returns a progression from this value down to the specified [to] value with the step -1. + * + * The [to] value has to be less than this value. + */ +public header infix fun Long.downTo(to: Byte): LongProgression + +/** + * Returns a progression from this value down to the specified [to] value with the step -1. + * + * The [to] value has to be less than this value. + */ +public header infix fun Byte.downTo(to: Byte): IntProgression + +/** + * Returns a progression from this value down to the specified [to] value with the step -1. + * + * The [to] value has to be less than this value. + */ +public header infix fun Short.downTo(to: Byte): IntProgression + +/** + * Returns a progression from this value down to the specified [to] value with the step -1. + * + * The [to] value has to be less than this value. + */ +public header infix fun Char.downTo(to: Char): CharProgression + +/** + * Returns a progression from this value down to the specified [to] value with the step -1. + * + * The [to] value has to be less than this value. + */ +public header infix fun Int.downTo(to: Int): IntProgression + +/** + * Returns a progression from this value down to the specified [to] value with the step -1. + * + * The [to] value has to be less than this value. + */ +public header infix fun Long.downTo(to: Int): LongProgression + +/** + * Returns a progression from this value down to the specified [to] value with the step -1. + * + * The [to] value has to be less than this value. + */ +public header infix fun Byte.downTo(to: Int): IntProgression + +/** + * Returns a progression from this value down to the specified [to] value with the step -1. + * + * The [to] value has to be less than this value. + */ +public header infix fun Short.downTo(to: Int): IntProgression + +/** + * Returns a progression from this value down to the specified [to] value with the step -1. + * + * The [to] value has to be less than this value. + */ +public header infix fun Int.downTo(to: Long): LongProgression + +/** + * Returns a progression from this value down to the specified [to] value with the step -1. + * + * The [to] value has to be less than this value. + */ +public header infix fun Long.downTo(to: Long): LongProgression + +/** + * Returns a progression from this value down to the specified [to] value with the step -1. + * + * The [to] value has to be less than this value. + */ +public header infix fun Byte.downTo(to: Long): LongProgression + +/** + * Returns a progression from this value down to the specified [to] value with the step -1. + * + * The [to] value has to be less than this value. + */ +public header infix fun Short.downTo(to: Long): LongProgression + +/** + * Returns a progression from this value down to the specified [to] value with the step -1. + * + * The [to] value has to be less than this value. + */ +public header infix fun Int.downTo(to: Short): IntProgression + +/** + * Returns a progression from this value down to the specified [to] value with the step -1. + * + * The [to] value has to be less than this value. + */ +public header infix fun Long.downTo(to: Short): LongProgression + +/** + * Returns a progression from this value down to the specified [to] value with the step -1. + * + * The [to] value has to be less than this value. + */ +public header infix fun Byte.downTo(to: Short): IntProgression + +/** + * Returns a progression from this value down to the specified [to] value with the step -1. + * + * The [to] value has to be less than this value. + */ +public header infix fun Short.downTo(to: Short): IntProgression + +/** + * Returns a progression that goes over the same range in the opposite direction with the same step. + */ +public header fun IntProgression.reversed(): IntProgression + +/** + * Returns a progression that goes over the same range in the opposite direction with the same step. + */ +public header fun LongProgression.reversed(): LongProgression + +/** + * Returns a progression that goes over the same range in the opposite direction with the same step. + */ +public header fun CharProgression.reversed(): CharProgression + +/** + * Returns a progression that goes over the same range with the given step. + */ +public header infix fun IntProgression.step(step: Int): IntProgression + +/** + * Returns a progression that goes over the same range with the given step. + */ +public header infix fun LongProgression.step(step: Long): LongProgression + +/** + * Returns a progression that goes over the same range with the given step. + */ +public header infix fun CharProgression.step(step: Int): CharProgression + +internal header fun Int.toByteExactOrNull(): Byte? + +internal header fun Long.toByteExactOrNull(): Byte? + +internal header fun Short.toByteExactOrNull(): Byte? + +internal header fun Double.toByteExactOrNull(): Byte? + +internal header fun Float.toByteExactOrNull(): Byte? + +internal header fun Long.toIntExactOrNull(): Int? + +internal header fun Double.toIntExactOrNull(): Int? + +internal header fun Float.toIntExactOrNull(): Int? + +internal header fun Double.toLongExactOrNull(): Long? + +internal header fun Float.toLongExactOrNull(): Long? + +internal header fun Int.toShortExactOrNull(): Short? + +internal header fun Long.toShortExactOrNull(): Short? + +internal header fun Double.toShortExactOrNull(): Short? + +internal header fun Float.toShortExactOrNull(): Short? + +/** + * Returns a range from this value up to but excluding the specified [to] value. + */ +public header infix fun Int.until(to: Byte): IntRange + +/** + * Returns a range from this value up to but excluding the specified [to] value. + */ +public header infix fun Long.until(to: Byte): LongRange + +/** + * Returns a range from this value up to but excluding the specified [to] value. + */ +public header infix fun Byte.until(to: Byte): IntRange + +/** + * Returns a range from this value up to but excluding the specified [to] value. + */ +public header infix fun Short.until(to: Byte): IntRange + +/** + * Returns a range from this value up to but excluding the specified [to] value. + * + * If the [to] value is less than or equal to ['\u0000'] the returned range is empty. + */ +public header infix fun Char.until(to: Char): CharRange + +/** + * Returns a range from this value up to but excluding the specified [to] value. + * + * If the [to] value is less than or equal to [Int.MIN_VALUE] the returned range is empty. + */ +public header infix fun Int.until(to: Int): IntRange + +/** + * Returns a range from this value up to but excluding the specified [to] value. + */ +public header infix fun Long.until(to: Int): LongRange + +/** + * Returns a range from this value up to but excluding the specified [to] value. + * + * If the [to] value is less than or equal to [Int.MIN_VALUE] the returned range is empty. + */ +public header infix fun Byte.until(to: Int): IntRange + +/** + * Returns a range from this value up to but excluding the specified [to] value. + * + * If the [to] value is less than or equal to [Int.MIN_VALUE] the returned range is empty. + */ +public header infix fun Short.until(to: Int): IntRange + +/** + * Returns a range from this value up to but excluding the specified [to] value. + * + * If the [to] value is less than or equal to [Long.MIN_VALUE] the returned range is empty. + */ +public header infix fun Int.until(to: Long): LongRange + +/** + * Returns a range from this value up to but excluding the specified [to] value. + * + * If the [to] value is less than or equal to [Long.MIN_VALUE] the returned range is empty. + */ +public header infix fun Long.until(to: Long): LongRange + +/** + * Returns a range from this value up to but excluding the specified [to] value. + * + * If the [to] value is less than or equal to [Long.MIN_VALUE] the returned range is empty. + */ +public header infix fun Byte.until(to: Long): LongRange + +/** + * Returns a range from this value up to but excluding the specified [to] value. + * + * If the [to] value is less than or equal to [Long.MIN_VALUE] the returned range is empty. + */ +public header infix fun Short.until(to: Long): LongRange + +/** + * Returns a range from this value up to but excluding the specified [to] value. + */ +public header infix fun Int.until(to: Short): IntRange + +/** + * Returns a range from this value up to but excluding the specified [to] value. + */ +public header infix fun Long.until(to: Short): LongRange + +/** + * Returns a range from this value up to but excluding the specified [to] value. + */ +public header infix fun Byte.until(to: Short): IntRange + +/** + * Returns a range from this value up to but excluding the specified [to] value. + */ +public header infix fun Short.until(to: Short): IntRange + +/** + * Ensures that this value is not less than the specified [minimumValue]. + * + * @return this value if it's greater than or equal to the [minimumValue] or the [minimumValue] otherwise. + */ +public header fun > T.coerceAtLeast(minimumValue: T): T + +/** + * Ensures that this value is not less than the specified [minimumValue]. + * + * @return this value if it's greater than or equal to the [minimumValue] or the [minimumValue] otherwise. + */ +public header fun Byte.coerceAtLeast(minimumValue: Byte): Byte + +/** + * Ensures that this value is not less than the specified [minimumValue]. + * + * @return this value if it's greater than or equal to the [minimumValue] or the [minimumValue] otherwise. + */ +public header fun Short.coerceAtLeast(minimumValue: Short): Short + +/** + * Ensures that this value is not less than the specified [minimumValue]. + * + * @return this value if it's greater than or equal to the [minimumValue] or the [minimumValue] otherwise. + */ +public header fun Int.coerceAtLeast(minimumValue: Int): Int + +/** + * Ensures that this value is not less than the specified [minimumValue]. + * + * @return this value if it's greater than or equal to the [minimumValue] or the [minimumValue] otherwise. + */ +public header fun Long.coerceAtLeast(minimumValue: Long): Long + +/** + * Ensures that this value is not less than the specified [minimumValue]. + * + * @return this value if it's greater than or equal to the [minimumValue] or the [minimumValue] otherwise. + */ +public header fun Float.coerceAtLeast(minimumValue: Float): Float + +/** + * Ensures that this value is not less than the specified [minimumValue]. + * + * @return this value if it's greater than or equal to the [minimumValue] or the [minimumValue] otherwise. + */ +public header fun Double.coerceAtLeast(minimumValue: Double): Double + +/** + * Ensures that this value is not greater than the specified [maximumValue]. + * + * @return this value if it's less than or equal to the [maximumValue] or the [maximumValue] otherwise. + */ +public header fun > T.coerceAtMost(maximumValue: T): T + +/** + * Ensures that this value is not greater than the specified [maximumValue]. + * + * @return this value if it's less than or equal to the [maximumValue] or the [maximumValue] otherwise. + */ +public header fun Byte.coerceAtMost(maximumValue: Byte): Byte + +/** + * Ensures that this value is not greater than the specified [maximumValue]. + * + * @return this value if it's less than or equal to the [maximumValue] or the [maximumValue] otherwise. + */ +public header fun Short.coerceAtMost(maximumValue: Short): Short + +/** + * Ensures that this value is not greater than the specified [maximumValue]. + * + * @return this value if it's less than or equal to the [maximumValue] or the [maximumValue] otherwise. + */ +public header fun Int.coerceAtMost(maximumValue: Int): Int + +/** + * Ensures that this value is not greater than the specified [maximumValue]. + * + * @return this value if it's less than or equal to the [maximumValue] or the [maximumValue] otherwise. + */ +public header fun Long.coerceAtMost(maximumValue: Long): Long + +/** + * Ensures that this value is not greater than the specified [maximumValue]. + * + * @return this value if it's less than or equal to the [maximumValue] or the [maximumValue] otherwise. + */ +public header fun Float.coerceAtMost(maximumValue: Float): Float + +/** + * Ensures that this value is not greater than the specified [maximumValue]. + * + * @return this value if it's less than or equal to the [maximumValue] or the [maximumValue] otherwise. + */ +public header fun Double.coerceAtMost(maximumValue: Double): Double + +/** + * Ensures that this value lies in the specified range [minimumValue]..[maximumValue]. + * + * @return this value if it's in the range, or [minimumValue] if this value is less than [minimumValue], or [maximumValue] if this value is greater than [maximumValue]. + */ +public header fun > T.coerceIn(minimumValue: T?, maximumValue: T?): T + +/** + * Ensures that this value lies in the specified range [minimumValue]..[maximumValue]. + * + * @return this value if it's in the range, or [minimumValue] if this value is less than [minimumValue], or [maximumValue] if this value is greater than [maximumValue]. + */ +public header fun Byte.coerceIn(minimumValue: Byte, maximumValue: Byte): Byte + +/** + * Ensures that this value lies in the specified range [minimumValue]..[maximumValue]. + * + * @return this value if it's in the range, or [minimumValue] if this value is less than [minimumValue], or [maximumValue] if this value is greater than [maximumValue]. + */ +public header fun Short.coerceIn(minimumValue: Short, maximumValue: Short): Short + +/** + * Ensures that this value lies in the specified range [minimumValue]..[maximumValue]. + * + * @return this value if it's in the range, or [minimumValue] if this value is less than [minimumValue], or [maximumValue] if this value is greater than [maximumValue]. + */ +public header fun Int.coerceIn(minimumValue: Int, maximumValue: Int): Int + +/** + * Ensures that this value lies in the specified range [minimumValue]..[maximumValue]. + * + * @return this value if it's in the range, or [minimumValue] if this value is less than [minimumValue], or [maximumValue] if this value is greater than [maximumValue]. + */ +public header fun Long.coerceIn(minimumValue: Long, maximumValue: Long): Long + +/** + * Ensures that this value lies in the specified range [minimumValue]..[maximumValue]. + * + * @return this value if it's in the range, or [minimumValue] if this value is less than [minimumValue], or [maximumValue] if this value is greater than [maximumValue]. + */ +public header fun Float.coerceIn(minimumValue: Float, maximumValue: Float): Float + +/** + * Ensures that this value lies in the specified range [minimumValue]..[maximumValue]. + * + * @return this value if it's in the range, or [minimumValue] if this value is less than [minimumValue], or [maximumValue] if this value is greater than [maximumValue]. + */ +public header fun Double.coerceIn(minimumValue: Double, maximumValue: Double): Double + +/** + * Ensures that this value lies in the specified [range]. + * + * @return this value if it's in the [range], or `range.start` if this value is less than `range.start`, or `range.endInclusive` if this value is greater than `range.endInclusive`. + */ +public header fun > T.coerceIn(range: ClosedComparableRange): T + +/** + * Ensures that this value lies in the specified [range]. + * + * @return this value if it's in the [range], or `range.start` if this value is less than `range.start`, or `range.endInclusive` if this value is greater than `range.endInclusive`. + */ +public header fun > T.coerceIn(range: ClosedRange): T + +/** + * Ensures that this value lies in the specified [range]. + * + * @return this value if it's in the [range], or `range.start` if this value is less than `range.start`, or `range.endInclusive` if this value is greater than `range.endInclusive`. + */ +public header fun Int.coerceIn(range: ClosedRange): Int + +/** + * Ensures that this value lies in the specified [range]. + * + * @return this value if it's in the [range], or `range.start` if this value is less than `range.start`, or `range.endInclusive` if this value is greater than `range.endInclusive`. + */ +public header fun Long.coerceIn(range: ClosedRange): Long + diff --git a/libraries/stdlib/common/src/generated/_Sequences.kt b/libraries/stdlib/common/src/generated/_Sequences.kt new file mode 100644 index 00000000000..5b782469808 --- /dev/null +++ b/libraries/stdlib/common/src/generated/_Sequences.kt @@ -0,0 +1,755 @@ +@file:kotlin.jvm.JvmMultifileClass +@file:kotlin.jvm.JvmName("SequencesKt") + +package kotlin.sequences + +// +// NOTE THIS FILE IS AUTO-GENERATED by the GenerateStandardLib.kt +// See: https://github.com/JetBrains/kotlin/tree/master/libraries/stdlib +// + +import kotlin.comparisons.* + +/** + * Returns `true` if [element] is found in the sequence. + */ +public header operator fun <@kotlin.internal.OnlyInputTypes T> Sequence.contains(element: T): Boolean + +/** + * Returns an element at the given [index] or throws an [IndexOutOfBoundsException] if the [index] is out of bounds of this sequence. + */ +public header fun Sequence.elementAt(index: Int): T + +/** + * Returns an element at the given [index] or the result of calling the [defaultValue] function if the [index] is out of bounds of this sequence. + */ +public header fun Sequence.elementAtOrElse(index: Int, defaultValue: (Int) -> T): T + +/** + * Returns an element at the given [index] or `null` if the [index] is out of bounds of this sequence. + */ +public header fun Sequence.elementAtOrNull(index: Int): T? + +/** + * Returns the first element matching the given [predicate], or `null` if no such element was found. + */ +@kotlin.internal.InlineOnly +public header inline fun Sequence.find(predicate: (T) -> Boolean): T? + +/** + * Returns the last element matching the given [predicate], or `null` if no such element was found. + */ +@kotlin.internal.InlineOnly +public header inline fun Sequence.findLast(predicate: (T) -> Boolean): T? + +/** + * Returns first element. + * @throws [NoSuchElementException] if the sequence is empty. + */ +public header fun Sequence.first(): T + +/** + * Returns the first element matching the given [predicate]. + * @throws [NoSuchElementException] if no such element is found. + */ +public header inline fun Sequence.first(predicate: (T) -> Boolean): T + +/** + * Returns the first element, or `null` if the sequence is empty. + */ +public header fun Sequence.firstOrNull(): T? + +/** + * Returns the first element matching the given [predicate], or `null` if element was not found. + */ +public header inline fun Sequence.firstOrNull(predicate: (T) -> Boolean): T? + +/** + * Returns first index of [element], or -1 if the sequence does not contain element. + */ +public header fun <@kotlin.internal.OnlyInputTypes T> Sequence.indexOf(element: T): Int + +/** + * Returns index of the first element matching the given [predicate], or -1 if the sequence does not contain such element. + */ +public header inline fun Sequence.indexOfFirst(predicate: (T) -> Boolean): Int + +/** + * Returns index of the last element matching the given [predicate], or -1 if the sequence does not contain such element. + */ +public header inline fun Sequence.indexOfLast(predicate: (T) -> Boolean): Int + +/** + * Returns the last element. + * @throws [NoSuchElementException] if the sequence is empty. + */ +public header fun Sequence.last(): T + +/** + * Returns the last element matching the given [predicate]. + * @throws [NoSuchElementException] if no such element is found. + */ +public header inline fun Sequence.last(predicate: (T) -> Boolean): T + +/** + * Returns last index of [element], or -1 if the sequence does not contain element. + */ +public header fun <@kotlin.internal.OnlyInputTypes T> Sequence.lastIndexOf(element: T): Int + +/** + * Returns the last element, or `null` if the sequence is empty. + */ +public header fun Sequence.lastOrNull(): T? + +/** + * Returns the last element matching the given [predicate], or `null` if no such element was found. + */ +public header inline fun Sequence.lastOrNull(predicate: (T) -> Boolean): T? + +/** + * Returns the single element, or throws an exception if the sequence is empty or has more than one element. + */ +public header fun Sequence.single(): T + +/** + * Returns the single element matching the given [predicate], or throws exception if there is no or more than one matching element. + */ +public header inline fun Sequence.single(predicate: (T) -> Boolean): T + +/** + * Returns single element, or `null` if the sequence is empty or has more than one element. + */ +public header fun Sequence.singleOrNull(): T? + +/** + * Returns the single element matching the given [predicate], or `null` if element was not found or more than one element was found. + */ +public header inline fun Sequence.singleOrNull(predicate: (T) -> Boolean): T? + +/** + * Returns a sequence containing all elements except first [n] elements. + */ +public header fun Sequence.drop(n: Int): Sequence + +/** + * Returns a sequence containing all elements except first elements that satisfy the given [predicate]. + */ +public header fun Sequence.dropWhile(predicate: (T) -> Boolean): Sequence + +/** + * Returns a sequence containing only elements matching the given [predicate]. + */ +public header fun Sequence.filter(predicate: (T) -> Boolean): Sequence + +/** + * Returns a sequence containing only elements matching the given [predicate]. + * @param [predicate] function that takes the index of an element and the element itself + * and returns the result of predicate evaluation on the element. + */ +public header fun Sequence.filterIndexed(predicate: (Int, T) -> Boolean): Sequence + +/** + * Appends all elements matching the given [predicate] to the given [destination]. + * @param [predicate] function that takes the index of an element and the element itself + * and returns the result of predicate evaluation on the element. + */ +public header inline fun > Sequence.filterIndexedTo(destination: C, predicate: (Int, T) -> Boolean): C + +/** + * Returns a sequence containing all elements that are instances of specified type parameter R. + */ +public header inline fun Sequence<*>.filterIsInstance(): Sequence<@kotlin.internal.NoInfer R> + +/** + * Appends all elements that are instances of specified type parameter R to the given [destination]. + */ +public header inline fun > Sequence<*>.filterIsInstanceTo(destination: C): C + +/** + * Returns a sequence containing all elements not matching the given [predicate]. + */ +public header fun Sequence.filterNot(predicate: (T) -> Boolean): Sequence + +/** + * Returns a sequence containing all elements that are not `null`. + */ +public header fun Sequence.filterNotNull(): Sequence + +/** + * Appends all elements that are not `null` to the given [destination]. + */ +public header fun , T : Any> Sequence.filterNotNullTo(destination: C): C + +/** + * Appends all elements not matching the given [predicate] to the given [destination]. + */ +public header inline fun > Sequence.filterNotTo(destination: C, predicate: (T) -> Boolean): C + +/** + * Appends all elements matching the given [predicate] to the given [destination]. + */ +public header inline fun > Sequence.filterTo(destination: C, predicate: (T) -> Boolean): C + +/** + * Returns a sequence containing first [n] elements. + */ +public header fun Sequence.take(n: Int): Sequence + +/** + * Returns a sequence containing first elements satisfying the given [predicate]. + */ +public header fun Sequence.takeWhile(predicate: (T) -> Boolean): Sequence + +/** + * Returns a sequence that yields elements of this sequence sorted according to their natural sort order. + */ +public header fun > Sequence.sorted(): Sequence + +/** + * Returns a sequence that yields elements of this sequence sorted according to natural sort order of the value returned by specified [selector] function. + */ +public header inline fun > Sequence.sortedBy(crossinline selector: (T) -> R?): Sequence + +/** + * Returns a sequence that yields elements of this sequence sorted descending according to natural sort order of the value returned by specified [selector] function. + */ +public header inline fun > Sequence.sortedByDescending(crossinline selector: (T) -> R?): Sequence + +/** + * Returns a sequence that yields elements of this sequence sorted descending according to their natural sort order. + */ +public header fun > Sequence.sortedDescending(): Sequence + +/** + * Returns a sequence that yields elements of this sequence sorted according to the specified [comparator]. + */ +public header fun Sequence.sortedWith(comparator: Comparator): Sequence + +/** + * Returns a [Map] containing key-value pairs provided by [transform] function + * applied to elements of the given sequence. + * + * If any of two pairs would have the same key the last one gets added to the map. + * + * The returned map preserves the entry iteration order of the original sequence. + */ +public header inline fun Sequence.associate(transform: (T) -> Pair): Map + +/** + * Returns a [Map] containing the elements from the given sequence indexed by the key + * returned from [keySelector] function applied to each element. + * + * If any two elements would have the same key returned by [keySelector] the last one gets added to the map. + * + * The returned map preserves the entry iteration order of the original sequence. + */ +public header inline fun Sequence.associateBy(keySelector: (T) -> K): Map + +/** + * Returns a [Map] containing the values provided by [valueTransform] and indexed by [keySelector] functions applied to elements of the given sequence. + * + * If any two elements would have the same key returned by [keySelector] the last one gets added to the map. + * + * The returned map preserves the entry iteration order of the original sequence. + */ +public header inline fun Sequence.associateBy(keySelector: (T) -> K, valueTransform: (T) -> V): Map + +/** + * Populates and returns the [destination] mutable map with key-value pairs, + * where key is provided by the [keySelector] function applied to each element of the given sequence + * and value is the element itself. + * + * If any two elements would have the same key returned by [keySelector] the last one gets added to the map. + */ +public header inline fun > Sequence.associateByTo(destination: M, keySelector: (T) -> K): M + +/** + * Populates and returns the [destination] mutable map with key-value pairs, + * where key is provided by the [keySelector] function and + * and value is provided by the [valueTransform] function applied to elements of the given sequence. + * + * If any two elements would have the same key returned by [keySelector] the last one gets added to the map. + */ +public header inline fun > Sequence.associateByTo(destination: M, keySelector: (T) -> K, valueTransform: (T) -> V): M + +/** + * Populates and returns the [destination] mutable map with key-value pairs + * provided by [transform] function applied to each element of the given sequence. + * + * If any of two pairs would have the same key the last one gets added to the map. + */ +public header inline fun > Sequence.associateTo(destination: M, transform: (T) -> Pair): M + +/** + * Appends all elements to the given [destination] collection. + */ +public header fun > Sequence.toCollection(destination: C): C + +/** + * Returns a [HashSet] of all elements. + */ +public header fun Sequence.toHashSet(): HashSet + +/** + * Returns a [List] containing all elements. + */ +public header fun Sequence.toList(): List + +/** + * Returns a [MutableList] filled with all elements of this sequence. + */ +public header fun Sequence.toMutableList(): MutableList + +/** + * Returns a [Set] of all elements. + * + * The returned set preserves the element iteration order of the original sequence. + */ +public header fun Sequence.toSet(): Set + +/** + * Returns a single sequence of all elements from results of [transform] function being invoked on each element of original sequence. + */ +public header fun Sequence.flatMap(transform: (T) -> Sequence): Sequence + +/** + * Appends all elements yielded from results of [transform] function being invoked on each element of original sequence, to the given [destination]. + */ +public header inline fun > Sequence.flatMapTo(destination: C, transform: (T) -> Sequence): C + +/** + * Groups elements of the original sequence by the key returned by the given [keySelector] function + * applied to each element and returns a map where each group key is associated with a list of corresponding elements. + * + * The returned map preserves the entry iteration order of the keys produced from the original sequence. + * + * @sample samples.collections.Collections.Transformations.groupBy + */ +public header inline fun Sequence.groupBy(keySelector: (T) -> K): Map> + +/** + * Groups values returned by the [valueTransform] function applied to each element of the original sequence + * by the key returned by the given [keySelector] function applied to the element + * and returns a map where each group key is associated with a list of corresponding values. + * + * The returned map preserves the entry iteration order of the keys produced from the original sequence. + * + * @sample samples.collections.Collections.Transformations.groupByKeysAndValues + */ +public header inline fun Sequence.groupBy(keySelector: (T) -> K, valueTransform: (T) -> V): Map> + +/** + * Groups elements of the original sequence by the key returned by the given [keySelector] function + * applied to each element and puts to the [destination] map each group key associated with a list of corresponding elements. + * + * @return The [destination] map. + * + * @sample samples.collections.Collections.Transformations.groupBy + */ +public header inline fun >> Sequence.groupByTo(destination: M, keySelector: (T) -> K): M + +/** + * Groups values returned by the [valueTransform] function applied to each element of the original sequence + * by the key returned by the given [keySelector] function applied to the element + * and puts to the [destination] map each group key associated with a list of corresponding values. + * + * @return The [destination] map. + * + * @sample samples.collections.Collections.Transformations.groupByKeysAndValues + */ +public header inline fun >> Sequence.groupByTo(destination: M, keySelector: (T) -> K, valueTransform: (T) -> V): M + +/** + * Returns a sequence containing the results of applying the given [transform] function + * to each element in the original sequence. + */ +public header fun Sequence.map(transform: (T) -> R): Sequence + +/** + * Returns a sequence containing the results of applying the given [transform] function + * to each element and its index in the original sequence. + * @param [transform] function that takes the index of an element and the element itself + * and returns the result of the transform applied to the element. + */ +public header fun Sequence.mapIndexed(transform: (Int, T) -> R): Sequence + +/** + * Returns a sequence containing only the non-null results of applying the given [transform] function + * to each element and its index in the original sequence. + * @param [transform] function that takes the index of an element and the element itself + * and returns the result of the transform applied to the element. + */ +public header fun Sequence.mapIndexedNotNull(transform: (Int, T) -> R?): Sequence + +/** + * Applies the given [transform] function to each element and its index in the original sequence + * and appends only the non-null results to the given [destination]. + * @param [transform] function that takes the index of an element and the element itself + * and returns the result of the transform applied to the element. + */ +public header inline fun > Sequence.mapIndexedNotNullTo(destination: C, transform: (Int, T) -> R?): C + +/** + * Applies the given [transform] function to each element and its index in the original sequence + * and appends the results to the given [destination]. + * @param [transform] function that takes the index of an element and the element itself + * and returns the result of the transform applied to the element. + */ +public header inline fun > Sequence.mapIndexedTo(destination: C, transform: (Int, T) -> R): C + +/** + * Returns a sequence containing only the non-null results of applying the given [transform] function + * to each element in the original sequence. + */ +public header fun Sequence.mapNotNull(transform: (T) -> R?): Sequence + +/** + * Applies the given [transform] function to each element in the original sequence + * and appends only the non-null results to the given [destination]. + */ +public header inline fun > Sequence.mapNotNullTo(destination: C, transform: (T) -> R?): C + +/** + * Applies the given [transform] function to each element of the original sequence + * and appends the results to the given [destination]. + */ +public header inline fun > Sequence.mapTo(destination: C, transform: (T) -> R): C + +/** + * Returns a sequence of [IndexedValue] for each element of the original sequence. + */ +public header fun Sequence.withIndex(): Sequence> + +/** + * Returns a sequence containing only distinct elements from the given sequence. + * + * The elements in the resulting sequence are in the same order as they were in the source sequence. + */ +public header fun Sequence.distinct(): Sequence + +/** + * Returns a sequence containing only elements from the given sequence + * having distinct keys returned by the given [selector] function. + * + * The elements in the resulting sequence are in the same order as they were in the source sequence. + */ +public header fun Sequence.distinctBy(selector: (T) -> K): Sequence + +/** + * Returns a mutable set containing all distinct elements from the given sequence. + * + * The returned set preserves the element iteration order of the original sequence. + */ +public header fun Sequence.toMutableSet(): MutableSet + +/** + * Returns `true` if all elements match the given [predicate]. + */ +public header inline fun Sequence.all(predicate: (T) -> Boolean): Boolean + +/** + * Returns `true` if sequence has at least one element. + */ +public header fun Sequence.any(): Boolean + +/** + * Returns `true` if at least one element matches the given [predicate]. + */ +public header inline fun Sequence.any(predicate: (T) -> Boolean): Boolean + +/** + * Returns the number of elements in this sequence. + */ +public header fun Sequence.count(): Int + +/** + * Returns the number of elements matching the given [predicate]. + */ +public header inline fun Sequence.count(predicate: (T) -> Boolean): Int + +/** + * Accumulates value starting with [initial] value and applying [operation] from left to right to current accumulator value and each element. + */ +public header inline fun Sequence.fold(initial: R, operation: (R, T) -> R): R + +/** + * Accumulates value starting with [initial] value and applying [operation] from left to right + * to current accumulator value and each element with its index in the original sequence. + * @param [operation] function that takes the index of an element, current accumulator value + * and the element itself, and calculates the next accumulator value. + */ +public header inline fun Sequence.foldIndexed(initial: R, operation: (Int, R, T) -> R): R + +/** + * Performs the given [action] on each element. + */ +public header inline fun Sequence.forEach(action: (T) -> Unit): Unit + +/** + * Performs the given [action] on each element, providing sequential index with the element. + * @param [action] function that takes the index of an element and the element itself + * and performs the desired action on the element. + */ +public header inline fun Sequence.forEachIndexed(action: (Int, T) -> Unit): Unit + +/** + * Returns the largest element or `null` if there are no elements. + */ +public header fun > Sequence.max(): T? + +/** + * Returns the first element yielding the largest value of the given function or `null` if there are no elements. + */ +public header inline fun > Sequence.maxBy(selector: (T) -> R): T? + +/** + * Returns the first element having the largest value according to the provided [comparator] or `null` if there are no elements. + */ +public header fun Sequence.maxWith(comparator: Comparator): T? + +/** + * Returns the smallest element or `null` if there are no elements. + */ +public header fun > Sequence.min(): T? + +/** + * Returns the first element yielding the smallest value of the given function or `null` if there are no elements. + */ +public header inline fun > Sequence.minBy(selector: (T) -> R): T? + +/** + * Returns the first element having the smallest value according to the provided [comparator] or `null` if there are no elements. + */ +public header fun Sequence.minWith(comparator: Comparator): T? + +/** + * Returns `true` if the sequence has no elements. + */ +public header fun Sequence.none(): Boolean + +/** + * Returns `true` if no elements match the given [predicate]. + */ +public header inline fun Sequence.none(predicate: (T) -> Boolean): Boolean + +/** + * Returns a sequence which performs the given [action] on each element of the original sequence as they pass though it. + */ +@SinceKotlin("1.1") +public header fun Sequence.onEach(action: (T) -> Unit): Sequence + +/** + * Accumulates value starting with the first element and applying [operation] from left to right to current accumulator value and each element. + */ +public header inline fun Sequence.reduce(operation: (S, T) -> S): S + +/** + * Accumulates value starting with the first element and applying [operation] from left to right + * to current accumulator value and each element with its index in the original sequence. + * @param [operation] function that takes the index of an element, current accumulator value + * and the element itself and calculates the next accumulator value. + */ +public header inline fun Sequence.reduceIndexed(operation: (Int, S, T) -> S): S + +/** + * Returns the sum of all values produced by [selector] function applied to each element in the sequence. + */ +public header inline fun Sequence.sumBy(selector: (T) -> Int): Int + +/** + * Returns the sum of all values produced by [selector] function applied to each element in the sequence. + */ +public header inline fun Sequence.sumByDouble(selector: (T) -> Double): Double + +/** + * Returns an original collection containing all the non-`null` elements, throwing an [IllegalArgumentException] if there are any `null` elements. + */ +public header fun Sequence.requireNoNulls(): Sequence + +/** + * Returns a sequence containing all elements of the original sequence without the first occurrence of the given [element]. + */ +public header operator fun Sequence.minus(element: T): Sequence + +/** + * Returns a sequence containing all elements of original sequence except the elements contained in the given [elements] array. + * + * Note that the source sequence and the array being subtracted are iterated only when an `iterator` is requested from + * the resulting sequence. Changing any of them between successive calls to `iterator` may affect the result. + */ +public header operator fun Sequence.minus(elements: Array): Sequence + +/** + * Returns a sequence containing all elements of original sequence except the elements contained in the given [elements] collection. + * + * Note that the source sequence and the collection being subtracted are iterated only when an `iterator` is requested from + * the resulting sequence. Changing any of them between successive calls to `iterator` may affect the result. + */ +public header operator fun Sequence.minus(elements: Iterable): Sequence + +/** + * Returns a sequence containing all elements of original sequence except the elements contained in the given [elements] sequence. + * + * Note that the source sequence and the sequence being subtracted are iterated only when an `iterator` is requested from + * the resulting sequence. Changing any of them between successive calls to `iterator` may affect the result. + */ +public header operator fun Sequence.minus(elements: Sequence): Sequence + +/** + * Returns a sequence containing all elements of the original sequence without the first occurrence of the given [element]. + */ +@kotlin.internal.InlineOnly +public header inline fun Sequence.minusElement(element: T): Sequence + +/** + * Splits the original sequence into pair of lists, + * where *first* list contains elements for which [predicate] yielded `true`, + * while *second* list contains elements for which [predicate] yielded `false`. + */ +public header inline fun Sequence.partition(predicate: (T) -> Boolean): Pair, List> + +/** + * Returns a sequence containing all elements of the original sequence and then the given [element]. + */ +public header operator fun Sequence.plus(element: T): Sequence + +/** + * Returns a sequence containing all elements of original sequence and then all elements of the given [elements] array. + * + * Note that the source sequence and the array being added are iterated only when an `iterator` is requested from + * the resulting sequence. Changing any of them between successive calls to `iterator` may affect the result. + */ +public header operator fun Sequence.plus(elements: Array): Sequence + +/** + * Returns a sequence containing all elements of original sequence and then all elements of the given [elements] collection. + * + * Note that the source sequence and the collection being added are iterated only when an `iterator` is requested from + * the resulting sequence. Changing any of them between successive calls to `iterator` may affect the result. + */ +public header operator fun Sequence.plus(elements: Iterable): Sequence + +/** + * Returns a sequence containing all elements of original sequence and then all elements of the given [elements] sequence. + * + * Note that the source sequence and the sequence being added are iterated only when an `iterator` is requested from + * the resulting sequence. Changing any of them between successive calls to `iterator` may affect the result. + */ +public header operator fun Sequence.plus(elements: Sequence): Sequence + +/** + * Returns a sequence containing all elements of the original sequence and then the given [element]. + */ +@kotlin.internal.InlineOnly +public header inline fun Sequence.plusElement(element: T): Sequence + +/** + * Returns a sequence of pairs built from elements of both sequences with same indexes. + * Resulting sequence has length of shortest input sequence. + */ +public header infix fun Sequence.zip(other: Sequence): Sequence> + +/** + * Returns a sequence of values built from elements of both collections with same indexes using provided [transform]. Resulting sequence has length of shortest input sequences. + */ +public header fun Sequence.zip(other: Sequence, transform: (T, R) -> V): Sequence + +/** + * Appends the string from all the elements separated using [separator] and using the given [prefix] and [postfix] if supplied. + * + * If the collection could be huge, you can specify a non-negative value of [limit], in which case only the first [limit] + * elements will be appended, followed by the [truncated] string (which defaults to "..."). + */ +public header fun Sequence.joinTo(buffer: A, separator: CharSequence = ", ", prefix: CharSequence = "", postfix: CharSequence = "", limit: Int = -1, truncated: CharSequence = "...", transform: ((T) -> CharSequence)? = null): A + +/** + * Creates a string from all the elements separated using [separator] and using the given [prefix] and [postfix] if supplied. + * + * If the collection could be huge, you can specify a non-negative value of [limit], in which case only the first [limit] + * elements will be appended, followed by the [truncated] string (which defaults to "..."). + */ +public header fun Sequence.joinToString(separator: CharSequence = ", ", prefix: CharSequence = "", postfix: CharSequence = "", limit: Int = -1, truncated: CharSequence = "...", transform: ((T) -> CharSequence)? = null): String + +/** + * Creates an [Iterable] instance that wraps the original sequence returning its elements when being iterated. + */ +public header fun Sequence.asIterable(): Iterable + +/** + * Returns this sequence as a [Sequence]. + */ +@kotlin.internal.InlineOnly +public header inline fun Sequence.asSequence(): Sequence + +/** + * Returns an average value of elements in the sequence. + */ +@kotlin.jvm.JvmName("averageOfByte") +public header fun Sequence.average(): Double + +/** + * Returns an average value of elements in the sequence. + */ +@kotlin.jvm.JvmName("averageOfShort") +public header fun Sequence.average(): Double + +/** + * Returns an average value of elements in the sequence. + */ +@kotlin.jvm.JvmName("averageOfInt") +public header fun Sequence.average(): Double + +/** + * Returns an average value of elements in the sequence. + */ +@kotlin.jvm.JvmName("averageOfLong") +public header fun Sequence.average(): Double + +/** + * Returns an average value of elements in the sequence. + */ +@kotlin.jvm.JvmName("averageOfFloat") +public header fun Sequence.average(): Double + +/** + * Returns an average value of elements in the sequence. + */ +@kotlin.jvm.JvmName("averageOfDouble") +public header fun Sequence.average(): Double + +/** + * Returns the sum of all elements in the sequence. + */ +@kotlin.jvm.JvmName("sumOfByte") +public header fun Sequence.sum(): Int + +/** + * Returns the sum of all elements in the sequence. + */ +@kotlin.jvm.JvmName("sumOfShort") +public header fun Sequence.sum(): Int + +/** + * Returns the sum of all elements in the sequence. + */ +@kotlin.jvm.JvmName("sumOfInt") +public header fun Sequence.sum(): Int + +/** + * Returns the sum of all elements in the sequence. + */ +@kotlin.jvm.JvmName("sumOfLong") +public header fun Sequence.sum(): Long + +/** + * Returns the sum of all elements in the sequence. + */ +@kotlin.jvm.JvmName("sumOfFloat") +public header fun Sequence.sum(): Float + +/** + * Returns the sum of all elements in the sequence. + */ +@kotlin.jvm.JvmName("sumOfDouble") +public header fun Sequence.sum(): Double + diff --git a/libraries/stdlib/common/src/generated/_Sets.kt b/libraries/stdlib/common/src/generated/_Sets.kt new file mode 100644 index 00000000000..6bb09a9084a --- /dev/null +++ b/libraries/stdlib/common/src/generated/_Sets.kt @@ -0,0 +1,86 @@ +@file:kotlin.jvm.JvmMultifileClass +@file:kotlin.jvm.JvmName("SetsKt") + +package kotlin.collections + +// +// NOTE THIS FILE IS AUTO-GENERATED by the GenerateStandardLib.kt +// See: https://github.com/JetBrains/kotlin/tree/master/libraries/stdlib +// + +import kotlin.comparisons.* + +/** + * Returns a set containing all elements of the original set except the given [element]. + * + * The returned set preserves the element iteration order of the original set. + */ +public header operator fun Set.minus(element: T): Set + +/** + * Returns a set containing all elements of the original set except the elements contained in the given [elements] array. + * + * The returned set preserves the element iteration order of the original set. + */ +public header operator fun Set.minus(elements: Array): Set + +/** + * Returns a set containing all elements of the original set except the elements contained in the given [elements] collection. + * + * The returned set preserves the element iteration order of the original set. + */ +public header operator fun Set.minus(elements: Iterable): Set + +/** + * Returns a set containing all elements of the original set except the elements contained in the given [elements] sequence. + * + * The returned set preserves the element iteration order of the original set. + */ +public header operator fun Set.minus(elements: Sequence): Set + +/** + * Returns a set containing all elements of the original set except the given [element]. + * + * The returned set preserves the element iteration order of the original set. + */ +@kotlin.internal.InlineOnly +public header inline fun Set.minusElement(element: T): Set + +/** + * Returns a set containing all elements of the original set and then the given [element] if it isn't already in this set. + * + * The returned set preserves the element iteration order of the original set. + */ +public header operator fun Set.plus(element: T): Set + +/** + * Returns a set containing all elements of the original set and the given [elements] array, + * which aren't already in this set. + * + * The returned set preserves the element iteration order of the original set. + */ +public header operator fun Set.plus(elements: Array): Set + +/** + * Returns a set containing all elements of the original set and the given [elements] collection, + * which aren't already in this set. + * The returned set preserves the element iteration order of the original set. + */ +public header operator fun Set.plus(elements: Iterable): Set + +/** + * Returns a set containing all elements of the original set and the given [elements] sequence, + * which aren't already in this set. + * + * The returned set preserves the element iteration order of the original set. + */ +public header operator fun Set.plus(elements: Sequence): Set + +/** + * Returns a set containing all elements of the original set and then the given [element] if it isn't already in this set. + * + * The returned set preserves the element iteration order of the original set. + */ +@kotlin.internal.InlineOnly +public header inline fun Set.plusElement(element: T): Set + diff --git a/libraries/stdlib/common/src/generated/_Strings.kt b/libraries/stdlib/common/src/generated/_Strings.kt new file mode 100644 index 00000000000..4d9d91b55a1 --- /dev/null +++ b/libraries/stdlib/common/src/generated/_Strings.kt @@ -0,0 +1,665 @@ +@file:kotlin.jvm.JvmMultifileClass +@file:kotlin.jvm.JvmName("StringsKt") + +package kotlin.text + +// +// NOTE THIS FILE IS AUTO-GENERATED by the GenerateStandardLib.kt +// See: https://github.com/JetBrains/kotlin/tree/master/libraries/stdlib +// + +import kotlin.comparisons.* + +/** + * Returns a character at the given [index] or throws an [IndexOutOfBoundsException] if the [index] is out of bounds of this char sequence. + */ +@kotlin.internal.InlineOnly +public header inline fun CharSequence.elementAt(index: Int): Char + +/** + * Returns a character at the given [index] or the result of calling the [defaultValue] function if the [index] is out of bounds of this char sequence. + */ +@kotlin.internal.InlineOnly +public header inline fun CharSequence.elementAtOrElse(index: Int, defaultValue: (Int) -> Char): Char + +/** + * Returns a character at the given [index] or `null` if the [index] is out of bounds of this char sequence. + */ +@kotlin.internal.InlineOnly +public header inline fun CharSequence.elementAtOrNull(index: Int): Char? + +/** + * Returns the first character matching the given [predicate], or `null` if no such character was found. + */ +@kotlin.internal.InlineOnly +public header inline fun CharSequence.find(predicate: (Char) -> Boolean): Char? + +/** + * Returns the last character matching the given [predicate], or `null` if no such character was found. + */ +@kotlin.internal.InlineOnly +public header inline fun CharSequence.findLast(predicate: (Char) -> Boolean): Char? + +/** + * Returns first character. + * @throws [NoSuchElementException] if the char sequence is empty. + */ +public header fun CharSequence.first(): Char + +/** + * Returns the first character matching the given [predicate]. + * @throws [NoSuchElementException] if no such character is found. + */ +public header inline fun CharSequence.first(predicate: (Char) -> Boolean): Char + +/** + * Returns the first character, or `null` if the char sequence is empty. + */ +public header fun CharSequence.firstOrNull(): Char? + +/** + * Returns the first character matching the given [predicate], or `null` if character was not found. + */ +public header inline fun CharSequence.firstOrNull(predicate: (Char) -> Boolean): Char? + +/** + * Returns a character at the given [index] or the result of calling the [defaultValue] function if the [index] is out of bounds of this char sequence. + */ +@kotlin.internal.InlineOnly +public header inline fun CharSequence.getOrElse(index: Int, defaultValue: (Int) -> Char): Char + +/** + * Returns a character at the given [index] or `null` if the [index] is out of bounds of this char sequence. + */ +public header fun CharSequence.getOrNull(index: Int): Char? + +/** + * Returns index of the first character matching the given [predicate], or -1 if the char sequence does not contain such character. + */ +public header inline fun CharSequence.indexOfFirst(predicate: (Char) -> Boolean): Int + +/** + * Returns index of the last character matching the given [predicate], or -1 if the char sequence does not contain such character. + */ +public header inline fun CharSequence.indexOfLast(predicate: (Char) -> Boolean): Int + +/** + * Returns the last character. + * @throws [NoSuchElementException] if the char sequence is empty. + */ +public header fun CharSequence.last(): Char + +/** + * Returns the last character matching the given [predicate]. + * @throws [NoSuchElementException] if no such character is found. + */ +public header inline fun CharSequence.last(predicate: (Char) -> Boolean): Char + +/** + * Returns the last character, or `null` if the char sequence is empty. + */ +public header fun CharSequence.lastOrNull(): Char? + +/** + * Returns the last character matching the given [predicate], or `null` if no such character was found. + */ +public header inline fun CharSequence.lastOrNull(predicate: (Char) -> Boolean): Char? + +/** + * Returns the single character, or throws an exception if the char sequence is empty or has more than one character. + */ +public header fun CharSequence.single(): Char + +/** + * Returns the single character matching the given [predicate], or throws exception if there is no or more than one matching character. + */ +public header inline fun CharSequence.single(predicate: (Char) -> Boolean): Char + +/** + * Returns single character, or `null` if the char sequence is empty or has more than one character. + */ +public header fun CharSequence.singleOrNull(): Char? + +/** + * Returns the single character matching the given [predicate], or `null` if character was not found or more than one character was found. + */ +public header inline fun CharSequence.singleOrNull(predicate: (Char) -> Boolean): Char? + +/** + * Returns a subsequence of this char sequence with the first [n] characters removed. + */ +public header fun CharSequence.drop(n: Int): CharSequence + +/** + * Returns a string with the first [n] characters removed. + */ +public header fun String.drop(n: Int): String + +/** + * Returns a subsequence of this char sequence with the last [n] characters removed. + */ +public header fun CharSequence.dropLast(n: Int): CharSequence + +/** + * Returns a string with the last [n] characters removed. + */ +public header fun String.dropLast(n: Int): String + +/** + * Returns a subsequence of this char sequence containing all characters except last characters that satisfy the given [predicate]. + */ +public header inline fun CharSequence.dropLastWhile(predicate: (Char) -> Boolean): CharSequence + +/** + * Returns a string containing all characters except last characters that satisfy the given [predicate]. + */ +public header inline fun String.dropLastWhile(predicate: (Char) -> Boolean): String + +/** + * Returns a subsequence of this char sequence containing all characters except first characters that satisfy the given [predicate]. + */ +public header inline fun CharSequence.dropWhile(predicate: (Char) -> Boolean): CharSequence + +/** + * Returns a string containing all characters except first characters that satisfy the given [predicate]. + */ +public header inline fun String.dropWhile(predicate: (Char) -> Boolean): String + +/** + * Returns a char sequence containing only those characters from the original char sequence that match the given [predicate]. + */ +public header inline fun CharSequence.filter(predicate: (Char) -> Boolean): CharSequence + +/** + * Returns a string containing only those characters from the original string that match the given [predicate]. + */ +public header inline fun String.filter(predicate: (Char) -> Boolean): String + +/** + * Returns a char sequence containing only those characters from the original char sequence that match the given [predicate]. + * @param [predicate] function that takes the index of a character and the character itself + * and returns the result of predicate evaluation on the character. + */ +public header inline fun CharSequence.filterIndexed(predicate: (Int, Char) -> Boolean): CharSequence + +/** + * Returns a string containing only those characters from the original string that match the given [predicate]. + * @param [predicate] function that takes the index of a character and the character itself + * and returns the result of predicate evaluation on the character. + */ +public header inline fun String.filterIndexed(predicate: (Int, Char) -> Boolean): String + +/** + * Appends all characters matching the given [predicate] to the given [destination]. + * @param [predicate] function that takes the index of a character and the character itself + * and returns the result of predicate evaluation on the character. + */ +public header inline fun CharSequence.filterIndexedTo(destination: C, predicate: (Int, Char) -> Boolean): C + +/** + * Returns a char sequence containing only those characters from the original char sequence that do not match the given [predicate]. + */ +public header inline fun CharSequence.filterNot(predicate: (Char) -> Boolean): CharSequence + +/** + * Returns a string containing only those characters from the original string that do not match the given [predicate]. + */ +public header inline fun String.filterNot(predicate: (Char) -> Boolean): String + +/** + * Appends all characters not matching the given [predicate] to the given [destination]. + */ +public header inline fun CharSequence.filterNotTo(destination: C, predicate: (Char) -> Boolean): C + +/** + * Appends all characters matching the given [predicate] to the given [destination]. + */ +public header inline fun CharSequence.filterTo(destination: C, predicate: (Char) -> Boolean): C + +/** + * Returns a char sequence containing characters of the original char sequence at the specified range of [indices]. + */ +public header fun CharSequence.slice(indices: IntRange): CharSequence + +/** + * Returns a string containing characters of the original string at the specified range of [indices]. + */ +public header fun String.slice(indices: IntRange): String + +/** + * Returns a char sequence containing characters of the original char sequence at specified [indices]. + */ +public header fun CharSequence.slice(indices: Iterable): CharSequence + +/** + * Returns a string containing characters of the original string at specified [indices]. + */ +@kotlin.internal.InlineOnly +public header inline fun String.slice(indices: Iterable): String + +/** + * Returns a subsequence of this char sequence containing the first [n] characters from this char sequence, or the entire char sequence if this char sequence is shorter. + */ +public header fun CharSequence.take(n: Int): CharSequence + +/** + * Returns a string containing the first [n] characters from this string, or the entire string if this string is shorter. + */ +public header fun String.take(n: Int): String + +/** + * Returns a subsequence of this char sequence containing the last [n] characters from this char sequence, or the entire char sequence if this char sequence is shorter. + */ +public header fun CharSequence.takeLast(n: Int): CharSequence + +/** + * Returns a string containing the last [n] characters from this string, or the entire string if this string is shorter. + */ +public header fun String.takeLast(n: Int): String + +/** + * Returns a subsequence of this char sequence containing last characters that satisfy the given [predicate]. + */ +public header inline fun CharSequence.takeLastWhile(predicate: (Char) -> Boolean): CharSequence + +/** + * Returns a string containing last characters that satisfy the given [predicate]. + */ +public header inline fun String.takeLastWhile(predicate: (Char) -> Boolean): String + +/** + * Returns a subsequence of this char sequence containing the first characters that satisfy the given [predicate]. + */ +public header inline fun CharSequence.takeWhile(predicate: (Char) -> Boolean): CharSequence + +/** + * Returns a string containing the first characters that satisfy the given [predicate]. + */ +public header inline fun String.takeWhile(predicate: (Char) -> Boolean): String + +/** + * Returns a char sequence with characters in reversed order. + */ +public header fun CharSequence.reversed(): CharSequence + +/** + * Returns a string with characters in reversed order. + */ +@kotlin.internal.InlineOnly +public header inline fun String.reversed(): String + +/** + * Returns a [Map] containing key-value pairs provided by [transform] function + * applied to characters of the given char sequence. + * + * If any of two pairs would have the same key the last one gets added to the map. + * + * The returned map preserves the entry iteration order of the original char sequence. + */ +public header inline fun CharSequence.associate(transform: (Char) -> Pair): Map + +/** + * Returns a [Map] containing the characters from the given char sequence indexed by the key + * returned from [keySelector] function applied to each character. + * + * If any two characters would have the same key returned by [keySelector] the last one gets added to the map. + * + * The returned map preserves the entry iteration order of the original char sequence. + */ +public header inline fun CharSequence.associateBy(keySelector: (Char) -> K): Map + +/** + * Returns a [Map] containing the values provided by [valueTransform] and indexed by [keySelector] functions applied to characters of the given char sequence. + * + * If any two characters would have the same key returned by [keySelector] the last one gets added to the map. + * + * The returned map preserves the entry iteration order of the original char sequence. + */ +public header inline fun CharSequence.associateBy(keySelector: (Char) -> K, valueTransform: (Char) -> V): Map + +/** + * Populates and returns the [destination] mutable map with key-value pairs, + * where key is provided by the [keySelector] function applied to each character of the given char sequence + * and value is the character itself. + * + * If any two characters would have the same key returned by [keySelector] the last one gets added to the map. + */ +public header inline fun > CharSequence.associateByTo(destination: M, keySelector: (Char) -> K): M + +/** + * Populates and returns the [destination] mutable map with key-value pairs, + * where key is provided by the [keySelector] function and + * and value is provided by the [valueTransform] function applied to characters of the given char sequence. + * + * If any two characters would have the same key returned by [keySelector] the last one gets added to the map. + */ +public header inline fun > CharSequence.associateByTo(destination: M, keySelector: (Char) -> K, valueTransform: (Char) -> V): M + +/** + * Populates and returns the [destination] mutable map with key-value pairs + * provided by [transform] function applied to each character of the given char sequence. + * + * If any of two pairs would have the same key the last one gets added to the map. + */ +public header inline fun > CharSequence.associateTo(destination: M, transform: (Char) -> Pair): M + +/** + * Appends all characters to the given [destination] collection. + */ +public header fun > CharSequence.toCollection(destination: C): C + +/** + * Returns a [HashSet] of all characters. + */ +public header fun CharSequence.toHashSet(): HashSet + +/** + * Returns a [List] containing all characters. + */ +public header fun CharSequence.toList(): List + +/** + * Returns a [MutableList] filled with all characters of this char sequence. + */ +public header fun CharSequence.toMutableList(): MutableList + +/** + * Returns a [Set] of all characters. + * + * The returned set preserves the element iteration order of the original char sequence. + */ +public header fun CharSequence.toSet(): Set + +/** + * Returns a single list of all elements yielded from results of [transform] function being invoked on each character of original char sequence. + */ +public header inline fun CharSequence.flatMap(transform: (Char) -> Iterable): List + +/** + * Appends all elements yielded from results of [transform] function being invoked on each character of original char sequence, to the given [destination]. + */ +public header inline fun > CharSequence.flatMapTo(destination: C, transform: (Char) -> Iterable): C + +/** + * Groups characters of the original char sequence by the key returned by the given [keySelector] function + * applied to each character and returns a map where each group key is associated with a list of corresponding characters. + * + * The returned map preserves the entry iteration order of the keys produced from the original char sequence. + * + * @sample samples.collections.Collections.Transformations.groupBy + */ +public header inline fun CharSequence.groupBy(keySelector: (Char) -> K): Map> + +/** + * Groups values returned by the [valueTransform] function applied to each character of the original char sequence + * by the key returned by the given [keySelector] function applied to the character + * and returns a map where each group key is associated with a list of corresponding values. + * + * The returned map preserves the entry iteration order of the keys produced from the original char sequence. + * + * @sample samples.collections.Collections.Transformations.groupByKeysAndValues + */ +public header inline fun CharSequence.groupBy(keySelector: (Char) -> K, valueTransform: (Char) -> V): Map> + +/** + * Groups characters of the original char sequence by the key returned by the given [keySelector] function + * applied to each character and puts to the [destination] map each group key associated with a list of corresponding characters. + * + * @return The [destination] map. + * + * @sample samples.collections.Collections.Transformations.groupBy + */ +public header inline fun >> CharSequence.groupByTo(destination: M, keySelector: (Char) -> K): M + +/** + * Groups values returned by the [valueTransform] function applied to each character of the original char sequence + * by the key returned by the given [keySelector] function applied to the character + * and puts to the [destination] map each group key associated with a list of corresponding values. + * + * @return The [destination] map. + * + * @sample samples.collections.Collections.Transformations.groupByKeysAndValues + */ +public header inline fun >> CharSequence.groupByTo(destination: M, keySelector: (Char) -> K, valueTransform: (Char) -> V): M + +/** + * Returns a list containing the results of applying the given [transform] function + * to each character in the original char sequence. + */ +public header inline fun CharSequence.map(transform: (Char) -> R): List + +/** + * Returns a list containing the results of applying the given [transform] function + * to each character and its index in the original char sequence. + * @param [transform] function that takes the index of a character and the character itself + * and returns the result of the transform applied to the character. + */ +public header inline fun CharSequence.mapIndexed(transform: (Int, Char) -> R): List + +/** + * Returns a list containing only the non-null results of applying the given [transform] function + * to each character and its index in the original char sequence. + * @param [transform] function that takes the index of a character and the character itself + * and returns the result of the transform applied to the character. + */ +public header inline fun CharSequence.mapIndexedNotNull(transform: (Int, Char) -> R?): List + +/** + * Applies the given [transform] function to each character and its index in the original char sequence + * and appends only the non-null results to the given [destination]. + * @param [transform] function that takes the index of a character and the character itself + * and returns the result of the transform applied to the character. + */ +public header inline fun > CharSequence.mapIndexedNotNullTo(destination: C, transform: (Int, Char) -> R?): C + +/** + * Applies the given [transform] function to each character and its index in the original char sequence + * and appends the results to the given [destination]. + * @param [transform] function that takes the index of a character and the character itself + * and returns the result of the transform applied to the character. + */ +public header inline fun > CharSequence.mapIndexedTo(destination: C, transform: (Int, Char) -> R): C + +/** + * Returns a list containing only the non-null results of applying the given [transform] function + * to each character in the original char sequence. + */ +public header inline fun CharSequence.mapNotNull(transform: (Char) -> R?): List + +/** + * Applies the given [transform] function to each character in the original char sequence + * and appends only the non-null results to the given [destination]. + */ +public header inline fun > CharSequence.mapNotNullTo(destination: C, transform: (Char) -> R?): C + +/** + * Applies the given [transform] function to each character of the original char sequence + * and appends the results to the given [destination]. + */ +public header inline fun > CharSequence.mapTo(destination: C, transform: (Char) -> R): C + +/** + * Returns a lazy [Iterable] of [IndexedValue] for each character of the original char sequence. + */ +public header fun CharSequence.withIndex(): Iterable> + +/** + * Returns `true` if all characters match the given [predicate]. + */ +public header inline fun CharSequence.all(predicate: (Char) -> Boolean): Boolean + +/** + * Returns `true` if char sequence has at least one character. + */ +public header fun CharSequence.any(): Boolean + +/** + * Returns `true` if at least one character matches the given [predicate]. + */ +public header inline fun CharSequence.any(predicate: (Char) -> Boolean): Boolean + +/** + * Returns the length of this char sequence. + */ +@kotlin.internal.InlineOnly +public header inline fun CharSequence.count(): Int + +/** + * Returns the number of characters matching the given [predicate]. + */ +public header inline fun CharSequence.count(predicate: (Char) -> Boolean): Int + +/** + * Accumulates value starting with [initial] value and applying [operation] from left to right to current accumulator value and each character. + */ +public header inline fun CharSequence.fold(initial: R, operation: (R, Char) -> R): R + +/** + * Accumulates value starting with [initial] value and applying [operation] from left to right + * to current accumulator value and each character with its index in the original char sequence. + * @param [operation] function that takes the index of a character, current accumulator value + * and the character itself, and calculates the next accumulator value. + */ +public header inline fun CharSequence.foldIndexed(initial: R, operation: (Int, R, Char) -> R): R + +/** + * Accumulates value starting with [initial] value and applying [operation] from right to left to each character and current accumulator value. + */ +public header inline fun CharSequence.foldRight(initial: R, operation: (Char, R) -> R): R + +/** + * Accumulates value starting with [initial] value and applying [operation] from right to left + * to each character with its index in the original char sequence and current accumulator value. + * @param [operation] function that takes the index of a character, the character itself + * and current accumulator value, and calculates the next accumulator value. + */ +public header inline fun CharSequence.foldRightIndexed(initial: R, operation: (Int, Char, R) -> R): R + +/** + * Performs the given [action] on each character. + */ +public header inline fun CharSequence.forEach(action: (Char) -> Unit): Unit + +/** + * Performs the given [action] on each character, providing sequential index with the character. + * @param [action] function that takes the index of a character and the character itself + * and performs the desired action on the character. + */ +public header inline fun CharSequence.forEachIndexed(action: (Int, Char) -> Unit): Unit + +/** + * Returns the largest character or `null` if there are no characters. + */ +public header fun CharSequence.max(): Char? + +/** + * Returns the first character yielding the largest value of the given function or `null` if there are no characters. + */ +public header inline fun > CharSequence.maxBy(selector: (Char) -> R): Char? + +/** + * Returns the first character having the largest value according to the provided [comparator] or `null` if there are no characters. + */ +public header fun CharSequence.maxWith(comparator: Comparator): Char? + +/** + * Returns the smallest character or `null` if there are no characters. + */ +public header fun CharSequence.min(): Char? + +/** + * Returns the first character yielding the smallest value of the given function or `null` if there are no characters. + */ +public header inline fun > CharSequence.minBy(selector: (Char) -> R): Char? + +/** + * Returns the first character having the smallest value according to the provided [comparator] or `null` if there are no characters. + */ +public header fun CharSequence.minWith(comparator: Comparator): Char? + +/** + * Returns `true` if the char sequence has no characters. + */ +public header fun CharSequence.none(): Boolean + +/** + * Returns `true` if no characters match the given [predicate]. + */ +public header inline fun CharSequence.none(predicate: (Char) -> Boolean): Boolean + +/** + * Performs the given [action] on each character and returns the char sequence itself afterwards. + */ +@SinceKotlin("1.1") +public header inline fun S.onEach(action: (Char) -> Unit): S + +/** + * Accumulates value starting with the first character and applying [operation] from left to right to current accumulator value and each character. + */ +public header inline fun CharSequence.reduce(operation: (Char, Char) -> Char): Char + +/** + * Accumulates value starting with the first character and applying [operation] from left to right + * to current accumulator value and each character with its index in the original char sequence. + * @param [operation] function that takes the index of a character, current accumulator value + * and the character itself and calculates the next accumulator value. + */ +public header inline fun CharSequence.reduceIndexed(operation: (Int, Char, Char) -> Char): Char + +/** + * Accumulates value starting with last character and applying [operation] from right to left to each character and current accumulator value. + */ +public header inline fun CharSequence.reduceRight(operation: (Char, Char) -> Char): Char + +/** + * Accumulates value starting with last character and applying [operation] from right to left + * to each character with its index in the original char sequence and current accumulator value. + * @param [operation] function that takes the index of a character, the character itself + * and current accumulator value, and calculates the next accumulator value. + */ +public header inline fun CharSequence.reduceRightIndexed(operation: (Int, Char, Char) -> Char): Char + +/** + * Returns the sum of all values produced by [selector] function applied to each character in the char sequence. + */ +public header inline fun CharSequence.sumBy(selector: (Char) -> Int): Int + +/** + * Returns the sum of all values produced by [selector] function applied to each character in the char sequence. + */ +public header inline fun CharSequence.sumByDouble(selector: (Char) -> Double): Double + +/** + * Splits the original char sequence into pair of char sequences, + * where *first* char sequence contains characters for which [predicate] yielded `true`, + * while *second* char sequence contains characters for which [predicate] yielded `false`. + */ +public header inline fun CharSequence.partition(predicate: (Char) -> Boolean): Pair + +/** + * Splits the original string into pair of strings, + * where *first* string contains characters for which [predicate] yielded `true`, + * while *second* string contains characters for which [predicate] yielded `false`. + */ +public header inline fun String.partition(predicate: (Char) -> Boolean): Pair + +/** + * Returns a list of pairs built from characters of both char sequences with same indexes. List has length of shortest char sequence. + */ +public header infix fun CharSequence.zip(other: CharSequence): List> + +/** + * Returns a list of values built from characters of both char sequences with same indexes using provided [transform]. List has length of shortest char sequence. + */ +public header inline fun CharSequence.zip(other: CharSequence, transform: (Char, Char) -> V): List + +/** + * Creates an [Iterable] instance that wraps the original char sequence returning its characters when being iterated. + */ +public header fun CharSequence.asIterable(): Iterable + +/** + * Creates a [Sequence] instance that wraps the original char sequence returning its characters when being iterated. + */ +public header fun CharSequence.asSequence(): Sequence + diff --git a/libraries/tools/kotlin-stdlib-gen/src/generators/GenerateStandardLib.kt b/libraries/tools/kotlin-stdlib-gen/src/generators/GenerateStandardLib.kt index 6010f69da7d..2b76d5ad92d 100644 --- a/libraries/tools/kotlin-stdlib-gen/src/generators/GenerateStandardLib.kt +++ b/libraries/tools/kotlin-stdlib-gen/src/generators/GenerateStandardLib.kt @@ -28,7 +28,7 @@ fun main(args: Array) { generateCollectionsAPI(outDir) generateCollectionsJsAPI(jsCoreDir) - generateCommonAPI(baseDir.resolve("out/src/stdlib/common").apply { mkdirs() }) + generateCommonAPI(baseDir.resolve("libraries/stdlib/common/src/generated")) }