From ae60f7a32ff24541736fa7d266d65446d9999396 Mon Sep 17 00:00:00 2001 From: Ilya Gorbunov Date: Wed, 27 May 2015 18:21:17 +0300 Subject: [PATCH] Prettify kdocs and exception messages in the generated code. --- js/js.libraries/src/core/kotlin_special.kt | 18 +- libraries/stdlib/src/generated/_Aggregates.kt | 552 ++++++++-------- libraries/stdlib/src/generated/_Arrays.kt | 90 +-- libraries/stdlib/src/generated/_Elements.kt | 588 +++++++++--------- libraries/stdlib/src/generated/_Filtering.kt | 268 ++++---- libraries/stdlib/src/generated/_Generators.kt | 184 +++--- libraries/stdlib/src/generated/_Guards.kt | 20 +- libraries/stdlib/src/generated/_Mapping.kt | 350 +++++------ libraries/stdlib/src/generated/_Numeric.kt | 60 +- libraries/stdlib/src/generated/_Ordering.kt | 86 +-- libraries/stdlib/src/generated/_Ranges.kt | 60 +- libraries/stdlib/src/generated/_Sequences.kt | 28 +- libraries/stdlib/src/generated/_Snapshots.kt | 238 +++---- libraries/stdlib/src/generated/_SpecialJVM.kt | 138 ++-- .../src/templates/Aggregates.kt | 59 +- .../kotlin-stdlib-gen/src/templates/Arrays.kt | 10 +- .../src/templates/Elements.kt | 86 +-- .../src/templates/Filtering.kt | 58 +- .../src/templates/Generators.kt | 24 +- .../kotlin-stdlib-gen/src/templates/Guards.kt | 6 +- .../src/templates/Mapping.kt | 44 +- .../src/templates/Numeric.kt | 2 +- .../src/templates/Ordering.kt | 18 +- .../kotlin-stdlib-gen/src/templates/Ranges.kt | 10 +- .../src/templates/Sequence.kt | 2 +- .../src/templates/Snapshots.kt | 20 +- .../src/templates/SpecialJS.kt | 2 +- .../src/templates/SpecialJVM.kt | 24 +- 28 files changed, 1523 insertions(+), 1522 deletions(-) diff --git a/js/js.libraries/src/core/kotlin_special.kt b/js/js.libraries/src/core/kotlin_special.kt index 7ac986e0cd9..a04427d27d2 100644 --- a/js/js.libraries/src/core/kotlin_special.kt +++ b/js/js.libraries/src/core/kotlin_special.kt @@ -11,7 +11,7 @@ import java.util.* import java.util.Collections // TODO: it's temporary while we have java.util.Collections in js /** - * Returns a list that wraps the original array + * Returns a [List] that wraps the original array. */ public fun Array.asList(): List { val al = ArrayList() @@ -20,56 +20,56 @@ public fun Array.asList(): List { } /** - * Returns a list that wraps the original array + * Returns a [List] that wraps the original array. */ public inline fun BooleanArray.asList(): List { return (this as Array).asList() } /** - * Returns a list that wraps the original array + * Returns a [List] that wraps the original array. */ public inline fun ByteArray.asList(): List { return (this as Array).asList() } /** - * Returns a list that wraps the original array + * Returns a [List] that wraps the original array. */ public inline fun CharArray.asList(): List { return (this as Array).asList() } /** - * Returns a list that wraps the original array + * Returns a [List] that wraps the original array. */ public inline fun DoubleArray.asList(): List { return (this as Array).asList() } /** - * Returns a list that wraps the original array + * Returns a [List] that wraps the original array. */ public inline fun FloatArray.asList(): List { return (this as Array).asList() } /** - * Returns a list that wraps the original array + * Returns a [List] that wraps the original array. */ public inline fun IntArray.asList(): List { return (this as Array).asList() } /** - * Returns a list that wraps the original array + * Returns a [List] that wraps the original array. */ public inline fun LongArray.asList(): List { return (this as Array).asList() } /** - * Returns a list that wraps the original array + * Returns a [List] that wraps the original array. */ public inline fun ShortArray.asList(): List { return (this as Array).asList() diff --git a/libraries/stdlib/src/generated/_Aggregates.kt b/libraries/stdlib/src/generated/_Aggregates.kt index 950ef6815bf..5fe47d703a6 100644 --- a/libraries/stdlib/src/generated/_Aggregates.kt +++ b/libraries/stdlib/src/generated/_Aggregates.kt @@ -11,7 +11,7 @@ import java.util.* import java.util.Collections // TODO: it's temporary while we have java.util.Collections in js /** - * Returns *true* if all elements match the given *predicate* + * Returns `true` if all elements match the given [predicate]. */ public inline fun Array.all(predicate: (T) -> Boolean): Boolean { for (element in this) if (!predicate(element)) return false @@ -19,7 +19,7 @@ public inline fun Array.all(predicate: (T) -> Boolean): Boolean { } /** - * Returns *true* if all elements match the given *predicate* + * Returns `true` if all elements match the given [predicate]. */ public inline fun BooleanArray.all(predicate: (Boolean) -> Boolean): Boolean { for (element in this) if (!predicate(element)) return false @@ -27,7 +27,7 @@ public inline fun BooleanArray.all(predicate: (Boolean) -> Boolean): Boolean { } /** - * Returns *true* if all elements match the given *predicate* + * Returns `true` if all elements match the given [predicate]. */ public inline fun ByteArray.all(predicate: (Byte) -> Boolean): Boolean { for (element in this) if (!predicate(element)) return false @@ -35,7 +35,7 @@ public inline fun ByteArray.all(predicate: (Byte) -> Boolean): Boolean { } /** - * Returns *true* if all elements match the given *predicate* + * Returns `true` if all elements match the given [predicate]. */ public inline fun CharArray.all(predicate: (Char) -> Boolean): Boolean { for (element in this) if (!predicate(element)) return false @@ -43,7 +43,7 @@ public inline fun CharArray.all(predicate: (Char) -> Boolean): Boolean { } /** - * Returns *true* if all elements match the given *predicate* + * Returns `true` if all elements match the given [predicate]. */ public inline fun DoubleArray.all(predicate: (Double) -> Boolean): Boolean { for (element in this) if (!predicate(element)) return false @@ -51,7 +51,7 @@ public inline fun DoubleArray.all(predicate: (Double) -> Boolean): Boolean { } /** - * Returns *true* if all elements match the given *predicate* + * Returns `true` if all elements match the given [predicate]. */ public inline fun FloatArray.all(predicate: (Float) -> Boolean): Boolean { for (element in this) if (!predicate(element)) return false @@ -59,7 +59,7 @@ public inline fun FloatArray.all(predicate: (Float) -> Boolean): Boolean { } /** - * Returns *true* if all elements match the given *predicate* + * Returns `true` if all elements match the given [predicate]. */ public inline fun IntArray.all(predicate: (Int) -> Boolean): Boolean { for (element in this) if (!predicate(element)) return false @@ -67,7 +67,7 @@ public inline fun IntArray.all(predicate: (Int) -> Boolean): Boolean { } /** - * Returns *true* if all elements match the given *predicate* + * Returns `true` if all elements match the given [predicate]. */ public inline fun LongArray.all(predicate: (Long) -> Boolean): Boolean { for (element in this) if (!predicate(element)) return false @@ -75,7 +75,7 @@ public inline fun LongArray.all(predicate: (Long) -> Boolean): Boolean { } /** - * Returns *true* if all elements match the given *predicate* + * Returns `true` if all elements match the given [predicate]. */ public inline fun ShortArray.all(predicate: (Short) -> Boolean): Boolean { for (element in this) if (!predicate(element)) return false @@ -83,7 +83,7 @@ public inline fun ShortArray.all(predicate: (Short) -> Boolean): Boolean { } /** - * Returns *true* if all elements match the given *predicate* + * Returns `true` if all elements match the given [predicate]. */ public inline fun Iterable.all(predicate: (T) -> Boolean): Boolean { for (element in this) if (!predicate(element)) return false @@ -91,7 +91,7 @@ public inline fun Iterable.all(predicate: (T) -> Boolean): Boolean { } /** - * Returns *true* if all elements match the given *predicate* + * Returns `true` if all elements match the given [predicate]. */ public inline fun Map.all(predicate: (Map.Entry) -> Boolean): Boolean { for (element in this) if (!predicate(element)) return false @@ -99,7 +99,7 @@ public inline fun Map.all(predicate: (Map.Entry) -> Boolean): } /** - * Returns *true* if all elements match the given *predicate* + * Returns `true` if all elements match the given [predicate]. */ public inline fun Sequence.all(predicate: (T) -> Boolean): Boolean { for (element in this) if (!predicate(element)) return false @@ -109,7 +109,7 @@ public inline fun Sequence.all(predicate: (T) -> Boolean): Boolean { deprecated("Migrate to using Sequence and respective functions") /** - * Returns *true* if all elements match the given *predicate* + * Returns `true` if all elements match the given [predicate]. */ public inline fun Stream.all(predicate: (T) -> Boolean): Boolean { for (element in this) if (!predicate(element)) return false @@ -117,7 +117,7 @@ public inline fun Stream.all(predicate: (T) -> Boolean): Boolean { } /** - * Returns *true* if all elements match the given *predicate* + * Returns `true` if all elements match the given [predicate]. */ public inline fun String.all(predicate: (Char) -> Boolean): Boolean { for (element in this) if (!predicate(element)) return false @@ -125,7 +125,7 @@ public inline fun String.all(predicate: (Char) -> Boolean): Boolean { } /** - * Returns *true* if collection has at least one element + * Returns `true` if collection has at least one element. */ public fun Array.any(): Boolean { for (element in this) return true @@ -133,7 +133,7 @@ public fun Array.any(): Boolean { } /** - * Returns *true* if collection has at least one element + * Returns `true` if collection has at least one element. */ public fun BooleanArray.any(): Boolean { for (element in this) return true @@ -141,7 +141,7 @@ public fun BooleanArray.any(): Boolean { } /** - * Returns *true* if collection has at least one element + * Returns `true` if collection has at least one element. */ public fun ByteArray.any(): Boolean { for (element in this) return true @@ -149,7 +149,7 @@ public fun ByteArray.any(): Boolean { } /** - * Returns *true* if collection has at least one element + * Returns `true` if collection has at least one element. */ public fun CharArray.any(): Boolean { for (element in this) return true @@ -157,7 +157,7 @@ public fun CharArray.any(): Boolean { } /** - * Returns *true* if collection has at least one element + * Returns `true` if collection has at least one element. */ public fun DoubleArray.any(): Boolean { for (element in this) return true @@ -165,7 +165,7 @@ public fun DoubleArray.any(): Boolean { } /** - * Returns *true* if collection has at least one element + * Returns `true` if collection has at least one element. */ public fun FloatArray.any(): Boolean { for (element in this) return true @@ -173,7 +173,7 @@ public fun FloatArray.any(): Boolean { } /** - * Returns *true* if collection has at least one element + * Returns `true` if collection has at least one element. */ public fun IntArray.any(): Boolean { for (element in this) return true @@ -181,7 +181,7 @@ public fun IntArray.any(): Boolean { } /** - * Returns *true* if collection has at least one element + * Returns `true` if collection has at least one element. */ public fun LongArray.any(): Boolean { for (element in this) return true @@ -189,7 +189,7 @@ public fun LongArray.any(): Boolean { } /** - * Returns *true* if collection has at least one element + * Returns `true` if collection has at least one element. */ public fun ShortArray.any(): Boolean { for (element in this) return true @@ -197,7 +197,7 @@ public fun ShortArray.any(): Boolean { } /** - * Returns *true* if collection has at least one element + * Returns `true` if collection has at least one element. */ public fun Iterable.any(): Boolean { for (element in this) return true @@ -205,7 +205,7 @@ public fun Iterable.any(): Boolean { } /** - * Returns *true* if collection has at least one element + * Returns `true` if collection has at least one element. */ public fun Map.any(): Boolean { for (element in this) return true @@ -213,7 +213,7 @@ public fun Map.any(): Boolean { } /** - * Returns *true* if collection has at least one element + * Returns `true` if collection has at least one element. */ public fun Sequence.any(): Boolean { for (element in this) return true @@ -223,7 +223,7 @@ public fun Sequence.any(): Boolean { deprecated("Migrate to using Sequence and respective functions") /** - * Returns *true* if collection has at least one element + * Returns `true` if collection has at least one element. */ public fun Stream.any(): Boolean { for (element in this) return true @@ -231,7 +231,7 @@ public fun Stream.any(): Boolean { } /** - * Returns *true* if collection has at least one element + * Returns `true` if collection has at least one element. */ public fun String.any(): Boolean { for (element in this) return true @@ -239,7 +239,7 @@ public fun String.any(): Boolean { } /** - * Returns *true* if any element matches the given [predicate] + * Returns `true` if at least one element matches the given [predicate]. */ public inline fun Array.any(predicate: (T) -> Boolean): Boolean { for (element in this) if (predicate(element)) return true @@ -247,7 +247,7 @@ public inline fun Array.any(predicate: (T) -> Boolean): Boolean { } /** - * Returns *true* if any element matches the given [predicate] + * Returns `true` if at least one element matches the given [predicate]. */ public inline fun BooleanArray.any(predicate: (Boolean) -> Boolean): Boolean { for (element in this) if (predicate(element)) return true @@ -255,7 +255,7 @@ public inline fun BooleanArray.any(predicate: (Boolean) -> Boolean): Boolean { } /** - * Returns *true* if any element matches the given [predicate] + * Returns `true` if at least one element matches the given [predicate]. */ public inline fun ByteArray.any(predicate: (Byte) -> Boolean): Boolean { for (element in this) if (predicate(element)) return true @@ -263,7 +263,7 @@ public inline fun ByteArray.any(predicate: (Byte) -> Boolean): Boolean { } /** - * Returns *true* if any element matches the given [predicate] + * Returns `true` if at least one element matches the given [predicate]. */ public inline fun CharArray.any(predicate: (Char) -> Boolean): Boolean { for (element in this) if (predicate(element)) return true @@ -271,7 +271,7 @@ public inline fun CharArray.any(predicate: (Char) -> Boolean): Boolean { } /** - * Returns *true* if any element matches the given [predicate] + * Returns `true` if at least one element matches the given [predicate]. */ public inline fun DoubleArray.any(predicate: (Double) -> Boolean): Boolean { for (element in this) if (predicate(element)) return true @@ -279,7 +279,7 @@ public inline fun DoubleArray.any(predicate: (Double) -> Boolean): Boolean { } /** - * Returns *true* if any element matches the given [predicate] + * Returns `true` if at least one element matches the given [predicate]. */ public inline fun FloatArray.any(predicate: (Float) -> Boolean): Boolean { for (element in this) if (predicate(element)) return true @@ -287,7 +287,7 @@ public inline fun FloatArray.any(predicate: (Float) -> Boolean): Boolean { } /** - * Returns *true* if any element matches the given [predicate] + * Returns `true` if at least one element matches the given [predicate]. */ public inline fun IntArray.any(predicate: (Int) -> Boolean): Boolean { for (element in this) if (predicate(element)) return true @@ -295,7 +295,7 @@ public inline fun IntArray.any(predicate: (Int) -> Boolean): Boolean { } /** - * Returns *true* if any element matches the given [predicate] + * Returns `true` if at least one element matches the given [predicate]. */ public inline fun LongArray.any(predicate: (Long) -> Boolean): Boolean { for (element in this) if (predicate(element)) return true @@ -303,7 +303,7 @@ public inline fun LongArray.any(predicate: (Long) -> Boolean): Boolean { } /** - * Returns *true* if any element matches the given [predicate] + * Returns `true` if at least one element matches the given [predicate]. */ public inline fun ShortArray.any(predicate: (Short) -> Boolean): Boolean { for (element in this) if (predicate(element)) return true @@ -311,7 +311,7 @@ public inline fun ShortArray.any(predicate: (Short) -> Boolean): Boolean { } /** - * Returns *true* if any element matches the given [predicate] + * Returns `true` if at least one element matches the given [predicate]. */ public inline fun Iterable.any(predicate: (T) -> Boolean): Boolean { for (element in this) if (predicate(element)) return true @@ -319,7 +319,7 @@ public inline fun Iterable.any(predicate: (T) -> Boolean): Boolean { } /** - * Returns *true* if any element matches the given [predicate] + * Returns `true` if at least one element matches the given [predicate]. */ public inline fun Map.any(predicate: (Map.Entry) -> Boolean): Boolean { for (element in this) if (predicate(element)) return true @@ -327,7 +327,7 @@ public inline fun Map.any(predicate: (Map.Entry) -> Boolean): } /** - * Returns *true* if any element matches the given [predicate] + * Returns `true` if at least one element matches the given [predicate]. */ public inline fun Sequence.any(predicate: (T) -> Boolean): Boolean { for (element in this) if (predicate(element)) return true @@ -337,7 +337,7 @@ public inline fun Sequence.any(predicate: (T) -> Boolean): Boolean { deprecated("Migrate to using Sequence and respective functions") /** - * Returns *true* if any element matches the given [predicate] + * Returns `true` if at least one element matches the given [predicate]. */ public inline fun Stream.any(predicate: (T) -> Boolean): Boolean { for (element in this) if (predicate(element)) return true @@ -345,7 +345,7 @@ public inline fun Stream.any(predicate: (T) -> Boolean): Boolean { } /** - * Returns *true* if any element matches the given [predicate] + * Returns `true` if at least one element matches the given [predicate]. */ public inline fun String.any(predicate: (Char) -> Boolean): Boolean { for (element in this) if (predicate(element)) return true @@ -353,77 +353,77 @@ public inline fun String.any(predicate: (Char) -> Boolean): Boolean { } /** - * Returns the number of elements + * Returns the number of elements in this collection. */ public fun Array.count(): Int { return size() } /** - * Returns the number of elements + * Returns the number of elements in this collection. */ public fun BooleanArray.count(): Int { return size() } /** - * Returns the number of elements + * Returns the number of elements in this collection. */ public fun ByteArray.count(): Int { return size() } /** - * Returns the number of elements + * Returns the number of elements in this collection. */ public fun CharArray.count(): Int { return size() } /** - * Returns the number of elements + * Returns the number of elements in this collection. */ public fun DoubleArray.count(): Int { return size() } /** - * Returns the number of elements + * Returns the number of elements in this collection. */ public fun FloatArray.count(): Int { return size() } /** - * Returns the number of elements + * Returns the number of elements in this collection. */ public fun IntArray.count(): Int { return size() } /** - * Returns the number of elements + * Returns the number of elements in this collection. */ public fun LongArray.count(): Int { return size() } /** - * Returns the number of elements + * Returns the number of elements in this collection. */ public fun ShortArray.count(): Int { return size() } /** - * Returns the number of elements + * Returns the number of elements in this collection. */ public fun Collection.count(): Int { return size() } /** - * Returns the number of elements + * Returns the number of elements in this collection. */ public fun Iterable.count(): Int { var count = 0 @@ -432,14 +432,14 @@ public fun Iterable.count(): Int { } /** - * Returns the number of elements + * Returns the number of elements in this collection. */ public fun Map.count(): Int { return size() } /** - * Returns the number of elements + * Returns the number of elements in this collection. */ public fun Sequence.count(): Int { var count = 0 @@ -450,7 +450,7 @@ public fun Sequence.count(): Int { deprecated("Migrate to using Sequence and respective functions") /** - * Returns the number of elements + * Returns the number of elements in this collection. */ public fun Stream.count(): Int { var count = 0 @@ -459,14 +459,14 @@ public fun Stream.count(): Int { } /** - * Returns the number of elements + * Returns the length of this string. */ public fun String.count(): Int { return length() } /** - * Returns the number of elements matching the given [predicate] + * Returns the number of elements matching the given [predicate]. */ public inline fun Array.count(predicate: (T) -> Boolean): Int { var count = 0 @@ -475,7 +475,7 @@ public inline fun Array.count(predicate: (T) -> Boolean): Int { } /** - * Returns the number of elements matching the given [predicate] + * Returns the number of elements matching the given [predicate]. */ public inline fun BooleanArray.count(predicate: (Boolean) -> Boolean): Int { var count = 0 @@ -484,7 +484,7 @@ public inline fun BooleanArray.count(predicate: (Boolean) -> Boolean): Int { } /** - * Returns the number of elements matching the given [predicate] + * Returns the number of elements matching the given [predicate]. */ public inline fun ByteArray.count(predicate: (Byte) -> Boolean): Int { var count = 0 @@ -493,7 +493,7 @@ public inline fun ByteArray.count(predicate: (Byte) -> Boolean): Int { } /** - * Returns the number of elements matching the given [predicate] + * Returns the number of elements matching the given [predicate]. */ public inline fun CharArray.count(predicate: (Char) -> Boolean): Int { var count = 0 @@ -502,7 +502,7 @@ public inline fun CharArray.count(predicate: (Char) -> Boolean): Int { } /** - * Returns the number of elements matching the given [predicate] + * Returns the number of elements matching the given [predicate]. */ public inline fun DoubleArray.count(predicate: (Double) -> Boolean): Int { var count = 0 @@ -511,7 +511,7 @@ public inline fun DoubleArray.count(predicate: (Double) -> Boolean): Int { } /** - * Returns the number of elements matching the given [predicate] + * Returns the number of elements matching the given [predicate]. */ public inline fun FloatArray.count(predicate: (Float) -> Boolean): Int { var count = 0 @@ -520,7 +520,7 @@ public inline fun FloatArray.count(predicate: (Float) -> Boolean): Int { } /** - * Returns the number of elements matching the given [predicate] + * Returns the number of elements matching the given [predicate]. */ public inline fun IntArray.count(predicate: (Int) -> Boolean): Int { var count = 0 @@ -529,7 +529,7 @@ public inline fun IntArray.count(predicate: (Int) -> Boolean): Int { } /** - * Returns the number of elements matching the given [predicate] + * Returns the number of elements matching the given [predicate]. */ public inline fun LongArray.count(predicate: (Long) -> Boolean): Int { var count = 0 @@ -538,7 +538,7 @@ public inline fun LongArray.count(predicate: (Long) -> Boolean): Int { } /** - * Returns the number of elements matching the given [predicate] + * Returns the number of elements matching the given [predicate]. */ public inline fun ShortArray.count(predicate: (Short) -> Boolean): Int { var count = 0 @@ -547,7 +547,7 @@ public inline fun ShortArray.count(predicate: (Short) -> Boolean): Int { } /** - * Returns the number of elements matching the given [predicate] + * Returns the number of elements matching the given [predicate]. */ public inline fun Iterable.count(predicate: (T) -> Boolean): Int { var count = 0 @@ -556,7 +556,7 @@ public inline fun Iterable.count(predicate: (T) -> Boolean): Int { } /** - * Returns the number of elements matching the given [predicate] + * Returns the number of elements matching the given [predicate]. */ public inline fun Map.count(predicate: (Map.Entry) -> Boolean): Int { var count = 0 @@ -565,7 +565,7 @@ public inline fun Map.count(predicate: (Map.Entry) -> Boolean } /** - * Returns the number of elements matching the given [predicate] + * Returns the number of elements matching the given [predicate]. */ public inline fun Sequence.count(predicate: (T) -> Boolean): Int { var count = 0 @@ -576,7 +576,7 @@ public inline fun Sequence.count(predicate: (T) -> Boolean): Int { deprecated("Migrate to using Sequence and respective functions") /** - * Returns the number of elements matching the given [predicate] + * Returns the number of elements matching the given [predicate]. */ public inline fun Stream.count(predicate: (T) -> Boolean): Int { var count = 0 @@ -585,7 +585,7 @@ public inline fun Stream.count(predicate: (T) -> Boolean): Int { } /** - * Returns the number of elements matching the given [predicate] + * Returns the number of elements matching the given [predicate]. */ public inline fun String.count(predicate: (Char) -> Boolean): Int { var count = 0 @@ -594,7 +594,7 @@ public inline fun String.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 + * Accumulates value starting with [initial] value and applying [operation] from left to right to current accumulator value and each element. */ public inline fun Array.fold(initial: R, operation: (R, T) -> R): R { var accumulator = initial @@ -603,7 +603,7 @@ public inline fun Array.fold(initial: R, operation: (R, T) -> R): } /** - * Accumulates value starting with *initial* value and applying *operation* from left to right to current accumulator value and each element + * Accumulates value starting with [initial] value and applying [operation] from left to right to current accumulator value and each element. */ public inline fun BooleanArray.fold(initial: R, operation: (R, Boolean) -> R): R { var accumulator = initial @@ -612,7 +612,7 @@ public inline fun BooleanArray.fold(initial: R, operation: (R, Boolean) -> R } /** - * Accumulates value starting with *initial* value and applying *operation* from left to right to current accumulator value and each element + * Accumulates value starting with [initial] value and applying [operation] from left to right to current accumulator value and each element. */ public inline fun ByteArray.fold(initial: R, operation: (R, Byte) -> R): R { var accumulator = initial @@ -621,7 +621,7 @@ public 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 + * Accumulates value starting with [initial] value and applying [operation] from left to right to current accumulator value and each element. */ public inline fun CharArray.fold(initial: R, operation: (R, Char) -> R): R { var accumulator = initial @@ -630,7 +630,7 @@ public 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 + * Accumulates value starting with [initial] value and applying [operation] from left to right to current accumulator value and each element. */ public inline fun DoubleArray.fold(initial: R, operation: (R, Double) -> R): R { var accumulator = initial @@ -639,7 +639,7 @@ public inline fun DoubleArray.fold(initial: R, operation: (R, Double) -> R): } /** - * Accumulates value starting with *initial* value and applying *operation* from left to right to current accumulator value and each element + * Accumulates value starting with [initial] value and applying [operation] from left to right to current accumulator value and each element. */ public inline fun FloatArray.fold(initial: R, operation: (R, Float) -> R): R { var accumulator = initial @@ -648,7 +648,7 @@ public 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 + * Accumulates value starting with [initial] value and applying [operation] from left to right to current accumulator value and each element. */ public inline fun IntArray.fold(initial: R, operation: (R, Int) -> R): R { var accumulator = initial @@ -657,7 +657,7 @@ public 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 + * Accumulates value starting with [initial] value and applying [operation] from left to right to current accumulator value and each element. */ public inline fun LongArray.fold(initial: R, operation: (R, Long) -> R): R { var accumulator = initial @@ -666,7 +666,7 @@ public 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 + * Accumulates value starting with [initial] value and applying [operation] from left to right to current accumulator value and each element. */ public inline fun ShortArray.fold(initial: R, operation: (R, Short) -> R): R { var accumulator = initial @@ -675,7 +675,7 @@ public 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 + * Accumulates value starting with [initial] value and applying [operation] from left to right to current accumulator value and each element. */ public inline fun Iterable.fold(initial: R, operation: (R, T) -> R): R { var accumulator = initial @@ -684,7 +684,7 @@ public 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 + * Accumulates value starting with [initial] value and applying [operation] from left to right to current accumulator value and each element. */ public inline fun Sequence.fold(initial: R, operation: (R, T) -> R): R { var accumulator = initial @@ -695,7 +695,7 @@ public inline fun Sequence.fold(initial: R, operation: (R, T) -> R): R deprecated("Migrate to using Sequence and respective functions") /** - * Accumulates value starting with *initial* value and applying *operation* from left to right to current accumulator value and each element + * Accumulates value starting with [initial] value and applying [operation] from left to right to current accumulator value and each element. */ public inline fun Stream.fold(initial: R, operation: (R, T) -> R): R { var accumulator = initial @@ -704,7 +704,7 @@ public inline fun Stream.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 + * Accumulates value starting with [initial] value and applying [operation] from left to right to current accumulator value and each element. */ public inline fun String.fold(initial: R, operation: (R, Char) -> R): R { var accumulator = initial @@ -713,7 +713,7 @@ public inline fun String.fold(initial: R, operation: (R, Char) -> R): R { } /** - * Accumulates value starting with *initial* value and applying *operation* from right to left to each element and current accumulator value + * Accumulates value starting with [initial] value and applying [operation] from right to left to each element and current accumulator value. */ public inline fun Array.foldRight(initial: R, operation: (T, R) -> R): R { var index = lastIndex @@ -725,7 +725,7 @@ public inline fun Array.foldRight(initial: R, operation: (T, R) -> } /** - * Accumulates value starting with *initial* value and applying *operation* from right to left to each element and current accumulator value + * Accumulates value starting with [initial] value and applying [operation] from right to left to each element and current accumulator value. */ public inline fun BooleanArray.foldRight(initial: R, operation: (Boolean, R) -> R): R { var index = lastIndex @@ -737,7 +737,7 @@ public inline fun BooleanArray.foldRight(initial: R, operation: (Boolean, R) } /** - * Accumulates value starting with *initial* value and applying *operation* from right to left to each element and current accumulator value + * Accumulates value starting with [initial] value and applying [operation] from right to left to each element and current accumulator value. */ public inline fun ByteArray.foldRight(initial: R, operation: (Byte, R) -> R): R { var index = lastIndex @@ -749,7 +749,7 @@ public inline fun ByteArray.foldRight(initial: R, operation: (Byte, R) -> R) } /** - * Accumulates value starting with *initial* value and applying *operation* from right to left to each element and current accumulator value + * Accumulates value starting with [initial] value and applying [operation] from right to left to each element and current accumulator value. */ public inline fun CharArray.foldRight(initial: R, operation: (Char, R) -> R): R { var index = lastIndex @@ -761,7 +761,7 @@ public inline fun CharArray.foldRight(initial: R, operation: (Char, R) -> R) } /** - * Accumulates value starting with *initial* value and applying *operation* from right to left to each element and current accumulator value + * Accumulates value starting with [initial] value and applying [operation] from right to left to each element and current accumulator value. */ public inline fun DoubleArray.foldRight(initial: R, operation: (Double, R) -> R): R { var index = lastIndex @@ -773,7 +773,7 @@ public inline fun DoubleArray.foldRight(initial: R, operation: (Double, R) - } /** - * Accumulates value starting with *initial* value and applying *operation* from right to left to each element and current accumulator value + * Accumulates value starting with [initial] value and applying [operation] from right to left to each element and current accumulator value. */ public inline fun FloatArray.foldRight(initial: R, operation: (Float, R) -> R): R { var index = lastIndex @@ -785,7 +785,7 @@ public inline fun FloatArray.foldRight(initial: R, operation: (Float, R) -> } /** - * Accumulates value starting with *initial* value and applying *operation* from right to left to each element and current accumulator value + * Accumulates value starting with [initial] value and applying [operation] from right to left to each element and current accumulator value. */ public inline fun IntArray.foldRight(initial: R, operation: (Int, R) -> R): R { var index = lastIndex @@ -797,7 +797,7 @@ public inline fun IntArray.foldRight(initial: R, operation: (Int, R) -> R): } /** - * Accumulates value starting with *initial* value and applying *operation* from right to left to each element and current accumulator value + * Accumulates value starting with [initial] value and applying [operation] from right to left to each element and current accumulator value. */ public inline fun LongArray.foldRight(initial: R, operation: (Long, R) -> R): R { var index = lastIndex @@ -809,7 +809,7 @@ public inline fun LongArray.foldRight(initial: R, operation: (Long, R) -> R) } /** - * Accumulates value starting with *initial* value and applying *operation* from right to left to each element and current accumulator value + * Accumulates value starting with [initial] value and applying [operation] from right to left to each element and current accumulator value. */ public inline fun ShortArray.foldRight(initial: R, operation: (Short, R) -> R): R { var index = lastIndex @@ -821,7 +821,7 @@ public inline fun ShortArray.foldRight(initial: R, operation: (Short, R) -> } /** - * Accumulates value starting with *initial* value and applying *operation* from right to left to each element and current accumulator value + * Accumulates value starting with [initial] value and applying [operation] from right to left to each element and current accumulator value. */ public inline fun List.foldRight(initial: R, operation: (T, R) -> R): R { var index = lastIndex @@ -833,7 +833,7 @@ public inline fun List.foldRight(initial: R, operation: (T, R) -> R): } /** - * Accumulates value starting with *initial* value and applying *operation* from right to left to each element and current accumulator value + * Accumulates value starting with [initial] value and applying [operation] from right to left to each element and current accumulator value. */ public inline fun String.foldRight(initial: R, operation: (Char, R) -> R): R { var index = lastIndex @@ -845,84 +845,84 @@ public inline fun String.foldRight(initial: R, operation: (Char, R) -> R): R } /** - * Performs the given *operation* on each element + * Performs the given [operation] on each element. */ public inline fun Array.forEach(operation: (T) -> Unit): Unit { for (element in this) operation(element) } /** - * Performs the given *operation* on each element + * Performs the given [operation] on each element. */ public inline fun BooleanArray.forEach(operation: (Boolean) -> Unit): Unit { for (element in this) operation(element) } /** - * Performs the given *operation* on each element + * Performs the given [operation] on each element. */ public inline fun ByteArray.forEach(operation: (Byte) -> Unit): Unit { for (element in this) operation(element) } /** - * Performs the given *operation* on each element + * Performs the given [operation] on each element. */ public inline fun CharArray.forEach(operation: (Char) -> Unit): Unit { for (element in this) operation(element) } /** - * Performs the given *operation* on each element + * Performs the given [operation] on each element. */ public inline fun DoubleArray.forEach(operation: (Double) -> Unit): Unit { for (element in this) operation(element) } /** - * Performs the given *operation* on each element + * Performs the given [operation] on each element. */ public inline fun FloatArray.forEach(operation: (Float) -> Unit): Unit { for (element in this) operation(element) } /** - * Performs the given *operation* on each element + * Performs the given [operation] on each element. */ public inline fun IntArray.forEach(operation: (Int) -> Unit): Unit { for (element in this) operation(element) } /** - * Performs the given *operation* on each element + * Performs the given [operation] on each element. */ public inline fun LongArray.forEach(operation: (Long) -> Unit): Unit { for (element in this) operation(element) } /** - * Performs the given *operation* on each element + * Performs the given [operation] on each element. */ public inline fun ShortArray.forEach(operation: (Short) -> Unit): Unit { for (element in this) operation(element) } /** - * Performs the given *operation* on each element + * Performs the given [operation] on each element. */ public inline fun Iterable.forEach(operation: (T) -> Unit): Unit { for (element in this) operation(element) } /** - * Performs the given *operation* on each element + * Performs the given [operation] on each element. */ public inline fun Map.forEach(operation: (Map.Entry) -> Unit): Unit { for (element in this) operation(element) } /** - * Performs the given *operation* on each element + * Performs the given [operation] on each element. */ public inline fun Sequence.forEach(operation: (T) -> Unit): Unit { for (element in this) operation(element) @@ -931,21 +931,21 @@ public inline fun Sequence.forEach(operation: (T) -> Unit): Unit { deprecated("Migrate to using Sequence and respective functions") /** - * Performs the given *operation* on each element + * Performs the given [operation] on each element. */ public inline fun Stream.forEach(operation: (T) -> Unit): Unit { for (element in this) operation(element) } /** - * Performs the given *operation* on each element + * Performs the given [operation] on each element. */ public inline fun String.forEach(operation: (Char) -> Unit): Unit { for (element in this) operation(element) } /** - * Performs the given *operation* on each element, providing sequential index with the element + * Performs the given [operation] on each element, providing sequential index with the element. */ public inline fun Array.forEachIndexed(operation: (Int, T) -> Unit): Unit { var index = 0 @@ -953,7 +953,7 @@ public inline fun Array.forEachIndexed(operation: (Int, T) -> Unit): } /** - * Performs the given *operation* on each element, providing sequential index with the element + * Performs the given [operation] on each element, providing sequential index with the element. */ public inline fun BooleanArray.forEachIndexed(operation: (Int, Boolean) -> Unit): Unit { var index = 0 @@ -961,7 +961,7 @@ public inline fun BooleanArray.forEachIndexed(operation: (Int, Boolean) -> Unit) } /** - * Performs the given *operation* on each element, providing sequential index with the element + * Performs the given [operation] on each element, providing sequential index with the element. */ public inline fun ByteArray.forEachIndexed(operation: (Int, Byte) -> Unit): Unit { var index = 0 @@ -969,7 +969,7 @@ public inline fun ByteArray.forEachIndexed(operation: (Int, Byte) -> Unit): Unit } /** - * Performs the given *operation* on each element, providing sequential index with the element + * Performs the given [operation] on each element, providing sequential index with the element. */ public inline fun CharArray.forEachIndexed(operation: (Int, Char) -> Unit): Unit { var index = 0 @@ -977,7 +977,7 @@ public inline fun CharArray.forEachIndexed(operation: (Int, Char) -> Unit): Unit } /** - * Performs the given *operation* on each element, providing sequential index with the element + * Performs the given [operation] on each element, providing sequential index with the element. */ public inline fun DoubleArray.forEachIndexed(operation: (Int, Double) -> Unit): Unit { var index = 0 @@ -985,7 +985,7 @@ public inline fun DoubleArray.forEachIndexed(operation: (Int, Double) -> Unit): } /** - * Performs the given *operation* on each element, providing sequential index with the element + * Performs the given [operation] on each element, providing sequential index with the element. */ public inline fun FloatArray.forEachIndexed(operation: (Int, Float) -> Unit): Unit { var index = 0 @@ -993,7 +993,7 @@ public inline fun FloatArray.forEachIndexed(operation: (Int, Float) -> Unit): Un } /** - * Performs the given *operation* on each element, providing sequential index with the element + * Performs the given [operation] on each element, providing sequential index with the element. */ public inline fun IntArray.forEachIndexed(operation: (Int, Int) -> Unit): Unit { var index = 0 @@ -1001,7 +1001,7 @@ public inline fun IntArray.forEachIndexed(operation: (Int, Int) -> Unit): Unit { } /** - * Performs the given *operation* on each element, providing sequential index with the element + * Performs the given [operation] on each element, providing sequential index with the element. */ public inline fun LongArray.forEachIndexed(operation: (Int, Long) -> Unit): Unit { var index = 0 @@ -1009,7 +1009,7 @@ public inline fun LongArray.forEachIndexed(operation: (Int, Long) -> Unit): Unit } /** - * Performs the given *operation* on each element, providing sequential index with the element + * Performs the given [operation] on each element, providing sequential index with the element. */ public inline fun ShortArray.forEachIndexed(operation: (Int, Short) -> Unit): Unit { var index = 0 @@ -1017,7 +1017,7 @@ public inline fun ShortArray.forEachIndexed(operation: (Int, Short) -> Unit): Un } /** - * Performs the given *operation* on each element, providing sequential index with the element + * Performs the given [operation] on each element, providing sequential index with the element. */ public inline fun Iterable.forEachIndexed(operation: (Int, T) -> Unit): Unit { var index = 0 @@ -1025,7 +1025,7 @@ public inline fun Iterable.forEachIndexed(operation: (Int, T) -> Unit): U } /** - * Performs the given *operation* on each element, providing sequential index with the element + * Performs the given [operation] on each element, providing sequential index with the element. */ public inline fun Sequence.forEachIndexed(operation: (Int, T) -> Unit): Unit { var index = 0 @@ -1035,7 +1035,7 @@ public inline fun Sequence.forEachIndexed(operation: (Int, T) -> Unit): U deprecated("Migrate to using Sequence and respective functions") /** - * Performs the given *operation* on each element, providing sequential index with the element + * Performs the given [operation] on each element, providing sequential index with the element. */ public inline fun Stream.forEachIndexed(operation: (Int, T) -> Unit): Unit { var index = 0 @@ -1043,7 +1043,7 @@ public inline fun Stream.forEachIndexed(operation: (Int, T) -> Unit): Uni } /** - * Performs the given *operation* on each element, providing sequential index with the element + * Performs the given [operation] on each element, providing sequential index with the element. */ public inline fun String.forEachIndexed(operation: (Int, Char) -> Unit): Unit { var index = 0 @@ -1051,7 +1051,7 @@ public inline fun String.forEachIndexed(operation: (Int, Char) -> Unit): Unit { } /** - * Returns the largest element or null if there are no elements + * Returns the largest element or `null` if there are no elements. */ public fun > Array.max(): T? { if (isEmpty()) return null @@ -1064,7 +1064,7 @@ public fun > Array.max(): T? { } /** - * Returns the largest element or null if there are no elements + * Returns the largest element or `null` if there are no elements. */ public fun ByteArray.max(): Byte? { if (isEmpty()) return null @@ -1077,7 +1077,7 @@ public fun ByteArray.max(): Byte? { } /** - * Returns the largest element or null if there are no elements + * Returns the largest element or `null` if there are no elements. */ public fun CharArray.max(): Char? { if (isEmpty()) return null @@ -1090,7 +1090,7 @@ public fun CharArray.max(): Char? { } /** - * Returns the largest element or null if there are no elements + * Returns the largest element or `null` if there are no elements. */ public fun DoubleArray.max(): Double? { if (isEmpty()) return null @@ -1103,7 +1103,7 @@ public fun DoubleArray.max(): Double? { } /** - * Returns the largest element or null if there are no elements + * Returns the largest element or `null` if there are no elements. */ public fun FloatArray.max(): Float? { if (isEmpty()) return null @@ -1116,7 +1116,7 @@ public fun FloatArray.max(): Float? { } /** - * Returns the largest element or null if there are no elements + * Returns the largest element or `null` if there are no elements. */ public fun IntArray.max(): Int? { if (isEmpty()) return null @@ -1129,7 +1129,7 @@ public fun IntArray.max(): Int? { } /** - * Returns the largest element or null if there are no elements + * Returns the largest element or `null` if there are no elements. */ public fun LongArray.max(): Long? { if (isEmpty()) return null @@ -1142,7 +1142,7 @@ public fun LongArray.max(): Long? { } /** - * Returns the largest element or null if there are no elements + * Returns the largest element or `null` if there are no elements. */ public fun ShortArray.max(): Short? { if (isEmpty()) return null @@ -1155,7 +1155,7 @@ public fun ShortArray.max(): Short? { } /** - * Returns the largest element or null if there are no elements + * Returns the largest element or `null` if there are no elements. */ public fun > Iterable.max(): T? { val iterator = iterator() @@ -1169,7 +1169,7 @@ public fun > Iterable.max(): T? { } /** - * Returns the largest element or null if there are no elements + * Returns the largest element or `null` if there are no elements. */ public fun > Sequence.max(): T? { val iterator = iterator() @@ -1185,7 +1185,7 @@ public fun > Sequence.max(): T? { deprecated("Migrate to using Sequence and respective functions") /** - * Returns the largest element or null if there are no elements + * Returns the largest element or `null` if there are no elements. */ public fun > Stream.max(): T? { val iterator = iterator() @@ -1199,7 +1199,7 @@ public fun > Stream.max(): T? { } /** - * Returns the largest element or null if there are no elements + * Returns the largest element or `null` if there are no elements. */ public fun String.max(): Char? { val iterator = iterator() @@ -1213,7 +1213,7 @@ public fun String.max(): Char? { } /** - * Returns the first element yielding the largest value of the given function or null if there are no elements + * Returns the first element yielding the largest value of the given function or `null` if there are no elements. */ public inline fun , T : Any> Array.maxBy(f: (T) -> R): T? { if (isEmpty()) return null @@ -1231,7 +1231,7 @@ public inline fun , T : Any> Array.maxBy(f: (T) -> R): } /** - * Returns the first element yielding the largest value of the given function or null if there are no elements + * Returns the first element yielding the largest value of the given function or `null` if there are no elements. */ public inline fun > BooleanArray.maxBy(f: (Boolean) -> R): Boolean? { if (isEmpty()) return null @@ -1249,7 +1249,7 @@ public inline fun > BooleanArray.maxBy(f: (Boolean) -> R): Boo } /** - * Returns the first element yielding the largest value of the given function or null if there are no elements + * Returns the first element yielding the largest value of the given function or `null` if there are no elements. */ public inline fun > ByteArray.maxBy(f: (Byte) -> R): Byte? { if (isEmpty()) return null @@ -1267,7 +1267,7 @@ public inline fun > ByteArray.maxBy(f: (Byte) -> R): Byte? { } /** - * Returns the first element yielding the largest value of the given function or null if there are no elements + * Returns the first element yielding the largest value of the given function or `null` if there are no elements. */ public inline fun > CharArray.maxBy(f: (Char) -> R): Char? { if (isEmpty()) return null @@ -1285,7 +1285,7 @@ public inline fun > CharArray.maxBy(f: (Char) -> R): Char? { } /** - * Returns the first element yielding the largest value of the given function or null if there are no elements + * Returns the first element yielding the largest value of the given function or `null` if there are no elements. */ public inline fun > DoubleArray.maxBy(f: (Double) -> R): Double? { if (isEmpty()) return null @@ -1303,7 +1303,7 @@ public inline fun > DoubleArray.maxBy(f: (Double) -> R): Doubl } /** - * Returns the first element yielding the largest value of the given function or null if there are no elements + * Returns the first element yielding the largest value of the given function or `null` if there are no elements. */ public inline fun > FloatArray.maxBy(f: (Float) -> R): Float? { if (isEmpty()) return null @@ -1321,7 +1321,7 @@ public inline fun > FloatArray.maxBy(f: (Float) -> R): Float? } /** - * Returns the first element yielding the largest value of the given function or null if there are no elements + * Returns the first element yielding the largest value of the given function or `null` if there are no elements. */ public inline fun > IntArray.maxBy(f: (Int) -> R): Int? { if (isEmpty()) return null @@ -1339,7 +1339,7 @@ public inline fun > IntArray.maxBy(f: (Int) -> R): Int? { } /** - * Returns the first element yielding the largest value of the given function or null if there are no elements + * Returns the first element yielding the largest value of the given function or `null` if there are no elements. */ public inline fun > LongArray.maxBy(f: (Long) -> R): Long? { if (isEmpty()) return null @@ -1357,7 +1357,7 @@ public inline fun > LongArray.maxBy(f: (Long) -> R): Long? { } /** - * Returns the first element yielding the largest value of the given function or null if there are no elements + * Returns the first element yielding the largest value of the given function or `null` if there are no elements. */ public inline fun > ShortArray.maxBy(f: (Short) -> R): Short? { if (isEmpty()) return null @@ -1375,7 +1375,7 @@ public inline fun > ShortArray.maxBy(f: (Short) -> R): Short? } /** - * Returns the first element yielding the largest value of the given function or null if there are no elements + * Returns the first element yielding the largest value of the given function or `null` if there are no elements. */ public inline fun , T : Any> Iterable.maxBy(f: (T) -> R): T? { val iterator = iterator() @@ -1394,7 +1394,7 @@ public inline fun , T : Any> Iterable.maxBy(f: (T) -> R): T } /** - * Returns the first element yielding the largest value of the given function or null if there are no elements + * Returns the first element yielding the largest value of the given function or `null` if there are no elements. */ public inline fun , T : Any> Sequence.maxBy(f: (T) -> R): T? { val iterator = iterator() @@ -1415,7 +1415,7 @@ public inline fun , T : Any> Sequence.maxBy(f: (T) -> R): T deprecated("Migrate to using Sequence and respective functions") /** - * Returns the first element yielding the largest value of the given function or null if there are no elements + * Returns the first element yielding the largest value of the given function or `null` if there are no elements. */ public inline fun , T : Any> Stream.maxBy(f: (T) -> R): T? { val iterator = iterator() @@ -1434,7 +1434,7 @@ public inline fun , T : Any> Stream.maxBy(f: (T) -> R): T? } /** - * Returns the first element yielding the largest value of the given function or null if there are no elements + * Returns the first element yielding the largest value of the given function or `null` if there are no elements. */ public inline fun > String.maxBy(f: (Char) -> R): Char? { val iterator = iterator() @@ -1453,7 +1453,7 @@ public inline fun > String.maxBy(f: (Char) -> R): Char? { } /** - * Returns the first element yielding the largest value of the given function or null if there are no elements + * Returns the first element yielding the largest value of the given function or `null` if there are no elements. */ public inline fun > Map.maxBy(f: (Map.Entry) -> R): Map.Entry? { val iterator = iterator() @@ -1472,7 +1472,7 @@ public inline fun > Map.maxBy(f: (Map.Entry) } /** - * Returns the smallest element or null if there are no elements + * Returns the smallest element or `null` if there are no elements. */ public fun > Array.min(): T? { if (isEmpty()) return null @@ -1485,7 +1485,7 @@ public fun > Array.min(): T? { } /** - * Returns the smallest element or null if there are no elements + * Returns the smallest element or `null` if there are no elements. */ public fun ByteArray.min(): Byte? { if (isEmpty()) return null @@ -1498,7 +1498,7 @@ public fun ByteArray.min(): Byte? { } /** - * Returns the smallest element or null if there are no elements + * Returns the smallest element or `null` if there are no elements. */ public fun CharArray.min(): Char? { if (isEmpty()) return null @@ -1511,7 +1511,7 @@ public fun CharArray.min(): Char? { } /** - * Returns the smallest element or null if there are no elements + * Returns the smallest element or `null` if there are no elements. */ public fun DoubleArray.min(): Double? { if (isEmpty()) return null @@ -1524,7 +1524,7 @@ public fun DoubleArray.min(): Double? { } /** - * Returns the smallest element or null if there are no elements + * Returns the smallest element or `null` if there are no elements. */ public fun FloatArray.min(): Float? { if (isEmpty()) return null @@ -1537,7 +1537,7 @@ public fun FloatArray.min(): Float? { } /** - * Returns the smallest element or null if there are no elements + * Returns the smallest element or `null` if there are no elements. */ public fun IntArray.min(): Int? { if (isEmpty()) return null @@ -1550,7 +1550,7 @@ public fun IntArray.min(): Int? { } /** - * Returns the smallest element or null if there are no elements + * Returns the smallest element or `null` if there are no elements. */ public fun LongArray.min(): Long? { if (isEmpty()) return null @@ -1563,7 +1563,7 @@ public fun LongArray.min(): Long? { } /** - * Returns the smallest element or null if there are no elements + * Returns the smallest element or `null` if there are no elements. */ public fun ShortArray.min(): Short? { if (isEmpty()) return null @@ -1576,7 +1576,7 @@ public fun ShortArray.min(): Short? { } /** - * Returns the smallest element or null if there are no elements + * Returns the smallest element or `null` if there are no elements. */ public fun > Iterable.min(): T? { val iterator = iterator() @@ -1590,7 +1590,7 @@ public fun > Iterable.min(): T? { } /** - * Returns the smallest element or null if there are no elements + * Returns the smallest element or `null` if there are no elements. */ public fun > Sequence.min(): T? { val iterator = iterator() @@ -1606,7 +1606,7 @@ public fun > Sequence.min(): T? { deprecated("Migrate to using Sequence and respective functions") /** - * Returns the smallest element or null if there are no elements + * Returns the smallest element or `null` if there are no elements. */ public fun > Stream.min(): T? { val iterator = iterator() @@ -1620,7 +1620,7 @@ public fun > Stream.min(): T? { } /** - * Returns the smallest element or null if there are no elements + * Returns the smallest element or `null` if there are no elements. */ public fun String.min(): Char? { val iterator = iterator() @@ -1634,7 +1634,7 @@ public fun String.min(): Char? { } /** - * Returns the first element yielding the smallest value of the given function or null if there are no elements + * Returns the first element yielding the smallest value of the given function or `null` if there are no elements. */ public inline fun , T : Any> Array.minBy(f: (T) -> R): T? { if (size() == 0) return null @@ -1652,7 +1652,7 @@ public inline fun , T : Any> Array.minBy(f: (T) -> R): } /** - * Returns the first element yielding the smallest value of the given function or null if there are no elements + * Returns the first element yielding the smallest value of the given function or `null` if there are no elements. */ public inline fun > BooleanArray.minBy(f: (Boolean) -> R): Boolean? { if (size() == 0) return null @@ -1670,7 +1670,7 @@ public inline fun > BooleanArray.minBy(f: (Boolean) -> R): Boo } /** - * Returns the first element yielding the smallest value of the given function or null if there are no elements + * Returns the first element yielding the smallest value of the given function or `null` if there are no elements. */ public inline fun > ByteArray.minBy(f: (Byte) -> R): Byte? { if (size() == 0) return null @@ -1688,7 +1688,7 @@ public inline fun > ByteArray.minBy(f: (Byte) -> R): Byte? { } /** - * Returns the first element yielding the smallest value of the given function or null if there are no elements + * Returns the first element yielding the smallest value of the given function or `null` if there are no elements. */ public inline fun > CharArray.minBy(f: (Char) -> R): Char? { if (size() == 0) return null @@ -1706,7 +1706,7 @@ public inline fun > CharArray.minBy(f: (Char) -> R): Char? { } /** - * Returns the first element yielding the smallest value of the given function or null if there are no elements + * Returns the first element yielding the smallest value of the given function or `null` if there are no elements. */ public inline fun > DoubleArray.minBy(f: (Double) -> R): Double? { if (size() == 0) return null @@ -1724,7 +1724,7 @@ public inline fun > DoubleArray.minBy(f: (Double) -> R): Doubl } /** - * Returns the first element yielding the smallest value of the given function or null if there are no elements + * Returns the first element yielding the smallest value of the given function or `null` if there are no elements. */ public inline fun > FloatArray.minBy(f: (Float) -> R): Float? { if (size() == 0) return null @@ -1742,7 +1742,7 @@ public inline fun > FloatArray.minBy(f: (Float) -> R): Float? } /** - * Returns the first element yielding the smallest value of the given function or null if there are no elements + * Returns the first element yielding the smallest value of the given function or `null` if there are no elements. */ public inline fun > IntArray.minBy(f: (Int) -> R): Int? { if (size() == 0) return null @@ -1760,7 +1760,7 @@ public inline fun > IntArray.minBy(f: (Int) -> R): Int? { } /** - * Returns the first element yielding the smallest value of the given function or null if there are no elements + * Returns the first element yielding the smallest value of the given function or `null` if there are no elements. */ public inline fun > LongArray.minBy(f: (Long) -> R): Long? { if (size() == 0) return null @@ -1778,7 +1778,7 @@ public inline fun > LongArray.minBy(f: (Long) -> R): Long? { } /** - * Returns the first element yielding the smallest value of the given function or null if there are no elements + * Returns the first element yielding the smallest value of the given function or `null` if there are no elements. */ public inline fun > ShortArray.minBy(f: (Short) -> R): Short? { if (size() == 0) return null @@ -1796,7 +1796,7 @@ public inline fun > ShortArray.minBy(f: (Short) -> R): Short? } /** - * Returns the first element yielding the smallest value of the given function or null if there are no elements + * Returns the first element yielding the smallest value of the given function or `null` if there are no elements. */ public inline fun , T : Any> Iterable.minBy(f: (T) -> R): T? { val iterator = iterator() @@ -1815,7 +1815,7 @@ public inline fun , T : Any> Iterable.minBy(f: (T) -> R): T } /** - * Returns the first element yielding the smallest value of the given function or null if there are no elements + * Returns the first element yielding the smallest value of the given function or `null` if there are no elements. */ public inline fun , T : Any> Sequence.minBy(f: (T) -> R): T? { val iterator = iterator() @@ -1836,7 +1836,7 @@ public inline fun , T : Any> Sequence.minBy(f: (T) -> R): T deprecated("Migrate to using Sequence and respective functions") /** - * Returns the first element yielding the smallest value of the given function or null if there are no elements + * Returns the first element yielding the smallest value of the given function or `null` if there are no elements. */ public inline fun , T : Any> Stream.minBy(f: (T) -> R): T? { val iterator = iterator() @@ -1855,7 +1855,7 @@ public inline fun , T : Any> Stream.minBy(f: (T) -> R): T? } /** - * Returns the first element yielding the smallest value of the given function or null if there are no elements + * Returns the first element yielding the smallest value of the given function or `null` if there are no elements. */ public inline fun > String.minBy(f: (Char) -> R): Char? { val iterator = iterator() @@ -1874,7 +1874,7 @@ public inline fun > String.minBy(f: (Char) -> R): Char? { } /** - * Returns the first element yielding the smallest value of the given function or null if there are no elements + * Returns the first element yielding the smallest value of the given function or `null` if there are no elements. */ public inline fun > Map.minBy(f: (Map.Entry) -> R): Map.Entry? { val iterator = iterator() @@ -1893,7 +1893,7 @@ public inline fun > Map.minBy(f: (Map.Entry) } /** - * Returns *true* if collection has no elements + * Returns `true` if collection has no elements. */ public fun Array.none(): Boolean { for (element in this) return false @@ -1901,7 +1901,7 @@ public fun Array.none(): Boolean { } /** - * Returns *true* if collection has no elements + * Returns `true` if collection has no elements. */ public fun BooleanArray.none(): Boolean { for (element in this) return false @@ -1909,7 +1909,7 @@ public fun BooleanArray.none(): Boolean { } /** - * Returns *true* if collection has no elements + * Returns `true` if collection has no elements. */ public fun ByteArray.none(): Boolean { for (element in this) return false @@ -1917,7 +1917,7 @@ public fun ByteArray.none(): Boolean { } /** - * Returns *true* if collection has no elements + * Returns `true` if collection has no elements. */ public fun CharArray.none(): Boolean { for (element in this) return false @@ -1925,7 +1925,7 @@ public fun CharArray.none(): Boolean { } /** - * Returns *true* if collection has no elements + * Returns `true` if collection has no elements. */ public fun DoubleArray.none(): Boolean { for (element in this) return false @@ -1933,7 +1933,7 @@ public fun DoubleArray.none(): Boolean { } /** - * Returns *true* if collection has no elements + * Returns `true` if collection has no elements. */ public fun FloatArray.none(): Boolean { for (element in this) return false @@ -1941,7 +1941,7 @@ public fun FloatArray.none(): Boolean { } /** - * Returns *true* if collection has no elements + * Returns `true` if collection has no elements. */ public fun IntArray.none(): Boolean { for (element in this) return false @@ -1949,7 +1949,7 @@ public fun IntArray.none(): Boolean { } /** - * Returns *true* if collection has no elements + * Returns `true` if collection has no elements. */ public fun LongArray.none(): Boolean { for (element in this) return false @@ -1957,7 +1957,7 @@ public fun LongArray.none(): Boolean { } /** - * Returns *true* if collection has no elements + * Returns `true` if collection has no elements. */ public fun ShortArray.none(): Boolean { for (element in this) return false @@ -1965,7 +1965,7 @@ public fun ShortArray.none(): Boolean { } /** - * Returns *true* if collection has no elements + * Returns `true` if collection has no elements. */ public fun Iterable.none(): Boolean { for (element in this) return false @@ -1973,7 +1973,7 @@ public fun Iterable.none(): Boolean { } /** - * Returns *true* if collection has no elements + * Returns `true` if collection has no elements. */ public fun Map.none(): Boolean { for (element in this) return false @@ -1981,7 +1981,7 @@ public fun Map.none(): Boolean { } /** - * Returns *true* if collection has no elements + * Returns `true` if collection has no elements. */ public fun Sequence.none(): Boolean { for (element in this) return false @@ -1991,7 +1991,7 @@ public fun Sequence.none(): Boolean { deprecated("Migrate to using Sequence and respective functions") /** - * Returns *true* if collection has no elements + * Returns `true` if collection has no elements. */ public fun Stream.none(): Boolean { for (element in this) return false @@ -1999,7 +1999,7 @@ public fun Stream.none(): Boolean { } /** - * Returns *true* if collection has no elements + * Returns `true` if collection has no elements. */ public fun String.none(): Boolean { for (element in this) return false @@ -2007,7 +2007,7 @@ public fun String.none(): Boolean { } /** - * Returns *true* if no elements match the given *predicate* + * Returns `true` if no elements match the given [predicate]. */ public inline fun Array.none(predicate: (T) -> Boolean): Boolean { for (element in this) if (predicate(element)) return false @@ -2015,7 +2015,7 @@ public inline fun Array.none(predicate: (T) -> Boolean): Boolean { } /** - * Returns *true* if no elements match the given *predicate* + * Returns `true` if no elements match the given [predicate]. */ public inline fun BooleanArray.none(predicate: (Boolean) -> Boolean): Boolean { for (element in this) if (predicate(element)) return false @@ -2023,7 +2023,7 @@ public inline fun BooleanArray.none(predicate: (Boolean) -> Boolean): Boolean { } /** - * Returns *true* if no elements match the given *predicate* + * Returns `true` if no elements match the given [predicate]. */ public inline fun ByteArray.none(predicate: (Byte) -> Boolean): Boolean { for (element in this) if (predicate(element)) return false @@ -2031,7 +2031,7 @@ public inline fun ByteArray.none(predicate: (Byte) -> Boolean): Boolean { } /** - * Returns *true* if no elements match the given *predicate* + * Returns `true` if no elements match the given [predicate]. */ public inline fun CharArray.none(predicate: (Char) -> Boolean): Boolean { for (element in this) if (predicate(element)) return false @@ -2039,7 +2039,7 @@ public inline fun CharArray.none(predicate: (Char) -> Boolean): Boolean { } /** - * Returns *true* if no elements match the given *predicate* + * Returns `true` if no elements match the given [predicate]. */ public inline fun DoubleArray.none(predicate: (Double) -> Boolean): Boolean { for (element in this) if (predicate(element)) return false @@ -2047,7 +2047,7 @@ public inline fun DoubleArray.none(predicate: (Double) -> Boolean): Boolean { } /** - * Returns *true* if no elements match the given *predicate* + * Returns `true` if no elements match the given [predicate]. */ public inline fun FloatArray.none(predicate: (Float) -> Boolean): Boolean { for (element in this) if (predicate(element)) return false @@ -2055,7 +2055,7 @@ public inline fun FloatArray.none(predicate: (Float) -> Boolean): Boolean { } /** - * Returns *true* if no elements match the given *predicate* + * Returns `true` if no elements match the given [predicate]. */ public inline fun IntArray.none(predicate: (Int) -> Boolean): Boolean { for (element in this) if (predicate(element)) return false @@ -2063,7 +2063,7 @@ public inline fun IntArray.none(predicate: (Int) -> Boolean): Boolean { } /** - * Returns *true* if no elements match the given *predicate* + * Returns `true` if no elements match the given [predicate]. */ public inline fun LongArray.none(predicate: (Long) -> Boolean): Boolean { for (element in this) if (predicate(element)) return false @@ -2071,7 +2071,7 @@ public inline fun LongArray.none(predicate: (Long) -> Boolean): Boolean { } /** - * Returns *true* if no elements match the given *predicate* + * Returns `true` if no elements match the given [predicate]. */ public inline fun ShortArray.none(predicate: (Short) -> Boolean): Boolean { for (element in this) if (predicate(element)) return false @@ -2079,7 +2079,7 @@ public inline fun ShortArray.none(predicate: (Short) -> Boolean): Boolean { } /** - * Returns *true* if no elements match the given *predicate* + * Returns `true` if no elements match the given [predicate]. */ public inline fun Iterable.none(predicate: (T) -> Boolean): Boolean { for (element in this) if (predicate(element)) return false @@ -2087,7 +2087,7 @@ public inline fun Iterable.none(predicate: (T) -> Boolean): Boolean { } /** - * Returns *true* if no elements match the given *predicate* + * Returns `true` if no elements match the given [predicate]. */ public inline fun Map.none(predicate: (Map.Entry) -> Boolean): Boolean { for (element in this) if (predicate(element)) return false @@ -2095,7 +2095,7 @@ public inline fun Map.none(predicate: (Map.Entry) -> Boolean) } /** - * Returns *true* if no elements match the given *predicate* + * Returns `true` if no elements match the given [predicate]. */ public inline fun Sequence.none(predicate: (T) -> Boolean): Boolean { for (element in this) if (predicate(element)) return false @@ -2105,7 +2105,7 @@ public inline fun Sequence.none(predicate: (T) -> Boolean): Boolean { deprecated("Migrate to using Sequence and respective functions") /** - * Returns *true* if no elements match the given *predicate* + * Returns `true` if no elements match the given [predicate]. */ public inline fun Stream.none(predicate: (T) -> Boolean): Boolean { for (element in this) if (predicate(element)) return false @@ -2113,7 +2113,7 @@ public inline fun Stream.none(predicate: (T) -> Boolean): Boolean { } /** - * Returns *true* if no elements match the given *predicate* + * Returns `true` if no elements match the given [predicate]. */ public inline fun String.none(predicate: (Char) -> Boolean): Boolean { for (element in this) if (predicate(element)) return false @@ -2121,11 +2121,11 @@ public inline fun String.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 + * Accumulates value starting with the first element and applying [operation] from left to right to current accumulator value and each element. */ public inline fun Array.reduce(operation: (S, T) -> S): S { val iterator = this.iterator() - if (!iterator.hasNext()) throw UnsupportedOperationException("Empty iterable can't be reduced") + if (!iterator.hasNext()) throw UnsupportedOperationException("Empty iterable can't be reduced.") var accumulator: S = iterator.next() while (iterator.hasNext()) { accumulator = operation(accumulator, iterator.next()) @@ -2134,11 +2134,11 @@ public 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 + * Accumulates value starting with the first element and applying [operation] from left to right to current accumulator value and each element. */ public inline fun Iterable.reduce(operation: (S, T) -> S): S { val iterator = this.iterator() - if (!iterator.hasNext()) throw UnsupportedOperationException("Empty iterable can't be reduced") + if (!iterator.hasNext()) throw UnsupportedOperationException("Empty iterable can't be reduced.") var accumulator: S = iterator.next() while (iterator.hasNext()) { accumulator = operation(accumulator, iterator.next()) @@ -2147,11 +2147,11 @@ public 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 + * Accumulates value starting with the first element and applying [operation] from left to right to current accumulator value and each element. */ public inline fun Sequence.reduce(operation: (S, T) -> S): S { val iterator = this.iterator() - if (!iterator.hasNext()) throw UnsupportedOperationException("Empty iterable can't be reduced") + if (!iterator.hasNext()) throw UnsupportedOperationException("Empty iterable can't be reduced.") var accumulator: S = iterator.next() while (iterator.hasNext()) { accumulator = operation(accumulator, iterator.next()) @@ -2162,11 +2162,11 @@ public inline fun Sequence.reduce(operation: (S, T) -> S): S { deprecated("Migrate to using Sequence and respective functions") /** - * Accumulates value starting with the first element and applying *operation* from left to right to current accumulator value and each element + * Accumulates value starting with the first element and applying [operation] from left to right to current accumulator value and each element. */ public inline fun Stream.reduce(operation: (S, T) -> S): S { val iterator = this.iterator() - if (!iterator.hasNext()) throw UnsupportedOperationException("Empty iterable can't be reduced") + if (!iterator.hasNext()) throw UnsupportedOperationException("Empty iterable can't be reduced.") var accumulator: S = iterator.next() while (iterator.hasNext()) { accumulator = operation(accumulator, iterator.next()) @@ -2175,11 +2175,11 @@ public inline fun Stream.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 + * Accumulates value starting with the first element and applying [operation] from left to right to current accumulator value and each element. */ public inline fun BooleanArray.reduce(operation: (Boolean, Boolean) -> Boolean): Boolean { val iterator = this.iterator() - if (!iterator.hasNext()) throw UnsupportedOperationException("Empty iterable can't be reduced") + if (!iterator.hasNext()) throw UnsupportedOperationException("Empty iterable can't be reduced.") var accumulator = iterator.next() while (iterator.hasNext()) { accumulator = operation(accumulator, iterator.next()) @@ -2188,11 +2188,11 @@ public inline fun BooleanArray.reduce(operation: (Boolean, Boolean) -> Boolean): } /** - * Accumulates value starting with the first element and applying *operation* from left to right to current accumulator value and each element + * Accumulates value starting with the first element and applying [operation] from left to right to current accumulator value and each element. */ public inline fun ByteArray.reduce(operation: (Byte, Byte) -> Byte): Byte { val iterator = this.iterator() - if (!iterator.hasNext()) throw UnsupportedOperationException("Empty iterable can't be reduced") + if (!iterator.hasNext()) throw UnsupportedOperationException("Empty iterable can't be reduced.") var accumulator = iterator.next() while (iterator.hasNext()) { accumulator = operation(accumulator, iterator.next()) @@ -2201,11 +2201,11 @@ public 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 + * Accumulates value starting with the first element and applying [operation] from left to right to current accumulator value and each element. */ public inline fun CharArray.reduce(operation: (Char, Char) -> Char): Char { val iterator = this.iterator() - if (!iterator.hasNext()) throw UnsupportedOperationException("Empty iterable can't be reduced") + if (!iterator.hasNext()) throw UnsupportedOperationException("Empty iterable can't be reduced.") var accumulator = iterator.next() while (iterator.hasNext()) { accumulator = operation(accumulator, iterator.next()) @@ -2214,11 +2214,11 @@ public 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 + * Accumulates value starting with the first element and applying [operation] from left to right to current accumulator value and each element. */ public inline fun DoubleArray.reduce(operation: (Double, Double) -> Double): Double { val iterator = this.iterator() - if (!iterator.hasNext()) throw UnsupportedOperationException("Empty iterable can't be reduced") + if (!iterator.hasNext()) throw UnsupportedOperationException("Empty iterable can't be reduced.") var accumulator = iterator.next() while (iterator.hasNext()) { accumulator = operation(accumulator, iterator.next()) @@ -2227,11 +2227,11 @@ public inline fun DoubleArray.reduce(operation: (Double, Double) -> Double): Dou } /** - * Accumulates value starting with the first element and applying *operation* from left to right to current accumulator value and each element + * Accumulates value starting with the first element and applying [operation] from left to right to current accumulator value and each element. */ public inline fun FloatArray.reduce(operation: (Float, Float) -> Float): Float { val iterator = this.iterator() - if (!iterator.hasNext()) throw UnsupportedOperationException("Empty iterable can't be reduced") + if (!iterator.hasNext()) throw UnsupportedOperationException("Empty iterable can't be reduced.") var accumulator = iterator.next() while (iterator.hasNext()) { accumulator = operation(accumulator, iterator.next()) @@ -2240,11 +2240,11 @@ public 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 + * Accumulates value starting with the first element and applying [operation] from left to right to current accumulator value and each element. */ public inline fun IntArray.reduce(operation: (Int, Int) -> Int): Int { val iterator = this.iterator() - if (!iterator.hasNext()) throw UnsupportedOperationException("Empty iterable can't be reduced") + if (!iterator.hasNext()) throw UnsupportedOperationException("Empty iterable can't be reduced.") var accumulator = iterator.next() while (iterator.hasNext()) { accumulator = operation(accumulator, iterator.next()) @@ -2253,11 +2253,11 @@ public 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 + * Accumulates value starting with the first element and applying [operation] from left to right to current accumulator value and each element. */ public inline fun LongArray.reduce(operation: (Long, Long) -> Long): Long { val iterator = this.iterator() - if (!iterator.hasNext()) throw UnsupportedOperationException("Empty iterable can't be reduced") + if (!iterator.hasNext()) throw UnsupportedOperationException("Empty iterable can't be reduced.") var accumulator = iterator.next() while (iterator.hasNext()) { accumulator = operation(accumulator, iterator.next()) @@ -2266,11 +2266,11 @@ public 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 + * Accumulates value starting with the first element and applying [operation] from left to right to current accumulator value and each element. */ public inline fun ShortArray.reduce(operation: (Short, Short) -> Short): Short { val iterator = this.iterator() - if (!iterator.hasNext()) throw UnsupportedOperationException("Empty iterable can't be reduced") + if (!iterator.hasNext()) throw UnsupportedOperationException("Empty iterable can't be reduced.") var accumulator = iterator.next() while (iterator.hasNext()) { accumulator = operation(accumulator, iterator.next()) @@ -2279,11 +2279,11 @@ public 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 + * Accumulates value starting with the first element and applying [operation] from left to right to current accumulator value and each element. */ public inline fun String.reduce(operation: (Char, Char) -> Char): Char { val iterator = this.iterator() - if (!iterator.hasNext()) throw UnsupportedOperationException("Empty iterable can't be reduced") + if (!iterator.hasNext()) throw UnsupportedOperationException("Empty iterable can't be reduced.") var accumulator = iterator.next() while (iterator.hasNext()) { accumulator = operation(accumulator, iterator.next()) @@ -2292,11 +2292,11 @@ public inline fun String.reduce(operation: (Char, Char) -> Char): Char { } /** - * Accumulates value starting with last element and applying *operation* from right to left to each element and current accumulator value + * Accumulates value starting with last element and applying [operation] from right to left to each element and current accumulator value. */ public inline fun Array.reduceRight(operation: (T, S) -> S): S { var index = lastIndex - if (index < 0) throw UnsupportedOperationException("Empty iterable can't be reduced") + if (index < 0) throw UnsupportedOperationException("Empty iterable can't be reduced.") var accumulator: S = get(index--) while (index >= 0) { accumulator = operation(get(index--), accumulator) @@ -2305,11 +2305,11 @@ public 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 + * Accumulates value starting with last element and applying [operation] from right to left to each element and current accumulator value. */ public inline fun List.reduceRight(operation: (T, S) -> S): S { var index = lastIndex - if (index < 0) throw UnsupportedOperationException("Empty iterable can't be reduced") + if (index < 0) throw UnsupportedOperationException("Empty iterable can't be reduced.") var accumulator: S = get(index--) while (index >= 0) { accumulator = operation(get(index--), accumulator) @@ -2318,11 +2318,11 @@ public 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 and current accumulator value + * Accumulates value starting with last element and applying [operation] from right to left to each element and current accumulator value. */ public inline fun BooleanArray.reduceRight(operation: (Boolean, Boolean) -> Boolean): Boolean { var index = lastIndex - if (index < 0) throw UnsupportedOperationException("Empty iterable can't be reduced") + if (index < 0) throw UnsupportedOperationException("Empty iterable can't be reduced.") var accumulator = get(index--) while (index >= 0) { accumulator = operation(get(index--), accumulator) @@ -2331,11 +2331,11 @@ public inline fun BooleanArray.reduceRight(operation: (Boolean, Boolean) -> Bool } /** - * Accumulates value starting with last element and applying *operation* from right to left to each element and current accumulator value + * Accumulates value starting with last element and applying [operation] from right to left to each element and current accumulator value. */ public inline fun ByteArray.reduceRight(operation: (Byte, Byte) -> Byte): Byte { var index = lastIndex - if (index < 0) throw UnsupportedOperationException("Empty iterable can't be reduced") + if (index < 0) throw UnsupportedOperationException("Empty iterable can't be reduced.") var accumulator = get(index--) while (index >= 0) { accumulator = operation(get(index--), accumulator) @@ -2344,11 +2344,11 @@ public 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 + * Accumulates value starting with last element and applying [operation] from right to left to each element and current accumulator value. */ public inline fun CharArray.reduceRight(operation: (Char, Char) -> Char): Char { var index = lastIndex - if (index < 0) throw UnsupportedOperationException("Empty iterable can't be reduced") + if (index < 0) throw UnsupportedOperationException("Empty iterable can't be reduced.") var accumulator = get(index--) while (index >= 0) { accumulator = operation(get(index--), accumulator) @@ -2357,11 +2357,11 @@ public 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 and current accumulator value + * Accumulates value starting with last element and applying [operation] from right to left to each element and current accumulator value. */ public inline fun DoubleArray.reduceRight(operation: (Double, Double) -> Double): Double { var index = lastIndex - if (index < 0) throw UnsupportedOperationException("Empty iterable can't be reduced") + if (index < 0) throw UnsupportedOperationException("Empty iterable can't be reduced.") var accumulator = get(index--) while (index >= 0) { accumulator = operation(get(index--), accumulator) @@ -2370,11 +2370,11 @@ public inline fun DoubleArray.reduceRight(operation: (Double, Double) -> Double) } /** - * Accumulates value starting with last element and applying *operation* from right to left to each element and current accumulator value + * Accumulates value starting with last element and applying [operation] from right to left to each element and current accumulator value. */ public inline fun FloatArray.reduceRight(operation: (Float, Float) -> Float): Float { var index = lastIndex - if (index < 0) throw UnsupportedOperationException("Empty iterable can't be reduced") + if (index < 0) throw UnsupportedOperationException("Empty iterable can't be reduced.") var accumulator = get(index--) while (index >= 0) { accumulator = operation(get(index--), accumulator) @@ -2383,11 +2383,11 @@ public inline fun FloatArray.reduceRight(operation: (Float, Float) -> Float): Fl } /** - * Accumulates value starting with last element and applying *operation* from right to left to each element and current accumulator value + * Accumulates value starting with last element and applying [operation] from right to left to each element and current accumulator value. */ public inline fun IntArray.reduceRight(operation: (Int, Int) -> Int): Int { var index = lastIndex - if (index < 0) throw UnsupportedOperationException("Empty iterable can't be reduced") + if (index < 0) throw UnsupportedOperationException("Empty iterable can't be reduced.") var accumulator = get(index--) while (index >= 0) { accumulator = operation(get(index--), accumulator) @@ -2396,11 +2396,11 @@ public 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 + * Accumulates value starting with last element and applying [operation] from right to left to each element and current accumulator value. */ public inline fun LongArray.reduceRight(operation: (Long, Long) -> Long): Long { var index = lastIndex - if (index < 0) throw UnsupportedOperationException("Empty iterable can't be reduced") + if (index < 0) throw UnsupportedOperationException("Empty iterable can't be reduced.") var accumulator = get(index--) while (index >= 0) { accumulator = operation(get(index--), accumulator) @@ -2409,11 +2409,11 @@ public 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 + * Accumulates value starting with last element and applying [operation] from right to left to each element and current accumulator value. */ public inline fun ShortArray.reduceRight(operation: (Short, Short) -> Short): Short { var index = lastIndex - if (index < 0) throw UnsupportedOperationException("Empty iterable can't be reduced") + if (index < 0) throw UnsupportedOperationException("Empty iterable can't be reduced.") var accumulator = get(index--) while (index >= 0) { accumulator = operation(get(index--), accumulator) @@ -2422,11 +2422,11 @@ public inline fun ShortArray.reduceRight(operation: (Short, Short) -> Short): Sh } /** - * Accumulates value starting with last element and applying *operation* from right to left to each element and current accumulator value + * Accumulates value starting with last element and applying [operation] from right to left to each element and current accumulator value. */ public inline fun String.reduceRight(operation: (Char, Char) -> Char): Char { var index = lastIndex - if (index < 0) throw UnsupportedOperationException("Empty iterable can't be reduced") + if (index < 0) throw UnsupportedOperationException("Empty iterable can't be reduced.") var accumulator = get(index--) while (index >= 0) { accumulator = operation(get(index--), accumulator) @@ -2435,7 +2435,7 @@ public inline fun String.reduceRight(operation: (Char, Char) -> Char): Char { } /** - * Returns the sum of all values produced by [transform] function from elements in the collection + * Returns the sum of all values produced by [transform] function from elements in the collection. */ public inline fun Array.sumBy(transform: (T) -> Int): Int { var sum: Int = 0 @@ -2446,7 +2446,7 @@ public inline fun Array.sumBy(transform: (T) -> Int): Int { } /** - * Returns the sum of all values produced by [transform] function from elements in the collection + * Returns the sum of all values produced by [transform] function from elements in the collection. */ public inline fun BooleanArray.sumBy(transform: (Boolean) -> Int): Int { var sum: Int = 0 @@ -2457,7 +2457,7 @@ public inline fun BooleanArray.sumBy(transform: (Boolean) -> Int): Int { } /** - * Returns the sum of all values produced by [transform] function from elements in the collection + * Returns the sum of all values produced by [transform] function from elements in the collection. */ public inline fun ByteArray.sumBy(transform: (Byte) -> Int): Int { var sum: Int = 0 @@ -2468,7 +2468,7 @@ public inline fun ByteArray.sumBy(transform: (Byte) -> Int): Int { } /** - * Returns the sum of all values produced by [transform] function from elements in the collection + * Returns the sum of all values produced by [transform] function from elements in the collection. */ public inline fun CharArray.sumBy(transform: (Char) -> Int): Int { var sum: Int = 0 @@ -2479,7 +2479,7 @@ public inline fun CharArray.sumBy(transform: (Char) -> Int): Int { } /** - * Returns the sum of all values produced by [transform] function from elements in the collection + * Returns the sum of all values produced by [transform] function from elements in the collection. */ public inline fun DoubleArray.sumBy(transform: (Double) -> Int): Int { var sum: Int = 0 @@ -2490,7 +2490,7 @@ public inline fun DoubleArray.sumBy(transform: (Double) -> Int): Int { } /** - * Returns the sum of all values produced by [transform] function from elements in the collection + * Returns the sum of all values produced by [transform] function from elements in the collection. */ public inline fun FloatArray.sumBy(transform: (Float) -> Int): Int { var sum: Int = 0 @@ -2501,7 +2501,7 @@ public inline fun FloatArray.sumBy(transform: (Float) -> Int): Int { } /** - * Returns the sum of all values produced by [transform] function from elements in the collection + * Returns the sum of all values produced by [transform] function from elements in the collection. */ public inline fun IntArray.sumBy(transform: (Int) -> Int): Int { var sum: Int = 0 @@ -2512,7 +2512,7 @@ public inline fun IntArray.sumBy(transform: (Int) -> Int): Int { } /** - * Returns the sum of all values produced by [transform] function from elements in the collection + * Returns the sum of all values produced by [transform] function from elements in the collection. */ public inline fun LongArray.sumBy(transform: (Long) -> Int): Int { var sum: Int = 0 @@ -2523,7 +2523,7 @@ public inline fun LongArray.sumBy(transform: (Long) -> Int): Int { } /** - * Returns the sum of all values produced by [transform] function from elements in the collection + * Returns the sum of all values produced by [transform] function from elements in the collection. */ public inline fun ShortArray.sumBy(transform: (Short) -> Int): Int { var sum: Int = 0 @@ -2534,7 +2534,7 @@ public inline fun ShortArray.sumBy(transform: (Short) -> Int): Int { } /** - * Returns the sum of all values produced by [transform] function from elements in the collection + * Returns the sum of all values produced by [transform] function from elements in the collection. */ public inline fun Iterable.sumBy(transform: (T) -> Int): Int { var sum: Int = 0 @@ -2545,7 +2545,7 @@ public inline fun Iterable.sumBy(transform: (T) -> Int): Int { } /** - * Returns the sum of all values produced by [transform] function from elements in the collection + * Returns the sum of all values produced by [transform] function from elements in the collection. */ public inline fun Sequence.sumBy(transform: (T) -> Int): Int { var sum: Int = 0 @@ -2558,7 +2558,7 @@ public inline fun Sequence.sumBy(transform: (T) -> Int): Int { deprecated("Migrate to using Sequence and respective functions") /** - * Returns the sum of all values produced by [transform] function from elements in the collection + * Returns the sum of all values produced by [transform] function from elements in the collection. */ public inline fun Stream.sumBy(transform: (T) -> Int): Int { var sum: Int = 0 @@ -2569,7 +2569,7 @@ public inline fun Stream.sumBy(transform: (T) -> Int): Int { } /** - * Returns the sum of all values produced by [transform] function from characters in the string + * Returns the sum of all values produced by [transform] function from characters in the string. */ public inline fun String.sumBy(transform: (Char) -> Int): Int { var sum: Int = 0 @@ -2580,7 +2580,7 @@ public inline fun String.sumBy(transform: (Char) -> Int): Int { } /** - * Returns the sum of all values produced by [transform] function from elements in the collection + * Returns the sum of all values produced by [transform] function from elements in the collection. */ public inline fun Array.sumByDouble(transform: (T) -> Double): Double { var sum: Double = 0.0 @@ -2591,7 +2591,7 @@ public inline fun Array.sumByDouble(transform: (T) -> Double): Double } /** - * Returns the sum of all values produced by [transform] function from elements in the collection + * Returns the sum of all values produced by [transform] function from elements in the collection. */ public inline fun BooleanArray.sumByDouble(transform: (Boolean) -> Double): Double { var sum: Double = 0.0 @@ -2602,7 +2602,7 @@ public inline fun BooleanArray.sumByDouble(transform: (Boolean) -> Double): Doub } /** - * Returns the sum of all values produced by [transform] function from elements in the collection + * Returns the sum of all values produced by [transform] function from elements in the collection. */ public inline fun ByteArray.sumByDouble(transform: (Byte) -> Double): Double { var sum: Double = 0.0 @@ -2613,7 +2613,7 @@ public inline fun ByteArray.sumByDouble(transform: (Byte) -> Double): Double { } /** - * Returns the sum of all values produced by [transform] function from elements in the collection + * Returns the sum of all values produced by [transform] function from elements in the collection. */ public inline fun CharArray.sumByDouble(transform: (Char) -> Double): Double { var sum: Double = 0.0 @@ -2624,7 +2624,7 @@ public inline fun CharArray.sumByDouble(transform: (Char) -> Double): Double { } /** - * Returns the sum of all values produced by [transform] function from elements in the collection + * Returns the sum of all values produced by [transform] function from elements in the collection. */ public inline fun DoubleArray.sumByDouble(transform: (Double) -> Double): Double { var sum: Double = 0.0 @@ -2635,7 +2635,7 @@ public inline fun DoubleArray.sumByDouble(transform: (Double) -> Double): Double } /** - * Returns the sum of all values produced by [transform] function from elements in the collection + * Returns the sum of all values produced by [transform] function from elements in the collection. */ public inline fun FloatArray.sumByDouble(transform: (Float) -> Double): Double { var sum: Double = 0.0 @@ -2646,7 +2646,7 @@ public inline fun FloatArray.sumByDouble(transform: (Float) -> Double): Double { } /** - * Returns the sum of all values produced by [transform] function from elements in the collection + * Returns the sum of all values produced by [transform] function from elements in the collection. */ public inline fun IntArray.sumByDouble(transform: (Int) -> Double): Double { var sum: Double = 0.0 @@ -2657,7 +2657,7 @@ public inline fun IntArray.sumByDouble(transform: (Int) -> Double): Double { } /** - * Returns the sum of all values produced by [transform] function from elements in the collection + * Returns the sum of all values produced by [transform] function from elements in the collection. */ public inline fun LongArray.sumByDouble(transform: (Long) -> Double): Double { var sum: Double = 0.0 @@ -2668,7 +2668,7 @@ public inline fun LongArray.sumByDouble(transform: (Long) -> Double): Double { } /** - * Returns the sum of all values produced by [transform] function from elements in the collection + * Returns the sum of all values produced by [transform] function from elements in the collection. */ public inline fun ShortArray.sumByDouble(transform: (Short) -> Double): Double { var sum: Double = 0.0 @@ -2679,7 +2679,7 @@ public inline fun ShortArray.sumByDouble(transform: (Short) -> Double): Double { } /** - * Returns the sum of all values produced by [transform] function from elements in the collection + * Returns the sum of all values produced by [transform] function from elements in the collection. */ public inline fun Iterable.sumByDouble(transform: (T) -> Double): Double { var sum: Double = 0.0 @@ -2690,7 +2690,7 @@ public inline fun Iterable.sumByDouble(transform: (T) -> Double): Double } /** - * Returns the sum of all values produced by [transform] function from elements in the collection + * Returns the sum of all values produced by [transform] function from elements in the collection. */ public inline fun Sequence.sumByDouble(transform: (T) -> Double): Double { var sum: Double = 0.0 @@ -2703,7 +2703,7 @@ public inline fun Sequence.sumByDouble(transform: (T) -> Double): Double deprecated("Migrate to using Sequence and respective functions") /** - * Returns the sum of all values produced by [transform] function from elements in the collection + * Returns the sum of all values produced by [transform] function from elements in the collection. */ public inline fun Stream.sumByDouble(transform: (T) -> Double): Double { var sum: Double = 0.0 @@ -2714,7 +2714,7 @@ public inline fun Stream.sumByDouble(transform: (T) -> Double): Double { } /** - * Returns the sum of all values produced by [transform] function from characters in the string + * Returns the sum of all values produced by [transform] function from characters in the string. */ public inline fun String.sumByDouble(transform: (Char) -> Double): Double { var sum: Double = 0.0 diff --git a/libraries/stdlib/src/generated/_Arrays.kt b/libraries/stdlib/src/generated/_Arrays.kt index 96cc0240311..7c2d0602365 100644 --- a/libraries/stdlib/src/generated/_Arrays.kt +++ b/libraries/stdlib/src/generated/_Arrays.kt @@ -11,7 +11,7 @@ import java.util.* import java.util.Collections // TODO: it's temporary while we have java.util.Collections in js /** - * Returns the Iterable that wraps the original array + * Returns the Iterable that wraps the original array. */ public fun Array.asIterable(): Iterable { return object : Iterable { @@ -20,7 +20,7 @@ public fun Array.asIterable(): Iterable { } /** - * Returns the Iterable that wraps the original array + * Returns the Iterable that wraps the original array. */ public fun BooleanArray.asIterable(): Iterable { return object : Iterable { @@ -29,7 +29,7 @@ public fun BooleanArray.asIterable(): Iterable { } /** - * Returns the Iterable that wraps the original array + * Returns the Iterable that wraps the original array. */ public fun ByteArray.asIterable(): Iterable { return object : Iterable { @@ -38,7 +38,7 @@ public fun ByteArray.asIterable(): Iterable { } /** - * Returns the Iterable that wraps the original array + * Returns the Iterable that wraps the original array. */ public fun CharArray.asIterable(): Iterable { return object : Iterable { @@ -47,7 +47,7 @@ public fun CharArray.asIterable(): Iterable { } /** - * Returns the Iterable that wraps the original array + * Returns the Iterable that wraps the original array. */ public fun DoubleArray.asIterable(): Iterable { return object : Iterable { @@ -56,7 +56,7 @@ public fun DoubleArray.asIterable(): Iterable { } /** - * Returns the Iterable that wraps the original array + * Returns the Iterable that wraps the original array. */ public fun FloatArray.asIterable(): Iterable { return object : Iterable { @@ -65,7 +65,7 @@ public fun FloatArray.asIterable(): Iterable { } /** - * Returns the Iterable that wraps the original array + * Returns the Iterable that wraps the original array. */ public fun IntArray.asIterable(): Iterable { return object : Iterable { @@ -74,7 +74,7 @@ public fun IntArray.asIterable(): Iterable { } /** - * Returns the Iterable that wraps the original array + * Returns the Iterable that wraps the original array. */ public fun LongArray.asIterable(): Iterable { return object : Iterable { @@ -83,7 +83,7 @@ public fun LongArray.asIterable(): Iterable { } /** - * Returns the Iterable that wraps the original array + * Returns the Iterable that wraps the original array. */ public fun ShortArray.asIterable(): Iterable { return object : Iterable { @@ -92,235 +92,235 @@ public fun ShortArray.asIterable(): Iterable { } /** - * Returns the range of valid indices for the array + * Returns the range of valid indices for the array. */ public val Array.indices: IntRange get() = IntRange(0, lastIndex) /** - * Returns the range of valid indices for the array + * Returns the range of valid indices for the array. */ public val BooleanArray.indices: IntRange get() = IntRange(0, lastIndex) /** - * Returns the range of valid indices for the array + * Returns the range of valid indices for the array. */ public val ByteArray.indices: IntRange get() = IntRange(0, lastIndex) /** - * Returns the range of valid indices for the array + * Returns the range of valid indices for the array. */ public val CharArray.indices: IntRange get() = IntRange(0, lastIndex) /** - * Returns the range of valid indices for the array + * Returns the range of valid indices for the array. */ public val DoubleArray.indices: IntRange get() = IntRange(0, lastIndex) /** - * Returns the range of valid indices for the array + * Returns the range of valid indices for the array. */ public val FloatArray.indices: IntRange get() = IntRange(0, lastIndex) /** - * Returns the range of valid indices for the array + * Returns the range of valid indices for the array. */ public val IntArray.indices: IntRange get() = IntRange(0, lastIndex) /** - * Returns the range of valid indices for the array + * Returns the range of valid indices for the array. */ public val LongArray.indices: IntRange get() = IntRange(0, lastIndex) /** - * Returns the range of valid indices for the array + * Returns the range of valid indices for the array. */ public val ShortArray.indices: IntRange get() = IntRange(0, lastIndex) /** - * Returns true if the array is empty + * Returns `true` if the array is empty. */ public fun Array.isEmpty(): Boolean { return size() == 0 } /** - * Returns true if the array is empty + * Returns `true` if the array is empty. */ public fun BooleanArray.isEmpty(): Boolean { return size() == 0 } /** - * Returns true if the array is empty + * Returns `true` if the array is empty. */ public fun ByteArray.isEmpty(): Boolean { return size() == 0 } /** - * Returns true if the array is empty + * Returns `true` if the array is empty. */ public fun CharArray.isEmpty(): Boolean { return size() == 0 } /** - * Returns true if the array is empty + * Returns `true` if the array is empty. */ public fun DoubleArray.isEmpty(): Boolean { return size() == 0 } /** - * Returns true if the array is empty + * Returns `true` if the array is empty. */ public fun FloatArray.isEmpty(): Boolean { return size() == 0 } /** - * Returns true if the array is empty + * Returns `true` if the array is empty. */ public fun IntArray.isEmpty(): Boolean { return size() == 0 } /** - * Returns true if the array is empty + * Returns `true` if the array is empty. */ public fun LongArray.isEmpty(): Boolean { return size() == 0 } /** - * Returns true if the array is empty + * Returns `true` if the array is empty. */ public fun ShortArray.isEmpty(): Boolean { return size() == 0 } /** - * Returns true if the array is not empty + * Returns `true` if the array is not empty. */ public fun Array.isNotEmpty(): Boolean { return !isEmpty() } /** - * Returns true if the array is not empty + * Returns `true` if the array is not empty. */ public fun BooleanArray.isNotEmpty(): Boolean { return !isEmpty() } /** - * Returns true if the array is not empty + * Returns `true` if the array is not empty. */ public fun ByteArray.isNotEmpty(): Boolean { return !isEmpty() } /** - * Returns true if the array is not empty + * Returns `true` if the array is not empty. */ public fun CharArray.isNotEmpty(): Boolean { return !isEmpty() } /** - * Returns true if the array is not empty + * Returns `true` if the array is not empty. */ public fun DoubleArray.isNotEmpty(): Boolean { return !isEmpty() } /** - * Returns true if the array is not empty + * Returns `true` if the array is not empty. */ public fun FloatArray.isNotEmpty(): Boolean { return !isEmpty() } /** - * Returns true if the array is not empty + * Returns `true` if the array is not empty. */ public fun IntArray.isNotEmpty(): Boolean { return !isEmpty() } /** - * Returns true if the array is not empty + * Returns `true` if the array is not empty. */ public fun LongArray.isNotEmpty(): Boolean { return !isEmpty() } /** - * Returns true if the array is not empty + * Returns `true` if the array is not empty. */ public fun ShortArray.isNotEmpty(): Boolean { return !isEmpty() } /** - * Returns the last valid index for the array + * Returns the last valid index for the array. */ public val Array.lastIndex: Int get() = size() - 1 /** - * Returns the last valid index for the array + * Returns the last valid index for the array. */ public val BooleanArray.lastIndex: Int get() = size() - 1 /** - * Returns the last valid index for the array + * Returns the last valid index for the array. */ public val ByteArray.lastIndex: Int get() = size() - 1 /** - * Returns the last valid index for the array + * Returns the last valid index for the array. */ public val CharArray.lastIndex: Int get() = size() - 1 /** - * Returns the last valid index for the array + * Returns the last valid index for the array. */ public val DoubleArray.lastIndex: Int get() = size() - 1 /** - * Returns the last valid index for the array + * Returns the last valid index for the array. */ public val FloatArray.lastIndex: Int get() = size() - 1 /** - * Returns the last valid index for the array + * Returns the last valid index for the array. */ public val IntArray.lastIndex: Int get() = size() - 1 /** - * Returns the last valid index for the array + * Returns the last valid index for the array. */ public val LongArray.lastIndex: Int get() = size() - 1 /** - * Returns the last valid index for the array + * Returns the last valid index for the array. */ public val ShortArray.lastIndex: Int get() = size() - 1 diff --git a/libraries/stdlib/src/generated/_Elements.kt b/libraries/stdlib/src/generated/_Elements.kt index d10f8b4d07c..3a293656c3c 100644 --- a/libraries/stdlib/src/generated/_Elements.kt +++ b/libraries/stdlib/src/generated/_Elements.kt @@ -361,70 +361,70 @@ public inline fun List.component5(): T { } /** - * Returns true if *element* is found in the collection + * Returns `true` if [element] is found in the collection. */ public fun Array.contains(element: T): Boolean { return indexOf(element) >= 0 } /** - * Returns true if *element* is found in the collection + * Returns `true` if [element] is found in the collection. */ public fun BooleanArray.contains(element: Boolean): Boolean { return indexOf(element) >= 0 } /** - * Returns true if *element* is found in the collection + * Returns `true` if [element] is found in the collection. */ public fun ByteArray.contains(element: Byte): Boolean { return indexOf(element) >= 0 } /** - * Returns true if *element* is found in the collection + * Returns `true` if [element] is found in the collection. */ public fun CharArray.contains(element: Char): Boolean { return indexOf(element) >= 0 } /** - * Returns true if *element* is found in the collection + * Returns `true` if [element] is found in the collection. */ public fun DoubleArray.contains(element: Double): Boolean { return indexOf(element) >= 0 } /** - * Returns true if *element* is found in the collection + * Returns `true` if [element] is found in the collection. */ public fun FloatArray.contains(element: Float): Boolean { return indexOf(element) >= 0 } /** - * Returns true if *element* is found in the collection + * Returns `true` if [element] is found in the collection. */ public fun IntArray.contains(element: Int): Boolean { return indexOf(element) >= 0 } /** - * Returns true if *element* is found in the collection + * Returns `true` if [element] is found in the collection. */ public fun LongArray.contains(element: Long): Boolean { return indexOf(element) >= 0 } /** - * Returns true if *element* is found in the collection + * Returns `true` if [element] is found in the collection. */ public fun ShortArray.contains(element: Short): Boolean { return indexOf(element) >= 0 } /** - * Returns true if *element* is found in the collection + * Returns `true` if [element] is found in the collection. */ public fun Iterable.contains(element: T): Boolean { if (this is Collection<*>) @@ -433,7 +433,7 @@ public fun Iterable.contains(element: T): Boolean { } /** - * Returns true if *element* is found in the collection + * Returns `true` if [element] is found in the collection. */ public fun Sequence.contains(element: T): Boolean { if (this is Collection<*>) @@ -444,7 +444,7 @@ public fun Sequence.contains(element: T): Boolean { deprecated("Migrate to using Sequence and respective functions") /** - * Returns true if *element* is found in the collection + * Returns `true` if [element] is found in the collection. */ public fun Stream.contains(element: T): Boolean { if (this is Collection<*>) @@ -521,7 +521,7 @@ public fun ShortArray.elementAt(index: Int): Short { public fun Iterable.elementAt(index: Int): T { if (this is List) return get(index) - return elementAtOrElse(index) { throw IndexOutOfBoundsException("Collection doesn't contain element at index $index") } + return elementAtOrElse(index) { throw IndexOutOfBoundsException("Collection doesn't contain element at index $index.") } } /** @@ -535,7 +535,7 @@ public fun List.elementAt(index: Int): T { * Returns an element at the given [index] or throws an [IndexOutOfBoundsException] if the [index] is out of bounds of this collection. */ public fun Sequence.elementAt(index: Int): T { - return elementAtOrElse(index) { throw IndexOutOfBoundsException("Sequence doesn't contain element at index $index") } + return elementAtOrElse(index) { throw IndexOutOfBoundsException("Sequence doesn't contain element at index $index.") } } @@ -544,7 +544,7 @@ deprecated("Migrate to using Sequence and respective functions") * Returns an element at the given [index] or throws an [IndexOutOfBoundsException] if the [index] is out of bounds of this collection. */ public fun Stream.elementAt(index: Int): T { - return elementAtOrElse(index) { throw IndexOutOfBoundsException("Stream doesn't contain element at index $index") } + return elementAtOrElse(index) { throw IndexOutOfBoundsException("Stream doesn't contain element at index $index.") } } /** @@ -814,110 +814,110 @@ public fun String.elementAtOrNull(index: Int): Char? { /** * Returns first element. - * @throws NoSuchElementException if the collection is empty. + * @throws [NoSuchElementException] if the collection is empty. */ public fun Array.first(): T { if (isEmpty()) - throw NoSuchElementException("Collection is empty") + throw NoSuchElementException("Collection is empty.") return this[0] } /** * Returns first element. - * @throws NoSuchElementException if the collection is empty. + * @throws [NoSuchElementException] if the collection is empty. */ public fun BooleanArray.first(): Boolean { if (isEmpty()) - throw NoSuchElementException("Collection is empty") + throw NoSuchElementException("Collection is empty.") return this[0] } /** * Returns first element. - * @throws NoSuchElementException if the collection is empty. + * @throws [NoSuchElementException] if the collection is empty. */ public fun ByteArray.first(): Byte { if (isEmpty()) - throw NoSuchElementException("Collection is empty") + throw NoSuchElementException("Collection is empty.") return this[0] } /** * Returns first element. - * @throws NoSuchElementException if the collection is empty. + * @throws [NoSuchElementException] if the collection is empty. */ public fun CharArray.first(): Char { if (isEmpty()) - throw NoSuchElementException("Collection is empty") + throw NoSuchElementException("Collection is empty.") return this[0] } /** * Returns first element. - * @throws NoSuchElementException if the collection is empty. + * @throws [NoSuchElementException] if the collection is empty. */ public fun DoubleArray.first(): Double { if (isEmpty()) - throw NoSuchElementException("Collection is empty") + throw NoSuchElementException("Collection is empty.") return this[0] } /** * Returns first element. - * @throws NoSuchElementException if the collection is empty. + * @throws [NoSuchElementException] if the collection is empty. */ public fun FloatArray.first(): Float { if (isEmpty()) - throw NoSuchElementException("Collection is empty") + throw NoSuchElementException("Collection is empty.") return this[0] } /** * Returns first element. - * @throws NoSuchElementException if the collection is empty. + * @throws [NoSuchElementException] if the collection is empty. */ public fun IntArray.first(): Int { if (isEmpty()) - throw NoSuchElementException("Collection is empty") + throw NoSuchElementException("Collection is empty.") return this[0] } /** * Returns first element. - * @throws NoSuchElementException if the collection is empty. + * @throws [NoSuchElementException] if the collection is empty. */ public fun LongArray.first(): Long { if (isEmpty()) - throw NoSuchElementException("Collection is empty") + throw NoSuchElementException("Collection is empty.") return this[0] } /** * Returns first element. - * @throws NoSuchElementException if the collection is empty. + * @throws [NoSuchElementException] if the collection is empty. */ public fun ShortArray.first(): Short { if (isEmpty()) - throw NoSuchElementException("Collection is empty") + throw NoSuchElementException("Collection is empty.") return this[0] } /** * Returns first element. - * @throws NoSuchElementException if the collection is empty. + * @throws [NoSuchElementException] if the collection is empty. */ public fun Iterable.first(): T { when (this) { is List<*> -> { if (isEmpty()) - throw NoSuchElementException("Collection is empty") + throw NoSuchElementException("Collection is empty.") else return this[0] as T } else -> { val iterator = iterator() if (!iterator.hasNext()) - throw NoSuchElementException("Collection is empty") + throw NoSuchElementException("Collection is empty.") return iterator.next() } } @@ -925,30 +925,30 @@ public fun Iterable.first(): T { /** * Returns first element. - * @throws NoSuchElementException if the collection is empty. + * @throws [NoSuchElementException] if the collection is empty. */ public fun List.first(): T { if (isEmpty()) - throw NoSuchElementException("Collection is empty") + throw NoSuchElementException("Collection is empty.") return this[0] } /** * Returns first element. - * @throws NoSuchElementException if the collection is empty. + * @throws [NoSuchElementException] if the collection is empty. */ public fun Sequence.first(): T { when (this) { is List<*> -> { if (isEmpty()) - throw NoSuchElementException("Collection is empty") + throw NoSuchElementException("Collection is empty.") else return this[0] as T } else -> { val iterator = iterator() if (!iterator.hasNext()) - throw NoSuchElementException("Collection is empty") + throw NoSuchElementException("Collection is empty.") return iterator.next() } } @@ -958,20 +958,20 @@ public fun Sequence.first(): T { deprecated("Migrate to using Sequence and respective functions") /** * Returns first element. - * @throws NoSuchElementException if the collection is empty. + * @throws [NoSuchElementException] if the collection is empty. */ public fun Stream.first(): T { when (this) { is List<*> -> { if (isEmpty()) - throw NoSuchElementException("Collection is empty") + throw NoSuchElementException("Collection is empty.") else return this[0] as T } else -> { val iterator = iterator() if (!iterator.hasNext()) - throw NoSuchElementException("Collection is empty") + throw NoSuchElementException("Collection is empty.") return iterator.next() } } @@ -979,198 +979,198 @@ public fun Stream.first(): T { /** * Returns first character. - * @throws NoSuchElementException if the string is empty. + * @throws [NoSuchElementException] if the string is empty. */ public fun String.first(): Char { if (isEmpty()) - throw NoSuchElementException("Collection is empty") + throw NoSuchElementException("Collection is empty.") return this[0] } /** * Returns the first element matching the given [predicate]. - * @throws NoSuchElementException if no such element is found. + * @throws [NoSuchElementException] if no such element is found. */ public inline fun Array.first(predicate: (T) -> Boolean): T { for (element in this) if (predicate(element)) return element - throw NoSuchElementException("No element matching predicate was found") + throw NoSuchElementException("No element matching predicate was found.") } /** * Returns the first element matching the given [predicate]. - * @throws NoSuchElementException if no such element is found. + * @throws [NoSuchElementException] if no such element is found. */ public inline fun BooleanArray.first(predicate: (Boolean) -> Boolean): Boolean { for (element in this) if (predicate(element)) return element - throw NoSuchElementException("No element matching predicate was found") + throw NoSuchElementException("No element matching predicate was found.") } /** * Returns the first element matching the given [predicate]. - * @throws NoSuchElementException if no such element is found. + * @throws [NoSuchElementException] if no such element is found. */ public inline fun ByteArray.first(predicate: (Byte) -> Boolean): Byte { for (element in this) if (predicate(element)) return element - throw NoSuchElementException("No element matching predicate was found") + throw NoSuchElementException("No element matching predicate was found.") } /** * Returns the first element matching the given [predicate]. - * @throws NoSuchElementException if no such element is found. + * @throws [NoSuchElementException] if no such element is found. */ public inline fun CharArray.first(predicate: (Char) -> Boolean): Char { for (element in this) if (predicate(element)) return element - throw NoSuchElementException("No element matching predicate was found") + throw NoSuchElementException("No element matching predicate was found.") } /** * Returns the first element matching the given [predicate]. - * @throws NoSuchElementException if no such element is found. + * @throws [NoSuchElementException] if no such element is found. */ public inline fun DoubleArray.first(predicate: (Double) -> Boolean): Double { for (element in this) if (predicate(element)) return element - throw NoSuchElementException("No element matching predicate was found") + throw NoSuchElementException("No element matching predicate was found.") } /** * Returns the first element matching the given [predicate]. - * @throws NoSuchElementException if no such element is found. + * @throws [NoSuchElementException] if no such element is found. */ public inline fun FloatArray.first(predicate: (Float) -> Boolean): Float { for (element in this) if (predicate(element)) return element - throw NoSuchElementException("No element matching predicate was found") + throw NoSuchElementException("No element matching predicate was found.") } /** * Returns the first element matching the given [predicate]. - * @throws NoSuchElementException if no such element is found. + * @throws [NoSuchElementException] if no such element is found. */ public inline fun IntArray.first(predicate: (Int) -> Boolean): Int { for (element in this) if (predicate(element)) return element - throw NoSuchElementException("No element matching predicate was found") + throw NoSuchElementException("No element matching predicate was found.") } /** * Returns the first element matching the given [predicate]. - * @throws NoSuchElementException if no such element is found. + * @throws [NoSuchElementException] if no such element is found. */ public inline fun LongArray.first(predicate: (Long) -> Boolean): Long { for (element in this) if (predicate(element)) return element - throw NoSuchElementException("No element matching predicate was found") + throw NoSuchElementException("No element matching predicate was found.") } /** * Returns the first element matching the given [predicate]. - * @throws NoSuchElementException if no such element is found. + * @throws [NoSuchElementException] if no such element is found. */ public inline fun ShortArray.first(predicate: (Short) -> Boolean): Short { for (element in this) if (predicate(element)) return element - throw NoSuchElementException("No element matching predicate was found") + throw NoSuchElementException("No element matching predicate was found.") } /** * Returns the first element matching the given [predicate]. - * @throws NoSuchElementException if no such element is found. + * @throws [NoSuchElementException] if no such element is found. */ public inline fun Iterable.first(predicate: (T) -> Boolean): T { for (element in this) if (predicate(element)) return element - throw NoSuchElementException("No element matching predicate was found") + throw NoSuchElementException("No element matching predicate was found.") } /** * Returns the first element matching the given [predicate]. - * @throws NoSuchElementException if no such element is found. + * @throws [NoSuchElementException] if no such element is found. */ public inline fun Sequence.first(predicate: (T) -> Boolean): T { for (element in this) if (predicate(element)) return element - throw NoSuchElementException("No element matching predicate was found") + throw NoSuchElementException("No element matching predicate was found.") } deprecated("Migrate to using Sequence and respective functions") /** * Returns the first element matching the given [predicate]. - * @throws NoSuchElementException if no such element is found. + * @throws [NoSuchElementException] if no such element is found. */ public inline fun Stream.first(predicate: (T) -> Boolean): T { for (element in this) if (predicate(element)) return element - throw NoSuchElementException("No element matching predicate was found") + throw NoSuchElementException("No element matching predicate was found.") } /** * Returns the first character matching the given [predicate]. - * @throws NoSuchElementException if no such character is found. + * @throws [NoSuchElementException] if no such character is found. */ public inline fun String.first(predicate: (Char) -> Boolean): Char { for (element in this) if (predicate(element)) return element - throw NoSuchElementException("No element matching predicate was found") + throw NoSuchElementException("No element matching predicate was found.") } /** - * Returns the first element, or null if the collection is empty. + * Returns the first element, or `null` if the collection is empty. */ public fun Array.firstOrNull(): T? { return if (isEmpty()) null else this[0] } /** - * Returns the first element, or null if the collection is empty. + * Returns the first element, or `null` if the collection is empty. */ public fun BooleanArray.firstOrNull(): Boolean? { return if (isEmpty()) null else this[0] } /** - * Returns the first element, or null if the collection is empty. + * Returns the first element, or `null` if the collection is empty. */ public fun ByteArray.firstOrNull(): Byte? { return if (isEmpty()) null else this[0] } /** - * Returns the first element, or null if the collection is empty. + * Returns the first element, or `null` if the collection is empty. */ public fun CharArray.firstOrNull(): Char? { return if (isEmpty()) null else this[0] } /** - * Returns the first element, or null if the collection is empty. + * Returns the first element, or `null` if the collection is empty. */ public fun DoubleArray.firstOrNull(): Double? { return if (isEmpty()) null else this[0] } /** - * Returns the first element, or null if the collection is empty. + * Returns the first element, or `null` if the collection is empty. */ public fun FloatArray.firstOrNull(): Float? { return if (isEmpty()) null else this[0] } /** - * Returns the first element, or null if the collection is empty. + * Returns the first element, or `null` if the collection is empty. */ public fun IntArray.firstOrNull(): Int? { return if (isEmpty()) null else this[0] } /** - * Returns the first element, or null if the collection is empty. + * Returns the first element, or `null` if the collection is empty. */ public fun LongArray.firstOrNull(): Long? { return if (isEmpty()) null else this[0] } /** - * Returns the first element, or null if the collection is empty. + * Returns the first element, or `null` if the collection is empty. */ public fun ShortArray.firstOrNull(): Short? { return if (isEmpty()) null else this[0] } /** - * Returns the first element, or null if the collection is empty. + * Returns the first element, or `null` if the collection is empty. */ public fun Iterable.firstOrNull(): T? { when (this) { @@ -1190,14 +1190,14 @@ public fun Iterable.firstOrNull(): T? { } /** - * Returns the first element, or null if the collection is empty. + * Returns the first element, or `null` if the collection is empty. */ public fun List.firstOrNull(): T? { return if (isEmpty()) null else this[0] } /** - * Returns the first element, or null if the collection is empty. + * Returns the first element, or `null` if the collection is empty. */ public fun Sequence.firstOrNull(): T? { when (this) { @@ -1219,7 +1219,7 @@ public fun Sequence.firstOrNull(): T? { deprecated("Migrate to using Sequence and respective functions") /** - * Returns the first element, or null if the collection is empty. + * Returns the first element, or `null` if the collection is empty. */ public fun Stream.firstOrNull(): T? { when (this) { @@ -1239,14 +1239,14 @@ public fun Stream.firstOrNull(): T? { } /** - * Returns the first character, or null if string is empty. + * Returns the first character, or `null` if string is empty. */ public fun String.firstOrNull(): Char? { return if (isEmpty()) null else this[0] } /** - * Returns the first element matching the given [predicate], or `null` if element was not found + * Returns the first element matching the given [predicate], or `null` if element was not found. */ public inline fun Array.firstOrNull(predicate: (T) -> Boolean): T? { for (element in this) if (predicate(element)) return element @@ -1254,7 +1254,7 @@ public inline fun Array.firstOrNull(predicate: (T) -> Boolean): T? { } /** - * Returns the first element matching the given [predicate], or `null` if element was not found + * Returns the first element matching the given [predicate], or `null` if element was not found. */ public inline fun BooleanArray.firstOrNull(predicate: (Boolean) -> Boolean): Boolean? { for (element in this) if (predicate(element)) return element @@ -1262,7 +1262,7 @@ public inline fun BooleanArray.firstOrNull(predicate: (Boolean) -> Boolean): Boo } /** - * Returns the first element matching the given [predicate], or `null` if element was not found + * Returns the first element matching the given [predicate], or `null` if element was not found. */ public inline fun ByteArray.firstOrNull(predicate: (Byte) -> Boolean): Byte? { for (element in this) if (predicate(element)) return element @@ -1270,7 +1270,7 @@ public inline fun ByteArray.firstOrNull(predicate: (Byte) -> Boolean): Byte? { } /** - * Returns the first element matching the given [predicate], or `null` if element was not found + * Returns the first element matching the given [predicate], or `null` if element was not found. */ public inline fun CharArray.firstOrNull(predicate: (Char) -> Boolean): Char? { for (element in this) if (predicate(element)) return element @@ -1278,7 +1278,7 @@ public inline fun CharArray.firstOrNull(predicate: (Char) -> Boolean): Char? { } /** - * Returns the first element matching the given [predicate], or `null` if element was not found + * Returns the first element matching the given [predicate], or `null` if element was not found. */ public inline fun DoubleArray.firstOrNull(predicate: (Double) -> Boolean): Double? { for (element in this) if (predicate(element)) return element @@ -1286,7 +1286,7 @@ public inline fun DoubleArray.firstOrNull(predicate: (Double) -> Boolean): Doubl } /** - * Returns the first element matching the given [predicate], or `null` if element was not found + * Returns the first element matching the given [predicate], or `null` if element was not found. */ public inline fun FloatArray.firstOrNull(predicate: (Float) -> Boolean): Float? { for (element in this) if (predicate(element)) return element @@ -1294,7 +1294,7 @@ public inline fun FloatArray.firstOrNull(predicate: (Float) -> Boolean): Float? } /** - * Returns the first element matching the given [predicate], or `null` if element was not found + * Returns the first element matching the given [predicate], or `null` if element was not found. */ public inline fun IntArray.firstOrNull(predicate: (Int) -> Boolean): Int? { for (element in this) if (predicate(element)) return element @@ -1302,7 +1302,7 @@ public inline fun IntArray.firstOrNull(predicate: (Int) -> Boolean): Int? { } /** - * Returns the first element matching the given [predicate], or `null` if element was not found + * Returns the first element matching the given [predicate], or `null` if element was not found. */ public inline fun LongArray.firstOrNull(predicate: (Long) -> Boolean): Long? { for (element in this) if (predicate(element)) return element @@ -1310,7 +1310,7 @@ public inline fun LongArray.firstOrNull(predicate: (Long) -> Boolean): Long? { } /** - * Returns the first element matching the given [predicate], or `null` if element was not found + * Returns the first element matching the given [predicate], or `null` if element was not found. */ public inline fun ShortArray.firstOrNull(predicate: (Short) -> Boolean): Short? { for (element in this) if (predicate(element)) return element @@ -1318,7 +1318,7 @@ public inline fun ShortArray.firstOrNull(predicate: (Short) -> Boolean): Short? } /** - * Returns the first element matching the given [predicate], or `null` if element was not found + * Returns the first element matching the given [predicate], or `null` if element was not found. */ public inline fun Iterable.firstOrNull(predicate: (T) -> Boolean): T? { for (element in this) if (predicate(element)) return element @@ -1326,7 +1326,7 @@ public inline fun Iterable.firstOrNull(predicate: (T) -> Boolean): T? { } /** - * Returns the first element matching the given [predicate], or `null` if element was not found + * Returns the first element matching the given [predicate], or `null` if element was not found. */ public inline fun Sequence.firstOrNull(predicate: (T) -> Boolean): T? { for (element in this) if (predicate(element)) return element @@ -1336,7 +1336,7 @@ public inline fun Sequence.firstOrNull(predicate: (T) -> Boolean): T? { deprecated("Migrate to using Sequence and respective functions") /** - * Returns the first element matching the given [predicate], or `null` if element was not found + * Returns the first element matching the given [predicate], or `null` if element was not found. */ public inline fun Stream.firstOrNull(predicate: (T) -> Boolean): T? { for (element in this) if (predicate(element)) return element @@ -1344,7 +1344,7 @@ public inline fun Stream.firstOrNull(predicate: (T) -> Boolean): T? { } /** - * Returns the first character matching the given [predicate], or `null` if character was not found + * Returns the first character matching the given [predicate], or `null` if character was not found. */ public inline fun String.firstOrNull(predicate: (Char) -> Boolean): Char? { for (element in this) if (predicate(element)) return element @@ -1352,7 +1352,7 @@ public inline fun String.firstOrNull(predicate: (Char) -> Boolean): Char? { } /** - * Returns first index of [element], or -1 if the collection does not contain element + * Returns first index of [element], or -1 if the collection does not contain element. */ public fun Array.indexOf(element: T): Int { if (element == null) { @@ -1372,7 +1372,7 @@ public fun Array.indexOf(element: T): Int { } /** - * Returns first index of [element], or -1 if the collection does not contain element + * Returns first index of [element], or -1 if the collection does not contain element. */ public fun BooleanArray.indexOf(element: Boolean): Int { for (index in indices) { @@ -1384,7 +1384,7 @@ public fun BooleanArray.indexOf(element: Boolean): Int { } /** - * Returns first index of [element], or -1 if the collection does not contain element + * Returns first index of [element], or -1 if the collection does not contain element. */ public fun ByteArray.indexOf(element: Byte): Int { for (index in indices) { @@ -1396,7 +1396,7 @@ public fun ByteArray.indexOf(element: Byte): Int { } /** - * Returns first index of [element], or -1 if the collection does not contain element + * Returns first index of [element], or -1 if the collection does not contain element. */ public fun CharArray.indexOf(element: Char): Int { for (index in indices) { @@ -1408,7 +1408,7 @@ public fun CharArray.indexOf(element: Char): Int { } /** - * Returns first index of [element], or -1 if the collection does not contain element + * Returns first index of [element], or -1 if the collection does not contain element. */ public fun DoubleArray.indexOf(element: Double): Int { for (index in indices) { @@ -1420,7 +1420,7 @@ public fun DoubleArray.indexOf(element: Double): Int { } /** - * Returns first index of [element], or -1 if the collection does not contain element + * Returns first index of [element], or -1 if the collection does not contain element. */ public fun FloatArray.indexOf(element: Float): Int { for (index in indices) { @@ -1432,7 +1432,7 @@ public fun FloatArray.indexOf(element: Float): Int { } /** - * Returns first index of [element], or -1 if the collection does not contain element + * Returns first index of [element], or -1 if the collection does not contain element. */ public fun IntArray.indexOf(element: Int): Int { for (index in indices) { @@ -1444,7 +1444,7 @@ public fun IntArray.indexOf(element: Int): Int { } /** - * Returns first index of [element], or -1 if the collection does not contain element + * Returns first index of [element], or -1 if the collection does not contain element. */ public fun LongArray.indexOf(element: Long): Int { for (index in indices) { @@ -1456,7 +1456,7 @@ public fun LongArray.indexOf(element: Long): Int { } /** - * Returns first index of [element], or -1 if the collection does not contain element + * Returns first index of [element], or -1 if the collection does not contain element. */ public fun ShortArray.indexOf(element: Short): Int { for (index in indices) { @@ -1468,7 +1468,7 @@ public fun ShortArray.indexOf(element: Short): Int { } /** - * Returns first index of [element], or -1 if the collection does not contain element + * Returns first index of [element], or -1 if the collection does not contain element. */ public fun Iterable.indexOf(element: T): Int { var index = 0 @@ -1481,7 +1481,7 @@ public fun Iterable.indexOf(element: T): Int { } /** - * Returns first index of [element], or -1 if the collection does not contain element + * Returns first index of [element], or -1 if the collection does not contain element. */ public fun Sequence.indexOf(element: T): Int { var index = 0 @@ -1496,7 +1496,7 @@ public fun Sequence.indexOf(element: T): Int { deprecated("Migrate to using Sequence and respective functions") /** - * Returns first index of [element], or -1 if the collection does not contain element + * Returns first index of [element], or -1 if the collection does not contain element. */ public fun Stream.indexOf(element: T): Int { var index = 0 @@ -1509,7 +1509,7 @@ public fun Stream.indexOf(element: T): Int { } /** - * Returns index of the first element matching the given [predicate], or -1 if the collection does not contain such element + * Returns index of the first element matching the given [predicate], or -1 if the collection does not contain such element. */ public inline fun Array.indexOfFirst(predicate: (T) -> Boolean): Int { for (index in indices) { @@ -1521,7 +1521,7 @@ public inline fun Array.indexOfFirst(predicate: (T) -> Boolean): Int } /** - * Returns index of the first element matching the given [predicate], or -1 if the collection does not contain such element + * Returns index of the first element matching the given [predicate], or -1 if the collection does not contain such element. */ public inline fun BooleanArray.indexOfFirst(predicate: (Boolean) -> Boolean): Int { for (index in indices) { @@ -1533,7 +1533,7 @@ public inline fun BooleanArray.indexOfFirst(predicate: (Boolean) -> Boolean): In } /** - * Returns index of the first element matching the given [predicate], or -1 if the collection does not contain such element + * Returns index of the first element matching the given [predicate], or -1 if the collection does not contain such element. */ public inline fun ByteArray.indexOfFirst(predicate: (Byte) -> Boolean): Int { for (index in indices) { @@ -1545,7 +1545,7 @@ public inline fun ByteArray.indexOfFirst(predicate: (Byte) -> Boolean): Int { } /** - * Returns index of the first element matching the given [predicate], or -1 if the collection does not contain such element + * Returns index of the first element matching the given [predicate], or -1 if the collection does not contain such element. */ public inline fun CharArray.indexOfFirst(predicate: (Char) -> Boolean): Int { for (index in indices) { @@ -1557,7 +1557,7 @@ public inline fun CharArray.indexOfFirst(predicate: (Char) -> Boolean): Int { } /** - * Returns index of the first element matching the given [predicate], or -1 if the collection does not contain such element + * Returns index of the first element matching the given [predicate], or -1 if the collection does not contain such element. */ public inline fun DoubleArray.indexOfFirst(predicate: (Double) -> Boolean): Int { for (index in indices) { @@ -1569,7 +1569,7 @@ public inline fun DoubleArray.indexOfFirst(predicate: (Double) -> Boolean): Int } /** - * Returns index of the first element matching the given [predicate], or -1 if the collection does not contain such element + * Returns index of the first element matching the given [predicate], or -1 if the collection does not contain such element. */ public inline fun FloatArray.indexOfFirst(predicate: (Float) -> Boolean): Int { for (index in indices) { @@ -1581,7 +1581,7 @@ public inline fun FloatArray.indexOfFirst(predicate: (Float) -> Boolean): Int { } /** - * Returns index of the first element matching the given [predicate], or -1 if the collection does not contain such element + * Returns index of the first element matching the given [predicate], or -1 if the collection does not contain such element. */ public inline fun IntArray.indexOfFirst(predicate: (Int) -> Boolean): Int { for (index in indices) { @@ -1593,7 +1593,7 @@ public inline fun IntArray.indexOfFirst(predicate: (Int) -> Boolean): Int { } /** - * Returns index of the first element matching the given [predicate], or -1 if the collection does not contain such element + * Returns index of the first element matching the given [predicate], or -1 if the collection does not contain such element. */ public inline fun LongArray.indexOfFirst(predicate: (Long) -> Boolean): Int { for (index in indices) { @@ -1605,7 +1605,7 @@ public inline fun LongArray.indexOfFirst(predicate: (Long) -> Boolean): Int { } /** - * Returns index of the first element matching the given [predicate], or -1 if the collection does not contain such element + * Returns index of the first element matching the given [predicate], or -1 if the collection does not contain such element. */ public inline fun ShortArray.indexOfFirst(predicate: (Short) -> Boolean): Int { for (index in indices) { @@ -1617,7 +1617,7 @@ public inline fun ShortArray.indexOfFirst(predicate: (Short) -> Boolean): Int { } /** - * Returns index of the first element matching the given [predicate], or -1 if the collection does not contain such element + * Returns index of the first element matching the given [predicate], or -1 if the collection does not contain such element. */ public inline fun Iterable.indexOfFirst(predicate: (T) -> Boolean): Int { var index = 0 @@ -1630,7 +1630,7 @@ public inline fun Iterable.indexOfFirst(predicate: (T) -> Boolean): Int { } /** - * Returns index of the first element matching the given [predicate], or -1 if the collection does not contain such element + * Returns index of the first element matching the given [predicate], or -1 if the collection does not contain such element. */ public inline fun List.indexOfFirst(predicate: (T) -> Boolean): Int { for (index in indices) { @@ -1642,7 +1642,7 @@ public inline fun List.indexOfFirst(predicate: (T) -> Boolean): Int { } /** - * Returns index of the first element matching the given [predicate], or -1 if the collection does not contain such element + * Returns index of the first element matching the given [predicate], or -1 if the collection does not contain such element. */ public inline fun Sequence.indexOfFirst(predicate: (T) -> Boolean): Int { var index = 0 @@ -1657,7 +1657,7 @@ public inline fun Sequence.indexOfFirst(predicate: (T) -> Boolean): Int { deprecated("Migrate to using Sequence and respective functions") /** - * Returns index of the first element matching the given [predicate], or -1 if the collection does not contain such element + * Returns index of the first element matching the given [predicate], or -1 if the collection does not contain such element. */ public inline fun Stream.indexOfFirst(predicate: (T) -> Boolean): Int { var index = 0 @@ -1670,7 +1670,7 @@ public inline fun Stream.indexOfFirst(predicate: (T) -> Boolean): Int { } /** - * Returns index of the first element matching the given [predicate], or -1 if the collection does not contain such element + * Returns index of the first element matching the given [predicate], or -1 if the collection does not contain such element. */ public inline fun String.indexOfFirst(predicate: (Char) -> Boolean): Int { for (index in indices) { @@ -1682,7 +1682,7 @@ public inline fun String.indexOfFirst(predicate: (Char) -> Boolean): Int { } /** - * Returns index of the last element matching the given [predicate], or -1 if the collection does not contain such element + * Returns index of the last element matching the given [predicate], or -1 if the collection does not contain such element. */ public inline fun Array.indexOfLast(predicate: (T) -> Boolean): Int { for (index in indices.reversed()) { @@ -1694,7 +1694,7 @@ public inline fun Array.indexOfLast(predicate: (T) -> Boolean): Int { } /** - * Returns index of the last element matching the given [predicate], or -1 if the collection does not contain such element + * Returns index of the last element matching the given [predicate], or -1 if the collection does not contain such element. */ public inline fun BooleanArray.indexOfLast(predicate: (Boolean) -> Boolean): Int { for (index in indices.reversed()) { @@ -1706,7 +1706,7 @@ public inline fun BooleanArray.indexOfLast(predicate: (Boolean) -> Boolean): Int } /** - * Returns index of the last element matching the given [predicate], or -1 if the collection does not contain such element + * Returns index of the last element matching the given [predicate], or -1 if the collection does not contain such element. */ public inline fun ByteArray.indexOfLast(predicate: (Byte) -> Boolean): Int { for (index in indices.reversed()) { @@ -1718,7 +1718,7 @@ public inline fun ByteArray.indexOfLast(predicate: (Byte) -> Boolean): Int { } /** - * Returns index of the last element matching the given [predicate], or -1 if the collection does not contain such element + * Returns index of the last element matching the given [predicate], or -1 if the collection does not contain such element. */ public inline fun CharArray.indexOfLast(predicate: (Char) -> Boolean): Int { for (index in indices.reversed()) { @@ -1730,7 +1730,7 @@ public inline fun CharArray.indexOfLast(predicate: (Char) -> Boolean): Int { } /** - * Returns index of the last element matching the given [predicate], or -1 if the collection does not contain such element + * Returns index of the last element matching the given [predicate], or -1 if the collection does not contain such element. */ public inline fun DoubleArray.indexOfLast(predicate: (Double) -> Boolean): Int { for (index in indices.reversed()) { @@ -1742,7 +1742,7 @@ public inline fun DoubleArray.indexOfLast(predicate: (Double) -> Boolean): Int { } /** - * Returns index of the last element matching the given [predicate], or -1 if the collection does not contain such element + * Returns index of the last element matching the given [predicate], or -1 if the collection does not contain such element. */ public inline fun FloatArray.indexOfLast(predicate: (Float) -> Boolean): Int { for (index in indices.reversed()) { @@ -1754,7 +1754,7 @@ public inline fun FloatArray.indexOfLast(predicate: (Float) -> Boolean): Int { } /** - * Returns index of the last element matching the given [predicate], or -1 if the collection does not contain such element + * Returns index of the last element matching the given [predicate], or -1 if the collection does not contain such element. */ public inline fun IntArray.indexOfLast(predicate: (Int) -> Boolean): Int { for (index in indices.reversed()) { @@ -1766,7 +1766,7 @@ public inline fun IntArray.indexOfLast(predicate: (Int) -> Boolean): Int { } /** - * Returns index of the last element matching the given [predicate], or -1 if the collection does not contain such element + * Returns index of the last element matching the given [predicate], or -1 if the collection does not contain such element. */ public inline fun LongArray.indexOfLast(predicate: (Long) -> Boolean): Int { for (index in indices.reversed()) { @@ -1778,7 +1778,7 @@ public inline fun LongArray.indexOfLast(predicate: (Long) -> Boolean): Int { } /** - * Returns index of the last element matching the given [predicate], or -1 if the collection does not contain such element + * Returns index of the last element matching the given [predicate], or -1 if the collection does not contain such element. */ public inline fun ShortArray.indexOfLast(predicate: (Short) -> Boolean): Int { for (index in indices.reversed()) { @@ -1790,7 +1790,7 @@ public inline fun ShortArray.indexOfLast(predicate: (Short) -> Boolean): Int { } /** - * Returns index of the last element matching the given [predicate], or -1 if the collection does not contain such element + * Returns index of the last element matching the given [predicate], or -1 if the collection does not contain such element. */ public inline fun Iterable.indexOfLast(predicate: (T) -> Boolean): Int { var lastIndex = -1 @@ -1804,7 +1804,7 @@ public inline fun Iterable.indexOfLast(predicate: (T) -> Boolean): Int { } /** - * Returns index of the last element matching the given [predicate], or -1 if the collection does not contain such element + * Returns index of the last element matching the given [predicate], or -1 if the collection does not contain such element. */ public inline fun List.indexOfLast(predicate: (T) -> Boolean): Int { for (index in indices.reversed()) { @@ -1816,7 +1816,7 @@ public inline fun List.indexOfLast(predicate: (T) -> Boolean): Int { } /** - * Returns index of the last element matching the given [predicate], or -1 if the collection does not contain such element + * Returns index of the last element matching the given [predicate], or -1 if the collection does not contain such element. */ public inline fun Sequence.indexOfLast(predicate: (T) -> Boolean): Int { var lastIndex = -1 @@ -1832,7 +1832,7 @@ public inline fun Sequence.indexOfLast(predicate: (T) -> Boolean): Int { deprecated("Migrate to using Sequence and respective functions") /** - * Returns index of the last element matching the given [predicate], or -1 if the collection does not contain such element + * Returns index of the last element matching the given [predicate], or -1 if the collection does not contain such element. */ public inline fun Stream.indexOfLast(predicate: (T) -> Boolean): Int { var lastIndex = -1 @@ -1846,7 +1846,7 @@ public inline fun Stream.indexOfLast(predicate: (T) -> Boolean): Int { } /** - * Returns index of the last element matching the given [predicate], or -1 if the collection does not contain such element + * Returns index of the last element matching the given [predicate], or -1 if the collection does not contain such element. */ public inline fun String.indexOfLast(predicate: (Char) -> Boolean): Int { for (index in indices.reversed()) { @@ -1859,110 +1859,110 @@ public inline fun String.indexOfLast(predicate: (Char) -> Boolean): Int { /** * Returns the last element. - * @throws NoSuchElementException if the collection is empty. + * @throws [NoSuchElementException] if the collection is empty. */ public fun Array.last(): T { if (isEmpty()) - throw NoSuchElementException("Collection is empty") + throw NoSuchElementException("Collection is empty.") return this[lastIndex] } /** * Returns the last element. - * @throws NoSuchElementException if the collection is empty. + * @throws [NoSuchElementException] if the collection is empty. */ public fun BooleanArray.last(): Boolean { if (isEmpty()) - throw NoSuchElementException("Collection is empty") + throw NoSuchElementException("Collection is empty.") return this[lastIndex] } /** * Returns the last element. - * @throws NoSuchElementException if the collection is empty. + * @throws [NoSuchElementException] if the collection is empty. */ public fun ByteArray.last(): Byte { if (isEmpty()) - throw NoSuchElementException("Collection is empty") + throw NoSuchElementException("Collection is empty.") return this[lastIndex] } /** * Returns the last element. - * @throws NoSuchElementException if the collection is empty. + * @throws [NoSuchElementException] if the collection is empty. */ public fun CharArray.last(): Char { if (isEmpty()) - throw NoSuchElementException("Collection is empty") + throw NoSuchElementException("Collection is empty.") return this[lastIndex] } /** * Returns the last element. - * @throws NoSuchElementException if the collection is empty. + * @throws [NoSuchElementException] if the collection is empty. */ public fun DoubleArray.last(): Double { if (isEmpty()) - throw NoSuchElementException("Collection is empty") + throw NoSuchElementException("Collection is empty.") return this[lastIndex] } /** * Returns the last element. - * @throws NoSuchElementException if the collection is empty. + * @throws [NoSuchElementException] if the collection is empty. */ public fun FloatArray.last(): Float { if (isEmpty()) - throw NoSuchElementException("Collection is empty") + throw NoSuchElementException("Collection is empty.") return this[lastIndex] } /** * Returns the last element. - * @throws NoSuchElementException if the collection is empty. + * @throws [NoSuchElementException] if the collection is empty. */ public fun IntArray.last(): Int { if (isEmpty()) - throw NoSuchElementException("Collection is empty") + throw NoSuchElementException("Collection is empty.") return this[lastIndex] } /** * Returns the last element. - * @throws NoSuchElementException if the collection is empty. + * @throws [NoSuchElementException] if the collection is empty. */ public fun LongArray.last(): Long { if (isEmpty()) - throw NoSuchElementException("Collection is empty") + throw NoSuchElementException("Collection is empty.") return this[lastIndex] } /** * Returns the last element. - * @throws NoSuchElementException if the collection is empty. + * @throws [NoSuchElementException] if the collection is empty. */ public fun ShortArray.last(): Short { if (isEmpty()) - throw NoSuchElementException("Collection is empty") + throw NoSuchElementException("Collection is empty.") return this[lastIndex] } /** * Returns the last element. - * @throws NoSuchElementException if the collection is empty. + * @throws [NoSuchElementException] if the collection is empty. */ public fun Iterable.last(): T { when (this) { is List<*> -> { if (isEmpty()) - throw NoSuchElementException("Collection is empty") + throw NoSuchElementException("Collection is empty.") else return this[this.lastIndex] as T } else -> { val iterator = iterator() if (!iterator.hasNext()) - throw NoSuchElementException("Collection is empty") + throw NoSuchElementException("Collection is empty.") var last = iterator.next() while (iterator.hasNext()) last = iterator.next() @@ -1973,22 +1973,22 @@ public fun Iterable.last(): T { /** * Returns the last element. - * @throws NoSuchElementException if the collection is empty. + * @throws [NoSuchElementException] if the collection is empty. */ public fun List.last(): T { if (isEmpty()) - throw NoSuchElementException("Collection is empty") + throw NoSuchElementException("Collection is empty.") return this[lastIndex] } /** * Returns the last element. - * @throws NoSuchElementException if the collection is empty. + * @throws [NoSuchElementException] if the collection is empty. */ public fun Sequence.last(): T { val iterator = iterator() if (!iterator.hasNext()) - throw NoSuchElementException("Collection is empty") + throw NoSuchElementException("Collection is empty.") var last = iterator.next() while (iterator.hasNext()) last = iterator.next() @@ -1999,12 +1999,12 @@ public fun Sequence.last(): T { deprecated("Migrate to using Sequence and respective functions") /** * Returns the last element. - * @throws NoSuchElementException if the collection is empty. + * @throws [NoSuchElementException] if the collection is empty. */ public fun Stream.last(): T { val iterator = iterator() if (!iterator.hasNext()) - throw NoSuchElementException("Collection is empty") + throw NoSuchElementException("Collection is empty.") var last = iterator.next() while (iterator.hasNext()) last = iterator.next() @@ -2013,17 +2013,17 @@ public fun Stream.last(): T { /** * "Returns the last character. - * @throws NoSuchElementException if the string is empty. + * @throws [NoSuchElementException] if the string is empty. */ public fun String.last(): Char { if (isEmpty()) - throw NoSuchElementException("Collection is empty") + throw NoSuchElementException("Collection is empty.") return this[lastIndex] } /** * Returns the last element matching the given [predicate]. - * @throws NoSuchElementException if no such element is found. + * @throws [NoSuchElementException] if no such element is found. */ public inline fun Array.last(predicate: (T) -> Boolean): T { for (index in this.indices.reversed()) { @@ -2035,7 +2035,7 @@ public inline fun Array.last(predicate: (T) -> Boolean): T { /** * Returns the last element matching the given [predicate]. - * @throws NoSuchElementException if no such element is found. + * @throws [NoSuchElementException] if no such element is found. */ public inline fun BooleanArray.last(predicate: (Boolean) -> Boolean): Boolean { for (index in this.indices.reversed()) { @@ -2047,7 +2047,7 @@ public inline fun BooleanArray.last(predicate: (Boolean) -> Boolean): Boolean { /** * Returns the last element matching the given [predicate]. - * @throws NoSuchElementException if no such element is found. + * @throws [NoSuchElementException] if no such element is found. */ public inline fun ByteArray.last(predicate: (Byte) -> Boolean): Byte { for (index in this.indices.reversed()) { @@ -2059,7 +2059,7 @@ public inline fun ByteArray.last(predicate: (Byte) -> Boolean): Byte { /** * Returns the last element matching the given [predicate]. - * @throws NoSuchElementException if no such element is found. + * @throws [NoSuchElementException] if no such element is found. */ public inline fun CharArray.last(predicate: (Char) -> Boolean): Char { for (index in this.indices.reversed()) { @@ -2071,7 +2071,7 @@ public inline fun CharArray.last(predicate: (Char) -> Boolean): Char { /** * Returns the last element matching the given [predicate]. - * @throws NoSuchElementException if no such element is found. + * @throws [NoSuchElementException] if no such element is found. */ public inline fun DoubleArray.last(predicate: (Double) -> Boolean): Double { for (index in this.indices.reversed()) { @@ -2083,7 +2083,7 @@ public inline fun DoubleArray.last(predicate: (Double) -> Boolean): Double { /** * Returns the last element matching the given [predicate]. - * @throws NoSuchElementException if no such element is found. + * @throws [NoSuchElementException] if no such element is found. */ public inline fun FloatArray.last(predicate: (Float) -> Boolean): Float { for (index in this.indices.reversed()) { @@ -2095,7 +2095,7 @@ public inline fun FloatArray.last(predicate: (Float) -> Boolean): Float { /** * Returns the last element matching the given [predicate]. - * @throws NoSuchElementException if no such element is found. + * @throws [NoSuchElementException] if no such element is found. */ public inline fun IntArray.last(predicate: (Int) -> Boolean): Int { for (index in this.indices.reversed()) { @@ -2107,7 +2107,7 @@ public inline fun IntArray.last(predicate: (Int) -> Boolean): Int { /** * Returns the last element matching the given [predicate]. - * @throws NoSuchElementException if no such element is found. + * @throws [NoSuchElementException] if no such element is found. */ public inline fun LongArray.last(predicate: (Long) -> Boolean): Long { for (index in this.indices.reversed()) { @@ -2119,7 +2119,7 @@ public inline fun LongArray.last(predicate: (Long) -> Boolean): Long { /** * Returns the last element matching the given [predicate]. - * @throws NoSuchElementException if no such element is found. + * @throws [NoSuchElementException] if no such element is found. */ public inline fun ShortArray.last(predicate: (Short) -> Boolean): Short { for (index in this.indices.reversed()) { @@ -2131,7 +2131,7 @@ public inline fun ShortArray.last(predicate: (Short) -> Boolean): Short { /** * Returns the last element matching the given [predicate]. - * @throws NoSuchElementException if no such element is found. + * @throws [NoSuchElementException] if no such element is found. */ public inline fun Iterable.last(predicate: (T) -> Boolean): T { if (this is List) @@ -2150,7 +2150,7 @@ public inline fun Iterable.last(predicate: (T) -> Boolean): T { /** * Returns the last element matching the given [predicate]. - * @throws NoSuchElementException if no such element is found. + * @throws [NoSuchElementException] if no such element is found. */ public inline fun List.last(predicate: (T) -> Boolean): T { for (index in this.indices.reversed()) { @@ -2162,7 +2162,7 @@ public inline fun List.last(predicate: (T) -> Boolean): T { /** * Returns the last element matching the given [predicate]. - * @throws NoSuchElementException if no such element is found. + * @throws [NoSuchElementException] if no such element is found. */ public inline fun Sequence.last(predicate: (T) -> Boolean): T { var last: T? = null @@ -2181,7 +2181,7 @@ public inline fun Sequence.last(predicate: (T) -> Boolean): T { deprecated("Migrate to using Sequence and respective functions") /** * Returns the last element matching the given [predicate]. - * @throws NoSuchElementException if no such element is found. + * @throws [NoSuchElementException] if no such element is found. */ public inline fun Stream.last(predicate: (T) -> Boolean): T { var last: T? = null @@ -2198,7 +2198,7 @@ public inline fun Stream.last(predicate: (T) -> Boolean): T { /** * "Returns the last character matching the given [predicate]. - * @throws NoSuchElementException if no such character is found. + * @throws [NoSuchElementException] if no such character is found. */ public inline fun String.last(predicate: (Char) -> Boolean): Char { var last: Char? = null @@ -2214,7 +2214,7 @@ public inline fun String.last(predicate: (Char) -> Boolean): Char { } /** - * Returns last index of *element*, or -1 if the collection does not contain element + * Returns last index of [element], or -1 if the collection does not contain element. */ public fun Array.lastIndexOf(element: T): Int { if (element == null) { @@ -2234,7 +2234,7 @@ public fun Array.lastIndexOf(element: T): Int { } /** - * Returns last index of *element*, or -1 if the collection does not contain element + * Returns last index of [element], or -1 if the collection does not contain element. */ public fun BooleanArray.lastIndexOf(element: Boolean): Int { for (index in indices.reverse()) { @@ -2246,7 +2246,7 @@ public fun BooleanArray.lastIndexOf(element: Boolean): Int { } /** - * Returns last index of *element*, or -1 if the collection does not contain element + * Returns last index of [element], or -1 if the collection does not contain element. */ public fun ByteArray.lastIndexOf(element: Byte): Int { for (index in indices.reverse()) { @@ -2258,7 +2258,7 @@ public fun ByteArray.lastIndexOf(element: Byte): Int { } /** - * Returns last index of *element*, or -1 if the collection does not contain element + * Returns last index of [element], or -1 if the collection does not contain element. */ public fun CharArray.lastIndexOf(element: Char): Int { for (index in indices.reverse()) { @@ -2270,7 +2270,7 @@ public fun CharArray.lastIndexOf(element: Char): Int { } /** - * Returns last index of *element*, or -1 if the collection does not contain element + * Returns last index of [element], or -1 if the collection does not contain element. */ public fun DoubleArray.lastIndexOf(element: Double): Int { for (index in indices.reverse()) { @@ -2282,7 +2282,7 @@ public fun DoubleArray.lastIndexOf(element: Double): Int { } /** - * Returns last index of *element*, or -1 if the collection does not contain element + * Returns last index of [element], or -1 if the collection does not contain element. */ public fun FloatArray.lastIndexOf(element: Float): Int { for (index in indices.reverse()) { @@ -2294,7 +2294,7 @@ public fun FloatArray.lastIndexOf(element: Float): Int { } /** - * Returns last index of *element*, or -1 if the collection does not contain element + * Returns last index of [element], or -1 if the collection does not contain element. */ public fun IntArray.lastIndexOf(element: Int): Int { for (index in indices.reverse()) { @@ -2306,7 +2306,7 @@ public fun IntArray.lastIndexOf(element: Int): Int { } /** - * Returns last index of *element*, or -1 if the collection does not contain element + * Returns last index of [element], or -1 if the collection does not contain element. */ public fun LongArray.lastIndexOf(element: Long): Int { for (index in indices.reverse()) { @@ -2318,7 +2318,7 @@ public fun LongArray.lastIndexOf(element: Long): Int { } /** - * Returns last index of *element*, or -1 if the collection does not contain element + * Returns last index of [element], or -1 if the collection does not contain element. */ public fun ShortArray.lastIndexOf(element: Short): Int { for (index in indices.reverse()) { @@ -2330,7 +2330,7 @@ public fun ShortArray.lastIndexOf(element: Short): Int { } /** - * Returns last index of *element*, or -1 if the collection does not contain element + * Returns last index of [element], or -1 if the collection does not contain element. */ public fun Iterable.lastIndexOf(element: T): Int { var lastIndex = -1 @@ -2344,7 +2344,7 @@ public fun Iterable.lastIndexOf(element: T): Int { } /** - * Returns last index of *element*, or -1 if the collection does not contain element + * Returns last index of [element], or -1 if the collection does not contain element. */ public fun Sequence.lastIndexOf(element: T): Int { var lastIndex = -1 @@ -2360,7 +2360,7 @@ public fun Sequence.lastIndexOf(element: T): Int { deprecated("Migrate to using Sequence and respective functions") /** - * Returns last index of *element*, or -1 if the collection does not contain element + * Returns last index of [element], or -1 if the collection does not contain element. */ public fun Stream.lastIndexOf(element: T): Int { var lastIndex = -1 @@ -2374,70 +2374,70 @@ public fun Stream.lastIndexOf(element: T): Int { } /** - * Returns the last element, or `null` if the collection is empty + * Returns the last element, or `null` if the collection is empty. */ public fun Array.lastOrNull(): T? { return if (isEmpty()) null else this[size() - 1] } /** - * Returns the last element, or `null` if the collection is empty + * Returns the last element, or `null` if the collection is empty. */ public fun BooleanArray.lastOrNull(): Boolean? { return if (isEmpty()) null else this[size() - 1] } /** - * Returns the last element, or `null` if the collection is empty + * Returns the last element, or `null` if the collection is empty. */ public fun ByteArray.lastOrNull(): Byte? { return if (isEmpty()) null else this[size() - 1] } /** - * Returns the last element, or `null` if the collection is empty + * Returns the last element, or `null` if the collection is empty. */ public fun CharArray.lastOrNull(): Char? { return if (isEmpty()) null else this[size() - 1] } /** - * Returns the last element, or `null` if the collection is empty + * Returns the last element, or `null` if the collection is empty. */ public fun DoubleArray.lastOrNull(): Double? { return if (isEmpty()) null else this[size() - 1] } /** - * Returns the last element, or `null` if the collection is empty + * Returns the last element, or `null` if the collection is empty. */ public fun FloatArray.lastOrNull(): Float? { return if (isEmpty()) null else this[size() - 1] } /** - * Returns the last element, or `null` if the collection is empty + * Returns the last element, or `null` if the collection is empty. */ public fun IntArray.lastOrNull(): Int? { return if (isEmpty()) null else this[size() - 1] } /** - * Returns the last element, or `null` if the collection is empty + * Returns the last element, or `null` if the collection is empty. */ public fun LongArray.lastOrNull(): Long? { return if (isEmpty()) null else this[size() - 1] } /** - * Returns the last element, or `null` if the collection is empty + * Returns the last element, or `null` if the collection is empty. */ public fun ShortArray.lastOrNull(): Short? { return if (isEmpty()) null else this[size() - 1] } /** - * Returns the last element, or `null` if the collection is empty + * Returns the last element, or `null` if the collection is empty. */ public fun Iterable.lastOrNull(): T? { when (this) { @@ -2455,14 +2455,14 @@ public fun Iterable.lastOrNull(): T? { } /** - * Returns the last element, or `null` if the collection is empty + * Returns the last element, or `null` if the collection is empty. */ public fun List.lastOrNull(): T? { return if (isEmpty()) null else this[size() - 1] } /** - * Returns the last element, or `null` if the collection is empty + * Returns the last element, or `null` if the collection is empty. */ public fun Sequence.lastOrNull(): T? { val iterator = iterator() @@ -2477,7 +2477,7 @@ public fun Sequence.lastOrNull(): T? { deprecated("Migrate to using Sequence and respective functions") /** - * Returns the last element, or `null` if the collection is empty + * Returns the last element, or `null` if the collection is empty. */ public fun Stream.lastOrNull(): T? { val iterator = iterator() @@ -2490,7 +2490,7 @@ public fun Stream.lastOrNull(): T? { } /** - * Returns the last character, or `null` if the string is empty + * Returns the last character, or `null` if the string is empty. */ public fun String.lastOrNull(): Char? { return if (isEmpty()) null else this[length() - 1] @@ -2667,9 +2667,9 @@ public inline fun String.lastOrNull(predicate: (Char) -> Boolean): Char? { */ public fun Array.single(): T { return when (size()) { - 0 -> throw NoSuchElementException("Collection is empty") + 0 -> throw NoSuchElementException("Collection is empty.") 1 -> this[0] - else -> throw IllegalArgumentException("Collection has more than one element") + else -> throw IllegalArgumentException("Collection has more than one element.") } } @@ -2678,9 +2678,9 @@ public fun Array.single(): T { */ public fun BooleanArray.single(): Boolean { return when (size()) { - 0 -> throw NoSuchElementException("Collection is empty") + 0 -> throw NoSuchElementException("Collection is empty.") 1 -> this[0] - else -> throw IllegalArgumentException("Collection has more than one element") + else -> throw IllegalArgumentException("Collection has more than one element.") } } @@ -2689,9 +2689,9 @@ public fun BooleanArray.single(): Boolean { */ public fun ByteArray.single(): Byte { return when (size()) { - 0 -> throw NoSuchElementException("Collection is empty") + 0 -> throw NoSuchElementException("Collection is empty.") 1 -> this[0] - else -> throw IllegalArgumentException("Collection has more than one element") + else -> throw IllegalArgumentException("Collection has more than one element.") } } @@ -2700,9 +2700,9 @@ public fun ByteArray.single(): Byte { */ public fun CharArray.single(): Char { return when (size()) { - 0 -> throw NoSuchElementException("Collection is empty") + 0 -> throw NoSuchElementException("Collection is empty.") 1 -> this[0] - else -> throw IllegalArgumentException("Collection has more than one element") + else -> throw IllegalArgumentException("Collection has more than one element.") } } @@ -2711,9 +2711,9 @@ public fun CharArray.single(): Char { */ public fun DoubleArray.single(): Double { return when (size()) { - 0 -> throw NoSuchElementException("Collection is empty") + 0 -> throw NoSuchElementException("Collection is empty.") 1 -> this[0] - else -> throw IllegalArgumentException("Collection has more than one element") + else -> throw IllegalArgumentException("Collection has more than one element.") } } @@ -2722,9 +2722,9 @@ public fun DoubleArray.single(): Double { */ public fun FloatArray.single(): Float { return when (size()) { - 0 -> throw NoSuchElementException("Collection is empty") + 0 -> throw NoSuchElementException("Collection is empty.") 1 -> this[0] - else -> throw IllegalArgumentException("Collection has more than one element") + else -> throw IllegalArgumentException("Collection has more than one element.") } } @@ -2733,9 +2733,9 @@ public fun FloatArray.single(): Float { */ public fun IntArray.single(): Int { return when (size()) { - 0 -> throw NoSuchElementException("Collection is empty") + 0 -> throw NoSuchElementException("Collection is empty.") 1 -> this[0] - else -> throw IllegalArgumentException("Collection has more than one element") + else -> throw IllegalArgumentException("Collection has more than one element.") } } @@ -2744,9 +2744,9 @@ public fun IntArray.single(): Int { */ public fun LongArray.single(): Long { return when (size()) { - 0 -> throw NoSuchElementException("Collection is empty") + 0 -> throw NoSuchElementException("Collection is empty.") 1 -> this[0] - else -> throw IllegalArgumentException("Collection has more than one element") + else -> throw IllegalArgumentException("Collection has more than one element.") } } @@ -2755,9 +2755,9 @@ public fun LongArray.single(): Long { */ public fun ShortArray.single(): Short { return when (size()) { - 0 -> throw NoSuchElementException("Collection is empty") + 0 -> throw NoSuchElementException("Collection is empty.") 1 -> this[0] - else -> throw IllegalArgumentException("Collection has more than one element") + else -> throw IllegalArgumentException("Collection has more than one element.") } } @@ -2767,17 +2767,17 @@ public fun ShortArray.single(): Short { public fun Iterable.single(): T { when (this) { is List<*> -> return when (size()) { - 0 -> throw NoSuchElementException("Collection is empty") + 0 -> throw NoSuchElementException("Collection is empty.") 1 -> this[0] as T - else -> throw IllegalArgumentException("Collection has more than one element") + else -> throw IllegalArgumentException("Collection has more than one element.") } else -> { val iterator = iterator() if (!iterator.hasNext()) - throw NoSuchElementException("Collection is empty") + throw NoSuchElementException("Collection is empty.") var single = iterator.next() if (iterator.hasNext()) - throw IllegalArgumentException("Collection has more than one element") + throw IllegalArgumentException("Collection has more than one element.") return single } } @@ -2788,9 +2788,9 @@ public fun Iterable.single(): T { */ public fun List.single(): T { return when (size()) { - 0 -> throw NoSuchElementException("Collection is empty") + 0 -> throw NoSuchElementException("Collection is empty.") 1 -> this[0] - else -> throw IllegalArgumentException("Collection has more than one element") + else -> throw IllegalArgumentException("Collection has more than one element.") } } @@ -2800,17 +2800,17 @@ public fun List.single(): T { public fun Sequence.single(): T { when (this) { is List<*> -> return when (size()) { - 0 -> throw NoSuchElementException("Collection is empty") + 0 -> throw NoSuchElementException("Collection is empty.") 1 -> this[0] as T - else -> throw IllegalArgumentException("Collection has more than one element") + else -> throw IllegalArgumentException("Collection has more than one element.") } else -> { val iterator = iterator() if (!iterator.hasNext()) - throw NoSuchElementException("Collection is empty") + throw NoSuchElementException("Collection is empty.") var single = iterator.next() if (iterator.hasNext()) - throw IllegalArgumentException("Collection has more than one element") + throw IllegalArgumentException("Collection has more than one element.") return single } } @@ -2824,17 +2824,17 @@ deprecated("Migrate to using Sequence and respective functions") public fun Stream.single(): T { when (this) { is List<*> -> return when (size()) { - 0 -> throw NoSuchElementException("Collection is empty") + 0 -> throw NoSuchElementException("Collection is empty.") 1 -> this[0] as T - else -> throw IllegalArgumentException("Collection has more than one element") + else -> throw IllegalArgumentException("Collection has more than one element.") } else -> { val iterator = iterator() if (!iterator.hasNext()) - throw NoSuchElementException("Collection is empty") + throw NoSuchElementException("Collection is empty.") var single = iterator.next() if (iterator.hasNext()) - throw IllegalArgumentException("Collection has more than one element") + throw IllegalArgumentException("Collection has more than one element.") return single } } @@ -2845,232 +2845,232 @@ public fun Stream.single(): T { */ public fun String.single(): Char { return when (length()) { - 0 -> throw NoSuchElementException("Collection is empty") + 0 -> throw NoSuchElementException("Collection is empty.") 1 -> this[0] - else -> throw IllegalArgumentException("Collection has more than one element") + else -> throw IllegalArgumentException("Collection has more than one element.") } } /** - * Returns the single element matching the given [predicate], or throws exception if there is no or more than one matching element + * Returns the single element matching the given [predicate], or throws exception if there is no or more than one matching element. */ public inline fun Array.single(predicate: (T) -> Boolean): T { var single: T? = null var found = false for (element in this) { if (predicate(element)) { - if (found) throw IllegalArgumentException("Collection contains more than one matching element") + if (found) throw IllegalArgumentException("Collection contains more than one matching element.") single = element found = true } } - if (!found) throw NoSuchElementException("Collection doesn't contain any element matching predicate") + if (!found) throw NoSuchElementException("Collection doesn't contain any element matching predicate.") return single as T } /** - * Returns the single element matching the given [predicate], or throws exception if there is no or more than one matching element + * Returns the single element matching the given [predicate], or throws exception if there is no or more than one matching element. */ public inline fun BooleanArray.single(predicate: (Boolean) -> Boolean): Boolean { var single: Boolean? = null var found = false for (element in this) { if (predicate(element)) { - if (found) throw IllegalArgumentException("Collection contains more than one matching element") + if (found) throw IllegalArgumentException("Collection contains more than one matching element.") single = element found = true } } - if (!found) throw NoSuchElementException("Collection doesn't contain any element matching predicate") + if (!found) throw NoSuchElementException("Collection doesn't contain any element matching predicate.") return single as Boolean } /** - * Returns the single element matching the given [predicate], or throws exception if there is no or more than one matching element + * Returns the single element matching the given [predicate], or throws exception if there is no or more than one matching element. */ public inline fun ByteArray.single(predicate: (Byte) -> Boolean): Byte { var single: Byte? = null var found = false for (element in this) { if (predicate(element)) { - if (found) throw IllegalArgumentException("Collection contains more than one matching element") + if (found) throw IllegalArgumentException("Collection contains more than one matching element.") single = element found = true } } - if (!found) throw NoSuchElementException("Collection doesn't contain any element matching predicate") + if (!found) throw NoSuchElementException("Collection doesn't contain any element matching predicate.") return single as Byte } /** - * Returns the single element matching the given [predicate], or throws exception if there is no or more than one matching element + * Returns the single element matching the given [predicate], or throws exception if there is no or more than one matching element. */ public inline fun CharArray.single(predicate: (Char) -> Boolean): Char { var single: Char? = null var found = false for (element in this) { if (predicate(element)) { - if (found) throw IllegalArgumentException("Collection contains more than one matching element") + if (found) throw IllegalArgumentException("Collection contains more than one matching element.") single = element found = true } } - if (!found) throw NoSuchElementException("Collection doesn't contain any element matching predicate") + if (!found) throw NoSuchElementException("Collection doesn't contain any element matching predicate.") return single as Char } /** - * Returns the single element matching the given [predicate], or throws exception if there is no or more than one matching element + * Returns the single element matching the given [predicate], or throws exception if there is no or more than one matching element. */ public inline fun DoubleArray.single(predicate: (Double) -> Boolean): Double { var single: Double? = null var found = false for (element in this) { if (predicate(element)) { - if (found) throw IllegalArgumentException("Collection contains more than one matching element") + if (found) throw IllegalArgumentException("Collection contains more than one matching element.") single = element found = true } } - if (!found) throw NoSuchElementException("Collection doesn't contain any element matching predicate") + if (!found) throw NoSuchElementException("Collection doesn't contain any element matching predicate.") return single as Double } /** - * Returns the single element matching the given [predicate], or throws exception if there is no or more than one matching element + * Returns the single element matching the given [predicate], or throws exception if there is no or more than one matching element. */ public inline fun FloatArray.single(predicate: (Float) -> Boolean): Float { var single: Float? = null var found = false for (element in this) { if (predicate(element)) { - if (found) throw IllegalArgumentException("Collection contains more than one matching element") + if (found) throw IllegalArgumentException("Collection contains more than one matching element.") single = element found = true } } - if (!found) throw NoSuchElementException("Collection doesn't contain any element matching predicate") + if (!found) throw NoSuchElementException("Collection doesn't contain any element matching predicate.") return single as Float } /** - * Returns the single element matching the given [predicate], or throws exception if there is no or more than one matching element + * Returns the single element matching the given [predicate], or throws exception if there is no or more than one matching element. */ public inline fun IntArray.single(predicate: (Int) -> Boolean): Int { var single: Int? = null var found = false for (element in this) { if (predicate(element)) { - if (found) throw IllegalArgumentException("Collection contains more than one matching element") + if (found) throw IllegalArgumentException("Collection contains more than one matching element.") single = element found = true } } - if (!found) throw NoSuchElementException("Collection doesn't contain any element matching predicate") + if (!found) throw NoSuchElementException("Collection doesn't contain any element matching predicate.") return single as Int } /** - * Returns the single element matching the given [predicate], or throws exception if there is no or more than one matching element + * Returns the single element matching the given [predicate], or throws exception if there is no or more than one matching element. */ public inline fun LongArray.single(predicate: (Long) -> Boolean): Long { var single: Long? = null var found = false for (element in this) { if (predicate(element)) { - if (found) throw IllegalArgumentException("Collection contains more than one matching element") + if (found) throw IllegalArgumentException("Collection contains more than one matching element.") single = element found = true } } - if (!found) throw NoSuchElementException("Collection doesn't contain any element matching predicate") + if (!found) throw NoSuchElementException("Collection doesn't contain any element matching predicate.") return single as Long } /** - * Returns the single element matching the given [predicate], or throws exception if there is no or more than one matching element + * Returns the single element matching the given [predicate], or throws exception if there is no or more than one matching element. */ public inline fun ShortArray.single(predicate: (Short) -> Boolean): Short { var single: Short? = null var found = false for (element in this) { if (predicate(element)) { - if (found) throw IllegalArgumentException("Collection contains more than one matching element") + if (found) throw IllegalArgumentException("Collection contains more than one matching element.") single = element found = true } } - if (!found) throw NoSuchElementException("Collection doesn't contain any element matching predicate") + if (!found) throw NoSuchElementException("Collection doesn't contain any element matching predicate.") return single as Short } /** - * Returns the single element matching the given [predicate], or throws exception if there is no or more than one matching element + * Returns the single element matching the given [predicate], or throws exception if there is no or more than one matching element. */ public inline fun Iterable.single(predicate: (T) -> Boolean): T { var single: T? = null var found = false for (element in this) { if (predicate(element)) { - if (found) throw IllegalArgumentException("Collection contains more than one matching element") + if (found) throw IllegalArgumentException("Collection contains more than one matching element.") single = element found = true } } - if (!found) throw NoSuchElementException("Collection doesn't contain any element matching predicate") + if (!found) throw NoSuchElementException("Collection doesn't contain any element matching predicate.") return single as T } /** - * Returns the single element matching the given [predicate], or throws exception if there is no or more than one matching element + * Returns the single element matching the given [predicate], or throws exception if there is no or more than one matching element. */ public inline fun Sequence.single(predicate: (T) -> Boolean): T { var single: T? = null var found = false for (element in this) { if (predicate(element)) { - if (found) throw IllegalArgumentException("Collection contains more than one matching element") + if (found) throw IllegalArgumentException("Collection contains more than one matching element.") single = element found = true } } - if (!found) throw NoSuchElementException("Collection doesn't contain any element matching predicate") + if (!found) throw NoSuchElementException("Collection doesn't contain any element matching predicate.") return single as T } deprecated("Migrate to using Sequence and respective functions") /** - * Returns the single element matching the given [predicate], or throws exception if there is no or more than one matching element + * Returns the single element matching the given [predicate], or throws exception if there is no or more than one matching element. */ public inline fun Stream.single(predicate: (T) -> Boolean): T { var single: T? = null var found = false for (element in this) { if (predicate(element)) { - if (found) throw IllegalArgumentException("Collection contains more than one matching element") + if (found) throw IllegalArgumentException("Collection contains more than one matching element.") single = element found = true } } - if (!found) throw NoSuchElementException("Collection doesn't contain any element matching predicate") + if (!found) throw NoSuchElementException("Collection doesn't contain any element matching predicate.") return single as T } /** - * Returns the single character matching the given [predicate], or throws exception if there is no or more than one matching character + * Returns the single character matching the given [predicate], or throws exception if there is no or more than one matching character. */ public inline fun String.single(predicate: (Char) -> Boolean): Char { var single: Char? = null var found = false for (element in this) { if (predicate(element)) { - if (found) throw IllegalArgumentException("Collection contains more than one matching element") + if (found) throw IllegalArgumentException("Collection contains more than one matching element.") single = element found = true } } - if (!found) throw NoSuchElementException("Collection doesn't contain any element matching predicate") + if (!found) throw NoSuchElementException("Collection doesn't contain any element matching predicate.") return single as Char } @@ -3208,7 +3208,7 @@ public fun String.singleOrNull(): Char? { } /** - * Returns the single element matching the given [predicate], or `null` if element was not found or more than one element was found + * Returns the single element matching the given [predicate], or `null` if element was not found or more than one element was found. */ public inline fun Array.singleOrNull(predicate: (T) -> Boolean): T? { var single: T? = null @@ -3225,7 +3225,7 @@ public 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 + * Returns the single element matching the given [predicate], or `null` if element was not found or more than one element was found. */ public inline fun BooleanArray.singleOrNull(predicate: (Boolean) -> Boolean): Boolean? { var single: Boolean? = null @@ -3242,7 +3242,7 @@ public inline fun BooleanArray.singleOrNull(predicate: (Boolean) -> Boolean): Bo } /** - * Returns the single element matching the given [predicate], or `null` if element was not found or more than one element was found + * Returns the single element matching the given [predicate], or `null` if element was not found or more than one element was found. */ public inline fun ByteArray.singleOrNull(predicate: (Byte) -> Boolean): Byte? { var single: Byte? = null @@ -3259,7 +3259,7 @@ public 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 + * Returns the single element matching the given [predicate], or `null` if element was not found or more than one element was found. */ public inline fun CharArray.singleOrNull(predicate: (Char) -> Boolean): Char? { var single: Char? = null @@ -3276,7 +3276,7 @@ public inline fun CharArray.singleOrNull(predicate: (Char) -> Boolean): Char? { } /** - * Returns the single element matching the given [predicate], or `null` if element was not found or more than one element was found + * Returns the single element matching the given [predicate], or `null` if element was not found or more than one element was found. */ public inline fun DoubleArray.singleOrNull(predicate: (Double) -> Boolean): Double? { var single: Double? = null @@ -3293,7 +3293,7 @@ public inline fun DoubleArray.singleOrNull(predicate: (Double) -> Boolean): Doub } /** - * Returns the single element matching the given [predicate], or `null` if element was not found or more than one element was found + * Returns the single element matching the given [predicate], or `null` if element was not found or more than one element was found. */ public inline fun FloatArray.singleOrNull(predicate: (Float) -> Boolean): Float? { var single: Float? = null @@ -3310,7 +3310,7 @@ public 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 + * Returns the single element matching the given [predicate], or `null` if element was not found or more than one element was found. */ public inline fun IntArray.singleOrNull(predicate: (Int) -> Boolean): Int? { var single: Int? = null @@ -3327,7 +3327,7 @@ public 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 + * Returns the single element matching the given [predicate], or `null` if element was not found or more than one element was found. */ public inline fun LongArray.singleOrNull(predicate: (Long) -> Boolean): Long? { var single: Long? = null @@ -3344,7 +3344,7 @@ public 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 + * Returns the single element matching the given [predicate], or `null` if element was not found or more than one element was found. */ public inline fun ShortArray.singleOrNull(predicate: (Short) -> Boolean): Short? { var single: Short? = null @@ -3361,7 +3361,7 @@ public 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 + * Returns the single element matching the given [predicate], or `null` if element was not found or more than one element was found. */ public inline fun Iterable.singleOrNull(predicate: (T) -> Boolean): T? { var single: T? = null @@ -3378,7 +3378,7 @@ public inline fun Iterable.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 + * Returns the single element matching the given [predicate], or `null` if element was not found or more than one element was found. */ public inline fun Sequence.singleOrNull(predicate: (T) -> Boolean): T? { var single: T? = null @@ -3397,7 +3397,7 @@ public inline fun Sequence.singleOrNull(predicate: (T) -> Boolean): T? { deprecated("Migrate to using Sequence and respective functions") /** - * Returns the single element matching the given [predicate], or `null` if element was not found or more than one element was found + * Returns the single element matching the given [predicate], or `null` if element was not found or more than one element was found. */ public inline fun Stream.singleOrNull(predicate: (T) -> Boolean): T? { var single: T? = null @@ -3414,7 +3414,7 @@ public inline fun Stream.singleOrNull(predicate: (T) -> Boolean): T? { } /** - * Returns the single character matching the given [predicate], or `null` if character was not found or more than one character was found + * Returns the single character matching the given [predicate], or `null` if character was not found or more than one character was found. */ public inline fun String.singleOrNull(predicate: (Char) -> Boolean): Char? { var single: Char? = null diff --git a/libraries/stdlib/src/generated/_Filtering.kt b/libraries/stdlib/src/generated/_Filtering.kt index c5b716a7dc9..a3541f57557 100644 --- a/libraries/stdlib/src/generated/_Filtering.kt +++ b/libraries/stdlib/src/generated/_Filtering.kt @@ -11,7 +11,7 @@ import java.util.* import java.util.Collections // TODO: it's temporary while we have java.util.Collections in js /** - * Returns a list containing all elements except first [n] elements + * Returns a list containing all elements except first [n] elements. */ public fun Array.drop(n: Int): List { require(n >= 0, { "Requested element count $n is less than zero." }) @@ -25,7 +25,7 @@ public fun Array.drop(n: Int): List { } /** - * Returns a list containing all elements except first [n] elements + * Returns a list containing all elements except first [n] elements. */ public fun BooleanArray.drop(n: Int): List { require(n >= 0, { "Requested element count $n is less than zero." }) @@ -39,7 +39,7 @@ public fun BooleanArray.drop(n: Int): List { } /** - * Returns a list containing all elements except first [n] elements + * Returns a list containing all elements except first [n] elements. */ public fun ByteArray.drop(n: Int): List { require(n >= 0, { "Requested element count $n is less than zero." }) @@ -53,7 +53,7 @@ public fun ByteArray.drop(n: Int): List { } /** - * Returns a list containing all elements except first [n] elements + * Returns a list containing all elements except first [n] elements. */ public fun CharArray.drop(n: Int): List { require(n >= 0, { "Requested element count $n is less than zero." }) @@ -67,7 +67,7 @@ public fun CharArray.drop(n: Int): List { } /** - * Returns a list containing all elements except first [n] elements + * Returns a list containing all elements except first [n] elements. */ public fun DoubleArray.drop(n: Int): List { require(n >= 0, { "Requested element count $n is less than zero." }) @@ -81,7 +81,7 @@ public fun DoubleArray.drop(n: Int): List { } /** - * Returns a list containing all elements except first [n] elements + * Returns a list containing all elements except first [n] elements. */ public fun FloatArray.drop(n: Int): List { require(n >= 0, { "Requested element count $n is less than zero." }) @@ -95,7 +95,7 @@ public fun FloatArray.drop(n: Int): List { } /** - * Returns a list containing all elements except first [n] elements + * Returns a list containing all elements except first [n] elements. */ public fun IntArray.drop(n: Int): List { require(n >= 0, { "Requested element count $n is less than zero." }) @@ -109,7 +109,7 @@ public fun IntArray.drop(n: Int): List { } /** - * Returns a list containing all elements except first [n] elements + * Returns a list containing all elements except first [n] elements. */ public fun LongArray.drop(n: Int): List { require(n >= 0, { "Requested element count $n is less than zero." }) @@ -123,7 +123,7 @@ public fun LongArray.drop(n: Int): List { } /** - * Returns a list containing all elements except first [n] elements + * Returns a list containing all elements except first [n] elements. */ public fun ShortArray.drop(n: Int): List { require(n >= 0, { "Requested element count $n is less than zero." }) @@ -137,7 +137,7 @@ public fun ShortArray.drop(n: Int): List { } /** - * Returns a list containing all elements except first [n] elements + * Returns a list containing all elements except first [n] elements. */ public fun Iterable.drop(n: Int): List { require(n >= 0, { "Requested element count $n is less than zero." }) @@ -165,7 +165,7 @@ public fun Iterable.drop(n: Int): List { } /** - * Returns a sequence containing all elements except first [n] elements + * Returns a sequence containing all elements except first [n] elements. */ public fun Sequence.drop(n: Int): Sequence { require(n >= 0, { "Requested element count $n is less than zero." }) @@ -175,7 +175,7 @@ public fun Sequence.drop(n: Int): Sequence { deprecated("Migrate to using Sequence and respective functions") /** - * Returns a stream containing all elements except first [n] elements + * Returns a stream containing all elements except first [n] elements. */ public fun Stream.drop(n: Int): Stream { require(n >= 0, { "Requested element count $n is less than zero." }) @@ -183,14 +183,14 @@ public fun Stream.drop(n: Int): Stream { } /** - * Returns a string with the first [n] characters removed + * Returns a string with the first [n] characters removed. */ public fun String.drop(n: Int): String { return substring(Math.min(n, length())) } /** - * Returns a list containing all elements except first elements that satisfy the given [predicate] + * Returns a list containing all elements except first elements that satisfy the given [predicate]. */ public inline fun Array.dropWhile(predicate: (T) -> Boolean): List { var yielding = false @@ -206,7 +206,7 @@ public inline fun Array.dropWhile(predicate: (T) -> Boolean): List } /** - * Returns a list containing all elements except first elements that satisfy the given [predicate] + * Returns a list containing all elements except first elements that satisfy the given [predicate]. */ public inline fun BooleanArray.dropWhile(predicate: (Boolean) -> Boolean): List { var yielding = false @@ -222,7 +222,7 @@ public inline fun BooleanArray.dropWhile(predicate: (Boolean) -> Boolean): List< } /** - * Returns a list containing all elements except first elements that satisfy the given [predicate] + * Returns a list containing all elements except first elements that satisfy the given [predicate]. */ public inline fun ByteArray.dropWhile(predicate: (Byte) -> Boolean): List { var yielding = false @@ -238,7 +238,7 @@ public inline fun ByteArray.dropWhile(predicate: (Byte) -> Boolean): List } /** - * Returns a list containing all elements except first elements that satisfy the given [predicate] + * Returns a list containing all elements except first elements that satisfy the given [predicate]. */ public inline fun CharArray.dropWhile(predicate: (Char) -> Boolean): List { var yielding = false @@ -254,7 +254,7 @@ public inline fun CharArray.dropWhile(predicate: (Char) -> Boolean): List } /** - * Returns a list containing all elements except first elements that satisfy the given [predicate] + * Returns a list containing all elements except first elements that satisfy the given [predicate]. */ public inline fun DoubleArray.dropWhile(predicate: (Double) -> Boolean): List { var yielding = false @@ -270,7 +270,7 @@ public inline fun DoubleArray.dropWhile(predicate: (Double) -> Boolean): List Boolean): List { var yielding = false @@ -286,7 +286,7 @@ public inline fun FloatArray.dropWhile(predicate: (Float) -> Boolean): List Boolean): List { var yielding = false @@ -302,7 +302,7 @@ public inline fun IntArray.dropWhile(predicate: (Int) -> Boolean): List { } /** - * Returns a list containing all elements except first elements that satisfy the given [predicate] + * Returns a list containing all elements except first elements that satisfy the given [predicate]. */ public inline fun LongArray.dropWhile(predicate: (Long) -> Boolean): List { var yielding = false @@ -318,7 +318,7 @@ public inline fun LongArray.dropWhile(predicate: (Long) -> Boolean): List } /** - * Returns a list containing all elements except first elements that satisfy the given [predicate] + * Returns a list containing all elements except first elements that satisfy the given [predicate]. */ public inline fun ShortArray.dropWhile(predicate: (Short) -> Boolean): List { var yielding = false @@ -334,7 +334,7 @@ public inline fun ShortArray.dropWhile(predicate: (Short) -> Boolean): List Iterable.dropWhile(predicate: (T) -> Boolean): List { var yielding = false @@ -350,7 +350,7 @@ public inline fun Iterable.dropWhile(predicate: (T) -> Boolean): List } /** - * Returns a sequence containing all elements except first elements that satisfy the given [predicate] + * Returns a sequence containing all elements except first elements that satisfy the given [predicate]. */ public fun Sequence.dropWhile(predicate: (T) -> Boolean): Sequence { return DropWhileSequence(this, predicate) @@ -359,14 +359,14 @@ public fun Sequence.dropWhile(predicate: (T) -> Boolean): Sequence { deprecated("Migrate to using Sequence and respective functions") /** - * Returns a stream containing all elements except first elements that satisfy the given [predicate] + * Returns a stream containing all elements except first elements that satisfy the given [predicate]. */ public fun Stream.dropWhile(predicate: (T) -> Boolean): Stream { return DropWhileStream(this, predicate) } /** - * Returns a string containing all characters except first characters that satisfy the given [predicate] + * Returns a string containing all characters except first characters that satisfy the given [predicate]. */ public inline fun String.dropWhile(predicate: (Char) -> Boolean): String { for (index in 0..length - 1) @@ -377,77 +377,77 @@ public inline fun String.dropWhile(predicate: (Char) -> Boolean): String { } /** - * Returns a list containing all elements matching the given [predicate] + * Returns a list containing all elements matching the given [predicate]. */ public inline fun Array.filter(predicate: (T) -> Boolean): List { return filterTo(ArrayList(), predicate) } /** - * Returns a list containing all elements matching the given [predicate] + * Returns a list containing all elements matching the given [predicate]. */ public inline fun BooleanArray.filter(predicate: (Boolean) -> Boolean): List { return filterTo(ArrayList(), predicate) } /** - * Returns a list containing all elements matching the given [predicate] + * Returns a list containing all elements matching the given [predicate]. */ public inline fun ByteArray.filter(predicate: (Byte) -> Boolean): List { return filterTo(ArrayList(), predicate) } /** - * Returns a list containing all elements matching the given [predicate] + * Returns a list containing all elements matching the given [predicate]. */ public inline fun CharArray.filter(predicate: (Char) -> Boolean): List { return filterTo(ArrayList(), predicate) } /** - * Returns a list containing all elements matching the given [predicate] + * Returns a list containing all elements matching the given [predicate]. */ public inline fun DoubleArray.filter(predicate: (Double) -> Boolean): List { return filterTo(ArrayList(), predicate) } /** - * Returns a list containing all elements matching the given [predicate] + * Returns a list containing all elements matching the given [predicate]. */ public inline fun FloatArray.filter(predicate: (Float) -> Boolean): List { return filterTo(ArrayList(), predicate) } /** - * Returns a list containing all elements matching the given [predicate] + * Returns a list containing all elements matching the given [predicate]. */ public inline fun IntArray.filter(predicate: (Int) -> Boolean): List { return filterTo(ArrayList(), predicate) } /** - * Returns a list containing all elements matching the given [predicate] + * Returns a list containing all elements matching the given [predicate]. */ public inline fun LongArray.filter(predicate: (Long) -> Boolean): List { return filterTo(ArrayList(), predicate) } /** - * Returns a list containing all elements matching the given [predicate] + * Returns a list containing all elements matching the given [predicate]. */ public inline fun ShortArray.filter(predicate: (Short) -> Boolean): List { return filterTo(ArrayList(), predicate) } /** - * Returns a list containing all elements matching the given [predicate] + * Returns a list containing all elements matching the given [predicate]. */ public inline fun Iterable.filter(predicate: (T) -> Boolean): List { return filterTo(ArrayList(), predicate) } /** - * Returns a sequence containing all elements matching the given [predicate] + * Returns a sequence containing all elements matching the given [predicate]. */ public fun Sequence.filter(predicate: (T) -> Boolean): Sequence { return FilteringSequence(this, true, predicate) @@ -456,91 +456,91 @@ public fun Sequence.filter(predicate: (T) -> Boolean): Sequence { deprecated("Migrate to using Sequence and respective functions") /** - * Returns a stream containing all elements matching the given [predicate] + * Returns a stream containing all elements matching the given [predicate]. */ public fun Stream.filter(predicate: (T) -> Boolean): Stream { return FilteringStream(this, true, predicate) } /** - * Returns a string containing only those characters from the original string that match the given [predicate] + * Returns a string containing only those characters from the original string that match the given [predicate]. */ public inline fun String.filter(predicate: (Char) -> Boolean): String { return filterTo(StringBuilder(), predicate).toString() } /** - * Returns a list containing all elements not matching the given [predicate] + * Returns a list containing all elements not matching the given [predicate]. */ public inline fun Array.filterNot(predicate: (T) -> Boolean): List { return filterNotTo(ArrayList(), predicate) } /** - * Returns a list containing all elements not matching the given [predicate] + * Returns a list containing all elements not matching the given [predicate]. */ public inline fun BooleanArray.filterNot(predicate: (Boolean) -> Boolean): List { return filterNotTo(ArrayList(), predicate) } /** - * Returns a list containing all elements not matching the given [predicate] + * Returns a list containing all elements not matching the given [predicate]. */ public inline fun ByteArray.filterNot(predicate: (Byte) -> Boolean): List { return filterNotTo(ArrayList(), predicate) } /** - * Returns a list containing all elements not matching the given [predicate] + * Returns a list containing all elements not matching the given [predicate]. */ public inline fun CharArray.filterNot(predicate: (Char) -> Boolean): List { return filterNotTo(ArrayList(), predicate) } /** - * Returns a list containing all elements not matching the given [predicate] + * Returns a list containing all elements not matching the given [predicate]. */ public inline fun DoubleArray.filterNot(predicate: (Double) -> Boolean): List { return filterNotTo(ArrayList(), predicate) } /** - * Returns a list containing all elements not matching the given [predicate] + * Returns a list containing all elements not matching the given [predicate]. */ public inline fun FloatArray.filterNot(predicate: (Float) -> Boolean): List { return filterNotTo(ArrayList(), predicate) } /** - * Returns a list containing all elements not matching the given [predicate] + * Returns a list containing all elements not matching the given [predicate]. */ public inline fun IntArray.filterNot(predicate: (Int) -> Boolean): List { return filterNotTo(ArrayList(), predicate) } /** - * Returns a list containing all elements not matching the given [predicate] + * Returns a list containing all elements not matching the given [predicate]. */ public inline fun LongArray.filterNot(predicate: (Long) -> Boolean): List { return filterNotTo(ArrayList(), predicate) } /** - * Returns a list containing all elements not matching the given [predicate] + * Returns a list containing all elements not matching the given [predicate]. */ public inline fun ShortArray.filterNot(predicate: (Short) -> Boolean): List { return filterNotTo(ArrayList(), predicate) } /** - * Returns a list containing all elements not matching the given [predicate] + * Returns a list containing all elements not matching the given [predicate]. */ public inline fun Iterable.filterNot(predicate: (T) -> Boolean): List { return filterNotTo(ArrayList(), predicate) } /** - * Returns a sequence containing all elements not matching the given [predicate] + * Returns a sequence containing all elements not matching the given [predicate]. */ public fun Sequence.filterNot(predicate: (T) -> Boolean): Sequence { return FilteringSequence(this, false, predicate) @@ -549,35 +549,35 @@ public fun Sequence.filterNot(predicate: (T) -> Boolean): Sequence { deprecated("Migrate to using Sequence and respective functions") /** - * Returns a stream containing all elements not matching the given [predicate] + * Returns a stream containing all elements not matching the given [predicate]. */ public fun Stream.filterNot(predicate: (T) -> Boolean): Stream { return FilteringStream(this, false, predicate) } /** - * Returns a string containing only those characters from the original string that do not match the given [predicate] + * Returns a string containing only those characters from the original string that do not match the given [predicate]. */ public inline fun String.filterNot(predicate: (Char) -> Boolean): String { return filterNotTo(StringBuilder(), predicate).toString() } /** - * Returns a list containing all elements that are not null + * Returns a list containing all elements that are not `null`. */ public fun Array.filterNotNull(): List { return filterNotNullTo(ArrayList()) } /** - * Returns a list containing all elements that are not null + * Returns a list containing all elements that are not `null`. */ public fun Iterable.filterNotNull(): List { return filterNotNullTo(ArrayList()) } /** - * Returns a sequence containing all elements that are not null + * Returns a sequence containing all elements that are not `null`. */ public fun Sequence.filterNotNull(): Sequence { return filterNot { it == null } as Sequence @@ -586,14 +586,14 @@ public fun Sequence.filterNotNull(): Sequence { deprecated("Migrate to using Sequence and respective functions") /** - * Returns a stream containing all elements that are not null + * Returns a stream containing all elements that are not `null`. */ public fun Stream.filterNotNull(): Stream { return filterNot { it == null } as Stream } /** - * Appends all elements that are not null to the given [destination] + * Appends all elements that are not `null` to the given [destination]. */ public fun , T : Any> Array.filterNotNullTo(destination: C): C { for (element in this) if (element != null) destination.add(element) @@ -601,7 +601,7 @@ public fun , T : Any> Array.filterNotNullTo( } /** - * Appends all elements that are not null to the given [destination] + * Appends all elements that are not `null` to the given [destination]. */ public fun , T : Any> Iterable.filterNotNullTo(destination: C): C { for (element in this) if (element != null) destination.add(element) @@ -609,7 +609,7 @@ public fun , T : Any> Iterable.filterNotNullTo(d } /** - * Appends all elements that are not null to the given [destination] + * Appends all elements that are not `null` to the given [destination]. */ public fun , T : Any> Sequence.filterNotNullTo(destination: C): C { for (element in this) if (element != null) destination.add(element) @@ -619,7 +619,7 @@ public fun , T : Any> Sequence.filterNotNullTo(d deprecated("Migrate to using Sequence and respective functions") /** - * Appends all elements that are not null to the given [destination] + * Appends all elements that are not `null` to the given [destination]. */ public fun , T : Any> Stream.filterNotNullTo(destination: C): C { for (element in this) if (element != null) destination.add(element) @@ -627,7 +627,7 @@ public fun , T : Any> Stream.filterNotNullTo(des } /** - * Appends all elements not matching the given [predicate] to the given [destination] + * Appends all elements not matching the given [predicate] to the given [destination]. */ public inline fun > Array.filterNotTo(destination: C, predicate: (T) -> Boolean): C { for (element in this) if (!predicate(element)) destination.add(element) @@ -635,7 +635,7 @@ public inline fun > Array.filterNotTo(dest } /** - * Appends all elements not matching the given [predicate] to the given [destination] + * Appends all elements not matching the given [predicate] to the given [destination]. */ public inline fun > BooleanArray.filterNotTo(destination: C, predicate: (Boolean) -> Boolean): C { for (element in this) if (!predicate(element)) destination.add(element) @@ -643,7 +643,7 @@ public inline fun > BooleanArray.filterNotTo(d } /** - * Appends all elements not matching the given [predicate] to the given [destination] + * Appends all elements not matching the given [predicate] to the given [destination]. */ public inline fun > ByteArray.filterNotTo(destination: C, predicate: (Byte) -> Boolean): C { for (element in this) if (!predicate(element)) destination.add(element) @@ -651,7 +651,7 @@ public inline fun > ByteArray.filterNotTo(destina } /** - * Appends all elements not matching the given [predicate] to the given [destination] + * Appends all elements not matching the given [predicate] to the given [destination]. */ public inline fun > CharArray.filterNotTo(destination: C, predicate: (Char) -> Boolean): C { for (element in this) if (!predicate(element)) destination.add(element) @@ -659,7 +659,7 @@ public inline fun > CharArray.filterNotTo(destina } /** - * Appends all elements not matching the given [predicate] to the given [destination] + * Appends all elements not matching the given [predicate] to the given [destination]. */ public inline fun > DoubleArray.filterNotTo(destination: C, predicate: (Double) -> Boolean): C { for (element in this) if (!predicate(element)) destination.add(element) @@ -667,7 +667,7 @@ public inline fun > DoubleArray.filterNotTo(des } /** - * Appends all elements not matching the given [predicate] to the given [destination] + * Appends all elements not matching the given [predicate] to the given [destination]. */ public inline fun > FloatArray.filterNotTo(destination: C, predicate: (Float) -> Boolean): C { for (element in this) if (!predicate(element)) destination.add(element) @@ -675,7 +675,7 @@ public inline fun > FloatArray.filterNotTo(desti } /** - * Appends all elements not matching the given [predicate] to the given [destination] + * Appends all elements not matching the given [predicate] to the given [destination]. */ public inline fun > IntArray.filterNotTo(destination: C, predicate: (Int) -> Boolean): C { for (element in this) if (!predicate(element)) destination.add(element) @@ -683,7 +683,7 @@ public inline fun > IntArray.filterNotTo(destinati } /** - * Appends all elements not matching the given [predicate] to the given [destination] + * Appends all elements not matching the given [predicate] to the given [destination]. */ public inline fun > LongArray.filterNotTo(destination: C, predicate: (Long) -> Boolean): C { for (element in this) if (!predicate(element)) destination.add(element) @@ -691,7 +691,7 @@ public inline fun > LongArray.filterNotTo(destina } /** - * Appends all elements not matching the given [predicate] to the given [destination] + * Appends all elements not matching the given [predicate] to the given [destination]. */ public inline fun > ShortArray.filterNotTo(destination: C, predicate: (Short) -> Boolean): C { for (element in this) if (!predicate(element)) destination.add(element) @@ -699,7 +699,7 @@ public inline fun > ShortArray.filterNotTo(desti } /** - * Appends all elements not matching the given [predicate] to the given [destination] + * Appends all elements not matching the given [predicate] to the given [destination]. */ public inline fun > Iterable.filterNotTo(destination: C, predicate: (T) -> Boolean): C { for (element in this) if (!predicate(element)) destination.add(element) @@ -707,7 +707,7 @@ public inline fun > Iterable.filterNotTo(desti } /** - * Appends all elements not matching the given [predicate] to the given [destination] + * Appends all elements not matching the given [predicate] to the given [destination]. */ public inline fun > Sequence.filterNotTo(destination: C, predicate: (T) -> Boolean): C { for (element in this) if (!predicate(element)) destination.add(element) @@ -717,7 +717,7 @@ public inline fun > Sequence.filterNotTo(desti deprecated("Migrate to using Sequence and respective functions") /** - * Appends all elements not matching the given [predicate] to the given [destination] + * Appends all elements not matching the given [predicate] to the given [destination]. */ public inline fun > Stream.filterNotTo(destination: C, predicate: (T) -> Boolean): C { for (element in this) if (!predicate(element)) destination.add(element) @@ -725,7 +725,7 @@ public inline fun > Stream.filterNotTo(destina } /** - * Appends all characters not matching the given [predicate] to the given [destination] + * Appends all characters not matching the given [predicate] to the given [destination]. */ public inline fun String.filterNotTo(destination: C, predicate: (Char) -> Boolean): C { for (element in this) if (!predicate(element)) destination.append(element) @@ -733,7 +733,7 @@ public inline fun String.filterNotTo(destination: C, predicate: } /** - * Appends all elements matching the given [predicate] into the given [destination] + * Appends all elements matching the given [predicate] into the given [destination]. */ public inline fun > Array.filterTo(destination: C, predicate: (T) -> Boolean): C { for (element in this) if (predicate(element)) destination.add(element) @@ -741,7 +741,7 @@ public inline fun > Array.filterTo(destina } /** - * Appends all elements matching the given [predicate] into the given [destination] + * Appends all elements matching the given [predicate] into the given [destination]. */ public inline fun > BooleanArray.filterTo(destination: C, predicate: (Boolean) -> Boolean): C { for (element in this) if (predicate(element)) destination.add(element) @@ -749,7 +749,7 @@ public inline fun > BooleanArray.filterTo(dest } /** - * Appends all elements matching the given [predicate] into the given [destination] + * Appends all elements matching the given [predicate] into the given [destination]. */ public inline fun > ByteArray.filterTo(destination: C, predicate: (Byte) -> Boolean): C { for (element in this) if (predicate(element)) destination.add(element) @@ -757,7 +757,7 @@ public inline fun > ByteArray.filterTo(destinatio } /** - * Appends all elements matching the given [predicate] into the given [destination] + * Appends all elements matching the given [predicate] into the given [destination]. */ public inline fun > CharArray.filterTo(destination: C, predicate: (Char) -> Boolean): C { for (element in this) if (predicate(element)) destination.add(element) @@ -765,7 +765,7 @@ public inline fun > CharArray.filterTo(destinatio } /** - * Appends all elements matching the given [predicate] into the given [destination] + * Appends all elements matching the given [predicate] into the given [destination]. */ public inline fun > DoubleArray.filterTo(destination: C, predicate: (Double) -> Boolean): C { for (element in this) if (predicate(element)) destination.add(element) @@ -773,7 +773,7 @@ public inline fun > DoubleArray.filterTo(destin } /** - * Appends all elements matching the given [predicate] into the given [destination] + * Appends all elements matching the given [predicate] into the given [destination]. */ public inline fun > FloatArray.filterTo(destination: C, predicate: (Float) -> Boolean): C { for (element in this) if (predicate(element)) destination.add(element) @@ -781,7 +781,7 @@ public inline fun > FloatArray.filterTo(destinat } /** - * Appends all elements matching the given [predicate] into the given [destination] + * Appends all elements matching the given [predicate] into the given [destination]. */ public inline fun > IntArray.filterTo(destination: C, predicate: (Int) -> Boolean): C { for (element in this) if (predicate(element)) destination.add(element) @@ -789,7 +789,7 @@ public inline fun > IntArray.filterTo(destination: } /** - * Appends all elements matching the given [predicate] into the given [destination] + * Appends all elements matching the given [predicate] into the given [destination]. */ public inline fun > LongArray.filterTo(destination: C, predicate: (Long) -> Boolean): C { for (element in this) if (predicate(element)) destination.add(element) @@ -797,7 +797,7 @@ public inline fun > LongArray.filterTo(destinatio } /** - * Appends all elements matching the given [predicate] into the given [destination] + * Appends all elements matching the given [predicate] into the given [destination]. */ public inline fun > ShortArray.filterTo(destination: C, predicate: (Short) -> Boolean): C { for (element in this) if (predicate(element)) destination.add(element) @@ -805,7 +805,7 @@ public inline fun > ShortArray.filterTo(destinat } /** - * Appends all elements matching the given [predicate] into the given [destination] + * Appends all elements matching the given [predicate] into the given [destination]. */ public inline fun > Iterable.filterTo(destination: C, predicate: (T) -> Boolean): C { for (element in this) if (predicate(element)) destination.add(element) @@ -813,7 +813,7 @@ public inline fun > Iterable.filterTo(destinat } /** - * Appends all elements matching the given [predicate] into the given [destination] + * Appends all elements matching the given [predicate] into the given [destination]. */ public inline fun > Sequence.filterTo(destination: C, predicate: (T) -> Boolean): C { for (element in this) if (predicate(element)) destination.add(element) @@ -823,7 +823,7 @@ public inline fun > Sequence.filterTo(destinat deprecated("Migrate to using Sequence and respective functions") /** - * Appends all elements matching the given [predicate] into the given [destination] + * Appends all elements matching the given [predicate] into the given [destination]. */ public inline fun > Stream.filterTo(destination: C, predicate: (T) -> Boolean): C { for (element in this) if (predicate(element)) destination.add(element) @@ -831,7 +831,7 @@ public inline fun > Stream.filterTo(destinatio } /** - * Appends all characters matching the given [predicate] to the given [destination] + * Appends all characters matching the given [predicate] to the given [destination]. */ public inline fun String.filterTo(destination: C, predicate: (Char) -> Boolean): C { for (index in 0..length - 1) { @@ -842,7 +842,7 @@ public inline fun String.filterTo(destination: C, predicate: (C } /** - * Returns a list containing elements at specified positions + * Returns a list containing elements at specified [indices]. */ public fun Array.slice(indices: Iterable): List { val list = ArrayList(indices.collectionSizeOrDefault(10)) @@ -853,7 +853,7 @@ public fun Array.slice(indices: Iterable): List { } /** - * Returns a list containing elements at specified positions + * Returns a list containing elements at specified [indices]. */ public fun BooleanArray.slice(indices: Iterable): List { val list = ArrayList(indices.collectionSizeOrDefault(10)) @@ -864,7 +864,7 @@ public fun BooleanArray.slice(indices: Iterable): List { } /** - * Returns a list containing elements at specified positions + * Returns a list containing elements at specified [indices]. */ public fun ByteArray.slice(indices: Iterable): List { val list = ArrayList(indices.collectionSizeOrDefault(10)) @@ -875,7 +875,7 @@ public fun ByteArray.slice(indices: Iterable): List { } /** - * Returns a list containing elements at specified positions + * Returns a list containing elements at specified [indices]. */ public fun CharArray.slice(indices: Iterable): List { val list = ArrayList(indices.collectionSizeOrDefault(10)) @@ -886,7 +886,7 @@ public fun CharArray.slice(indices: Iterable): List { } /** - * Returns a list containing elements at specified positions + * Returns a list containing elements at specified [indices]. */ public fun DoubleArray.slice(indices: Iterable): List { val list = ArrayList(indices.collectionSizeOrDefault(10)) @@ -897,7 +897,7 @@ public fun DoubleArray.slice(indices: Iterable): List { } /** - * Returns a list containing elements at specified positions + * Returns a list containing elements at specified [indices]. */ public fun FloatArray.slice(indices: Iterable): List { val list = ArrayList(indices.collectionSizeOrDefault(10)) @@ -908,7 +908,7 @@ public fun FloatArray.slice(indices: Iterable): List { } /** - * Returns a list containing elements at specified positions + * Returns a list containing elements at specified [indices]. */ public fun IntArray.slice(indices: Iterable): List { val list = ArrayList(indices.collectionSizeOrDefault(10)) @@ -919,7 +919,7 @@ public fun IntArray.slice(indices: Iterable): List { } /** - * Returns a list containing elements at specified positions + * Returns a list containing elements at specified [indices]. */ public fun LongArray.slice(indices: Iterable): List { val list = ArrayList(indices.collectionSizeOrDefault(10)) @@ -930,7 +930,7 @@ public fun LongArray.slice(indices: Iterable): List { } /** - * Returns a list containing elements at specified positions + * Returns a list containing elements at specified [indices]. */ public fun ShortArray.slice(indices: Iterable): List { val list = ArrayList(indices.collectionSizeOrDefault(10)) @@ -941,7 +941,7 @@ public fun ShortArray.slice(indices: Iterable): List { } /** - * Returns a list containing elements at specified positions + * Returns a list containing elements at specified [indices]. */ public fun List.slice(indices: Iterable): List { val list = ArrayList(indices.collectionSizeOrDefault(10)) @@ -952,7 +952,7 @@ public fun List.slice(indices: Iterable): List { } /** - * Returns a string containing characters at specified positions + * Returns a string containing characters at specified [indices]. */ public fun String.slice(indices: Iterable): String { val result = StringBuilder(indices.collectionSizeOrDefault(10)) @@ -963,7 +963,7 @@ public fun String.slice(indices: Iterable): String { } /** - * Returns a list containing first [n] elements + * Returns a list containing first [n] elements. */ public fun Array.take(n: Int): List { require(n >= 0, "Requested element count $n is less than zero.") @@ -979,7 +979,7 @@ public fun Array.take(n: Int): List { } /** - * Returns a list containing first [n] elements + * Returns a list containing first [n] elements. */ public fun BooleanArray.take(n: Int): List { require(n >= 0, "Requested element count $n is less than zero.") @@ -995,7 +995,7 @@ public fun BooleanArray.take(n: Int): List { } /** - * Returns a list containing first [n] elements + * Returns a list containing first [n] elements. */ public fun ByteArray.take(n: Int): List { require(n >= 0, "Requested element count $n is less than zero.") @@ -1011,7 +1011,7 @@ public fun ByteArray.take(n: Int): List { } /** - * Returns a list containing first [n] elements + * Returns a list containing first [n] elements. */ public fun CharArray.take(n: Int): List { require(n >= 0, "Requested element count $n is less than zero.") @@ -1027,7 +1027,7 @@ public fun CharArray.take(n: Int): List { } /** - * Returns a list containing first [n] elements + * Returns a list containing first [n] elements. */ public fun DoubleArray.take(n: Int): List { require(n >= 0, "Requested element count $n is less than zero.") @@ -1043,7 +1043,7 @@ public fun DoubleArray.take(n: Int): List { } /** - * Returns a list containing first [n] elements + * Returns a list containing first [n] elements. */ public fun FloatArray.take(n: Int): List { require(n >= 0, "Requested element count $n is less than zero.") @@ -1059,7 +1059,7 @@ public fun FloatArray.take(n: Int): List { } /** - * Returns a list containing first [n] elements + * Returns a list containing first [n] elements. */ public fun IntArray.take(n: Int): List { require(n >= 0, "Requested element count $n is less than zero.") @@ -1075,7 +1075,7 @@ public fun IntArray.take(n: Int): List { } /** - * Returns a list containing first [n] elements + * Returns a list containing first [n] elements. */ public fun LongArray.take(n: Int): List { require(n >= 0, "Requested element count $n is less than zero.") @@ -1091,7 +1091,7 @@ public fun LongArray.take(n: Int): List { } /** - * Returns a list containing first [n] elements + * Returns a list containing first [n] elements. */ public fun ShortArray.take(n: Int): List { require(n >= 0, "Requested element count $n is less than zero.") @@ -1107,7 +1107,7 @@ public fun ShortArray.take(n: Int): List { } /** - * Returns a list containing first [n] elements + * Returns a list containing first [n] elements. */ public fun Iterable.take(n: Int): List { require(n >= 0, { "Requested element count $n is less than zero." }) @@ -1122,7 +1122,7 @@ public fun Iterable.take(n: Int): List { } /** - * Returns a sequence containing first *n* elements + * Returns a sequence containing first [n] elements. */ public fun Sequence.take(n: Int): Sequence { require(n >= 0, { "Requested element count $n is less than zero." }) @@ -1132,7 +1132,7 @@ public fun Sequence.take(n: Int): Sequence { deprecated("Migrate to using Sequence and respective functions") /** - * Returns a stream containing first *n* elements + * Returns a stream containing first [n] elements. */ public fun Stream.take(n: Int): Stream { require(n >= 0, { "Requested element count $n is less than zero." }) @@ -1140,7 +1140,7 @@ public fun Stream.take(n: Int): Stream { } /** - * Returns a string containing the first [n] characters from this string, or the entire string if this string is shorter + * Returns a string containing the first [n] characters from this string, or the entire string if this string is shorter. */ public fun String.take(n: Int): String { require(n >= 0, { "Requested element count $n is less than zero." }) @@ -1148,7 +1148,7 @@ public fun String.take(n: Int): String { } /** - * Returns a list containing last [n] elements + * Returns a list containing last [n] elements. */ public fun Array.takeLast(n: Int): List { require(n >= 0, { "Requested element count $n is less than zero." }) @@ -1161,7 +1161,7 @@ public fun Array.takeLast(n: Int): List { } /** - * Returns a list containing last [n] elements + * Returns a list containing last [n] elements. */ public fun BooleanArray.takeLast(n: Int): List { require(n >= 0, { "Requested element count $n is less than zero." }) @@ -1174,7 +1174,7 @@ public fun BooleanArray.takeLast(n: Int): List { } /** - * Returns a list containing last [n] elements + * Returns a list containing last [n] elements. */ public fun ByteArray.takeLast(n: Int): List { require(n >= 0, { "Requested element count $n is less than zero." }) @@ -1187,7 +1187,7 @@ public fun ByteArray.takeLast(n: Int): List { } /** - * Returns a list containing last [n] elements + * Returns a list containing last [n] elements. */ public fun CharArray.takeLast(n: Int): List { require(n >= 0, { "Requested element count $n is less than zero." }) @@ -1200,7 +1200,7 @@ public fun CharArray.takeLast(n: Int): List { } /** - * Returns a list containing last [n] elements + * Returns a list containing last [n] elements. */ public fun DoubleArray.takeLast(n: Int): List { require(n >= 0, { "Requested element count $n is less than zero." }) @@ -1213,7 +1213,7 @@ public fun DoubleArray.takeLast(n: Int): List { } /** - * Returns a list containing last [n] elements + * Returns a list containing last [n] elements. */ public fun FloatArray.takeLast(n: Int): List { require(n >= 0, { "Requested element count $n is less than zero." }) @@ -1226,7 +1226,7 @@ public fun FloatArray.takeLast(n: Int): List { } /** - * Returns a list containing last [n] elements + * Returns a list containing last [n] elements. */ public fun IntArray.takeLast(n: Int): List { require(n >= 0, { "Requested element count $n is less than zero." }) @@ -1239,7 +1239,7 @@ public fun IntArray.takeLast(n: Int): List { } /** - * Returns a list containing last [n] elements + * Returns a list containing last [n] elements. */ public fun LongArray.takeLast(n: Int): List { require(n >= 0, { "Requested element count $n is less than zero." }) @@ -1252,7 +1252,7 @@ public fun LongArray.takeLast(n: Int): List { } /** - * Returns a list containing last [n] elements + * Returns a list containing last [n] elements. */ public fun ShortArray.takeLast(n: Int): List { require(n >= 0, { "Requested element count $n is less than zero." }) @@ -1265,7 +1265,7 @@ public fun ShortArray.takeLast(n: Int): List { } /** - * Returns a list containing last [n] elements + * Returns a list containing last [n] elements. */ public fun List.takeLast(n: Int): List { require(n >= 0, { "Requested element count $n is less than zero." }) @@ -1278,7 +1278,7 @@ public fun List.takeLast(n: Int): List { } /** - * Returns a string containing the last [n] characters from this string, or the entire string if this string is shorter + * Returns a string containing the last [n] characters from this string, or the entire string if this string is shorter. */ public fun String.takeLast(n: Int): String { require(n >= 0, { "Requested element count $n is less than zero." }) @@ -1287,7 +1287,7 @@ public fun String.takeLast(n: Int): String { } /** - * Returns a list containing first elements satisfying the given [predicate] + * Returns a list containing first elements satisfying the given [predicate]. */ public inline fun Array.takeWhile(predicate: (T) -> Boolean): List { val list = ArrayList() @@ -1300,7 +1300,7 @@ public inline fun Array.takeWhile(predicate: (T) -> Boolean): List } /** - * Returns a list containing first elements satisfying the given [predicate] + * Returns a list containing first elements satisfying the given [predicate]. */ public inline fun BooleanArray.takeWhile(predicate: (Boolean) -> Boolean): List { val list = ArrayList() @@ -1313,7 +1313,7 @@ public inline fun BooleanArray.takeWhile(predicate: (Boolean) -> Boolean): List< } /** - * Returns a list containing first elements satisfying the given [predicate] + * Returns a list containing first elements satisfying the given [predicate]. */ public inline fun ByteArray.takeWhile(predicate: (Byte) -> Boolean): List { val list = ArrayList() @@ -1326,7 +1326,7 @@ public inline fun ByteArray.takeWhile(predicate: (Byte) -> Boolean): List } /** - * Returns a list containing first elements satisfying the given [predicate] + * Returns a list containing first elements satisfying the given [predicate]. */ public inline fun CharArray.takeWhile(predicate: (Char) -> Boolean): List { val list = ArrayList() @@ -1339,7 +1339,7 @@ public inline fun CharArray.takeWhile(predicate: (Char) -> Boolean): List } /** - * Returns a list containing first elements satisfying the given [predicate] + * Returns a list containing first elements satisfying the given [predicate]. */ public inline fun DoubleArray.takeWhile(predicate: (Double) -> Boolean): List { val list = ArrayList() @@ -1352,7 +1352,7 @@ public inline fun DoubleArray.takeWhile(predicate: (Double) -> Boolean): List Boolean): List { val list = ArrayList() @@ -1365,7 +1365,7 @@ public inline fun FloatArray.takeWhile(predicate: (Float) -> Boolean): List Boolean): List { val list = ArrayList() @@ -1378,7 +1378,7 @@ public inline fun IntArray.takeWhile(predicate: (Int) -> Boolean): List { } /** - * Returns a list containing first elements satisfying the given [predicate] + * Returns a list containing first elements satisfying the given [predicate]. */ public inline fun LongArray.takeWhile(predicate: (Long) -> Boolean): List { val list = ArrayList() @@ -1391,7 +1391,7 @@ public inline fun LongArray.takeWhile(predicate: (Long) -> Boolean): List } /** - * Returns a list containing first elements satisfying the given [predicate] + * Returns a list containing first elements satisfying the given [predicate]. */ public inline fun ShortArray.takeWhile(predicate: (Short) -> Boolean): List { val list = ArrayList() @@ -1404,7 +1404,7 @@ public inline fun ShortArray.takeWhile(predicate: (Short) -> Boolean): List Iterable.takeWhile(predicate: (T) -> Boolean): List { val list = ArrayList() @@ -1417,7 +1417,7 @@ public inline fun Iterable.takeWhile(predicate: (T) -> Boolean): List } /** - * Returns a sequence containing first elements satisfying the given [predicate] + * Returns a sequence containing first elements satisfying the given [predicate]. */ public fun Sequence.takeWhile(predicate: (T) -> Boolean): Sequence { return TakeWhileSequence(this, predicate) @@ -1426,14 +1426,14 @@ public fun Sequence.takeWhile(predicate: (T) -> Boolean): Sequence { deprecated("Migrate to using Sequence and respective functions") /** - * Returns a stream containing first elements satisfying the given [predicate] + * Returns a stream containing first elements satisfying the given [predicate]. */ public fun Stream.takeWhile(predicate: (T) -> Boolean): Stream { return TakeWhileStream(this, predicate) } /** - * Returns a string containing the first characters that satisfy the given [predicate] + * Returns a string containing the first characters that satisfy the given [predicate]. */ public inline fun String.takeWhile(predicate: (Char) -> Boolean): String { for (index in 0..length - 1) diff --git a/libraries/stdlib/src/generated/_Generators.kt b/libraries/stdlib/src/generated/_Generators.kt index f00eeeafb1e..00dc753cc9a 100644 --- a/libraries/stdlib/src/generated/_Generators.kt +++ b/libraries/stdlib/src/generated/_Generators.kt @@ -11,7 +11,7 @@ import java.util.* import java.util.Collections // TODO: it's temporary while we have java.util.Collections in js /** - * Returns a list of values built from elements of both collections with same indexes using provided *transform*. List has length of shortest collection. + * Returns a list of values built from elements of both collections with same indexes using provided [transform]. List has length of shortest collection. */ public inline fun Array.merge(array: Array, transform: (T, R) -> V): List { val first = iterator() @@ -24,7 +24,7 @@ public inline fun Array.merge(array: Array, transform: ( } /** - * Returns a list of values built from elements of both collections with same indexes using provided *transform*. List has length of shortest collection. + * Returns a list of values built from elements of both collections with same indexes using provided [transform]. List has length of shortest collection. */ public inline fun BooleanArray.merge(array: Array, transform: (Boolean, R) -> V): List { val first = iterator() @@ -37,7 +37,7 @@ public inline fun BooleanArray.merge(array: Array, transform: (Boo } /** - * Returns a list of values built from elements of both collections with same indexes using provided *transform*. List has length of shortest collection. + * Returns a list of values built from elements of both collections with same indexes using provided [transform]. List has length of shortest collection. */ public inline fun ByteArray.merge(array: Array, transform: (Byte, R) -> V): List { val first = iterator() @@ -50,7 +50,7 @@ public inline fun ByteArray.merge(array: Array, transform: (Byte, } /** - * Returns a list of values built from elements of both collections with same indexes using provided *transform*. List has length of shortest collection. + * Returns a list of values built from elements of both collections with same indexes using provided [transform]. List has length of shortest collection. */ public inline fun CharArray.merge(array: Array, transform: (Char, R) -> V): List { val first = iterator() @@ -63,7 +63,7 @@ public inline fun CharArray.merge(array: Array, transform: (Char, } /** - * Returns a list of values built from elements of both collections with same indexes using provided *transform*. List has length of shortest collection. + * Returns a list of values built from elements of both collections with same indexes using provided [transform]. List has length of shortest collection. */ public inline fun DoubleArray.merge(array: Array, transform: (Double, R) -> V): List { val first = iterator() @@ -76,7 +76,7 @@ public inline fun DoubleArray.merge(array: Array, transform: (Doub } /** - * Returns a list of values built from elements of both collections with same indexes using provided *transform*. List has length of shortest collection. + * Returns a list of values built from elements of both collections with same indexes using provided [transform]. List has length of shortest collection. */ public inline fun FloatArray.merge(array: Array, transform: (Float, R) -> V): List { val first = iterator() @@ -89,7 +89,7 @@ public inline fun FloatArray.merge(array: Array, transform: (Float } /** - * Returns a list of values built from elements of both collections with same indexes using provided *transform*. List has length of shortest collection. + * Returns a list of values built from elements of both collections with same indexes using provided [transform]. List has length of shortest collection. */ public inline fun IntArray.merge(array: Array, transform: (Int, R) -> V): List { val first = iterator() @@ -102,7 +102,7 @@ public inline fun IntArray.merge(array: Array, transform: (Int, R) } /** - * Returns a list of values built from elements of both collections with same indexes using provided *transform*. List has length of shortest collection. + * Returns a list of values built from elements of both collections with same indexes using provided [transform]. List has length of shortest collection. */ public inline fun LongArray.merge(array: Array, transform: (Long, R) -> V): List { val first = iterator() @@ -115,7 +115,7 @@ public inline fun LongArray.merge(array: Array, transform: (Long, } /** - * Returns a list of values built from elements of both collections with same indexes using provided *transform*. List has length of shortest collection. + * Returns a list of values built from elements of both collections with same indexes using provided [transform]. List has length of shortest collection. */ public inline fun ShortArray.merge(array: Array, transform: (Short, R) -> V): List { val first = iterator() @@ -128,7 +128,7 @@ public inline fun ShortArray.merge(array: Array, transform: (Short } /** - * Returns a list of values built from elements of both collections with same indexes using provided *transform*. List has length of shortest collection. + * Returns a list of values built from elements of both collections with same indexes using provided [transform]. List has length of shortest collection. */ public inline fun Iterable.merge(array: Array, transform: (T, R) -> V): List { val first = iterator() @@ -141,7 +141,7 @@ public inline fun Iterable.merge(array: Array, transform: (T } /** - * Returns a list of values built from elements of both collections with same indexes using provided *transform*. List has length of shortest collection. + * Returns a list of values built from elements of both collections with same indexes using provided [transform]. List has length of shortest collection. */ public inline fun BooleanArray.merge(array: BooleanArray, transform: (Boolean, Boolean) -> V): List { val first = iterator() @@ -154,7 +154,7 @@ public inline fun BooleanArray.merge(array: BooleanArray, transform: (Boolea } /** - * Returns a list of values built from elements of both collections with same indexes using provided *transform*. List has length of shortest collection. + * Returns a list of values built from elements of both collections with same indexes using provided [transform]. List has length of shortest collection. */ public inline fun ByteArray.merge(array: ByteArray, transform: (Byte, Byte) -> V): List { val first = iterator() @@ -167,7 +167,7 @@ public inline fun ByteArray.merge(array: ByteArray, transform: (Byte, Byte) } /** - * Returns a list of values built from elements of both collections with same indexes using provided *transform*. List has length of shortest collection. + * Returns a list of values built from elements of both collections with same indexes using provided [transform]. List has length of shortest collection. */ public inline fun CharArray.merge(array: CharArray, transform: (Char, Char) -> V): List { val first = iterator() @@ -180,7 +180,7 @@ public inline fun CharArray.merge(array: CharArray, transform: (Char, Char) } /** - * Returns a list of values built from elements of both collections with same indexes using provided *transform*. List has length of shortest collection. + * Returns a list of values built from elements of both collections with same indexes using provided [transform]. List has length of shortest collection. */ public inline fun DoubleArray.merge(array: DoubleArray, transform: (Double, Double) -> V): List { val first = iterator() @@ -193,7 +193,7 @@ public inline fun DoubleArray.merge(array: DoubleArray, transform: (Double, } /** - * Returns a list of values built from elements of both collections with same indexes using provided *transform*. List has length of shortest collection. + * Returns a list of values built from elements of both collections with same indexes using provided [transform]. List has length of shortest collection. */ public inline fun FloatArray.merge(array: FloatArray, transform: (Float, Float) -> V): List { val first = iterator() @@ -206,7 +206,7 @@ public inline fun FloatArray.merge(array: FloatArray, transform: (Float, Flo } /** - * Returns a list of values built from elements of both collections with same indexes using provided *transform*. List has length of shortest collection. + * Returns a list of values built from elements of both collections with same indexes using provided [transform]. List has length of shortest collection. */ public inline fun IntArray.merge(array: IntArray, transform: (Int, Int) -> V): List { val first = iterator() @@ -219,7 +219,7 @@ public inline fun IntArray.merge(array: IntArray, transform: (Int, Int) -> V } /** - * Returns a list of values built from elements of both collections with same indexes using provided *transform*. List has length of shortest collection. + * Returns a list of values built from elements of both collections with same indexes using provided [transform]. List has length of shortest collection. */ public inline fun LongArray.merge(array: LongArray, transform: (Long, Long) -> V): List { val first = iterator() @@ -232,7 +232,7 @@ public inline fun LongArray.merge(array: LongArray, transform: (Long, Long) } /** - * Returns a list of values built from elements of both collections with same indexes using provided *transform*. List has length of shortest collection. + * Returns a list of values built from elements of both collections with same indexes using provided [transform]. List has length of shortest collection. */ public inline fun ShortArray.merge(array: ShortArray, transform: (Short, Short) -> V): List { val first = iterator() @@ -245,7 +245,7 @@ public inline fun ShortArray.merge(array: ShortArray, transform: (Short, Sho } /** - * Returns a list of values built from elements of both collections with same indexes using provided *transform*. List has length of shortest collection. + * Returns a list of values built from elements of both collections with same indexes using provided [transform]. List has length of shortest collection. */ public inline fun Array.merge(other: Iterable, transform: (T, R) -> V): List { val first = iterator() @@ -258,7 +258,7 @@ public inline fun Array.merge(other: Iterable, transform: (T } /** - * Returns a list of values built from elements of both collections with same indexes using provided *transform*. List has length of shortest collection. + * Returns a list of values built from elements of both collections with same indexes using provided [transform]. List has length of shortest collection. */ public inline fun BooleanArray.merge(other: Iterable, transform: (Boolean, R) -> V): List { val first = iterator() @@ -271,7 +271,7 @@ public inline fun BooleanArray.merge(other: Iterable, transform: (Bool } /** - * Returns a list of values built from elements of both collections with same indexes using provided *transform*. List has length of shortest collection. + * Returns a list of values built from elements of both collections with same indexes using provided [transform]. List has length of shortest collection. */ public inline fun ByteArray.merge(other: Iterable, transform: (Byte, R) -> V): List { val first = iterator() @@ -284,7 +284,7 @@ public inline fun ByteArray.merge(other: Iterable, transform: (Byte, R } /** - * Returns a list of values built from elements of both collections with same indexes using provided *transform*. List has length of shortest collection. + * Returns a list of values built from elements of both collections with same indexes using provided [transform]. List has length of shortest collection. */ public inline fun CharArray.merge(other: Iterable, transform: (Char, R) -> V): List { val first = iterator() @@ -297,7 +297,7 @@ public inline fun CharArray.merge(other: Iterable, transform: (Char, R } /** - * Returns a list of values built from elements of both collections with same indexes using provided *transform*. List has length of shortest collection. + * Returns a list of values built from elements of both collections with same indexes using provided [transform]. List has length of shortest collection. */ public inline fun DoubleArray.merge(other: Iterable, transform: (Double, R) -> V): List { val first = iterator() @@ -310,7 +310,7 @@ public inline fun DoubleArray.merge(other: Iterable, transform: (Doubl } /** - * Returns a list of values built from elements of both collections with same indexes using provided *transform*. List has length of shortest collection. + * Returns a list of values built from elements of both collections with same indexes using provided [transform]. List has length of shortest collection. */ public inline fun FloatArray.merge(other: Iterable, transform: (Float, R) -> V): List { val first = iterator() @@ -323,7 +323,7 @@ public inline fun FloatArray.merge(other: Iterable, transform: (Float, } /** - * Returns a list of values built from elements of both collections with same indexes using provided *transform*. List has length of shortest collection. + * Returns a list of values built from elements of both collections with same indexes using provided [transform]. List has length of shortest collection. */ public inline fun IntArray.merge(other: Iterable, transform: (Int, R) -> V): List { val first = iterator() @@ -336,7 +336,7 @@ public inline fun IntArray.merge(other: Iterable, transform: (Int, R) } /** - * Returns a list of values built from elements of both collections with same indexes using provided *transform*. List has length of shortest collection. + * Returns a list of values built from elements of both collections with same indexes using provided [transform]. List has length of shortest collection. */ public inline fun LongArray.merge(other: Iterable, transform: (Long, R) -> V): List { val first = iterator() @@ -349,7 +349,7 @@ public inline fun LongArray.merge(other: Iterable, transform: (Long, R } /** - * Returns a list of values built from elements of both collections with same indexes using provided *transform*. List has length of shortest collection. + * Returns a list of values built from elements of both collections with same indexes using provided [transform]. List has length of shortest collection. */ public inline fun ShortArray.merge(other: Iterable, transform: (Short, R) -> V): List { val first = iterator() @@ -362,7 +362,7 @@ public inline fun ShortArray.merge(other: Iterable, transform: (Short, } /** - * Returns a list of values built from elements of both collections with same indexes using provided *transform*. List has length of shortest collection. + * Returns a list of values built from elements of both collections with same indexes using provided [transform]. List has length of shortest collection. */ public inline fun Iterable.merge(other: Iterable, transform: (T, R) -> V): List { val first = iterator() @@ -375,7 +375,7 @@ public inline fun Iterable.merge(other: Iterable, transform: (T, } /** - * 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. + * 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 fun Sequence.merge(sequence: Sequence, transform: (T, R) -> V): Sequence { return MergingSequence(this, sequence, transform) @@ -384,7 +384,7 @@ public fun Sequence.merge(sequence: Sequence, transform: (T, R) deprecated("Migrate to using Sequence and respective functions") /** - * Returns a stream of values built from elements of both collections with same indexes using provided *transform*. Resulting stream has length of shortest input streams. + * Returns a stream of values built from elements of both collections with same indexes using provided [transform]. Resulting stream has length of shortest input streams. */ public fun Stream.merge(stream: Stream, transform: (T, R) -> V): Stream { return MergingStream(this, stream, transform) @@ -392,8 +392,8 @@ public fun Stream.merge(stream: Stream, transform: (T, R) -> V): /** * Splits original collection into pair of collections, - * where *first* collection contains elements for which predicate yielded *true*, - * while *second* collection contains elements for which predicate yielded *false* + * where *first* collection contains elements for which [predicate] yielded [true], + * while *second* collection contains elements for which [predicate] yielded [false]. */ public inline fun Array.partition(predicate: (T) -> Boolean): Pair, List> { val first = ArrayList() @@ -410,8 +410,8 @@ public inline fun Array.partition(predicate: (T) -> Boolean): Pair
  • Boolean): Pair, List> { val first = ArrayList() @@ -428,8 +428,8 @@ public inline fun BooleanArray.partition(predicate: (Boolean) -> Boolean): Pair< /** * Splits original collection into pair of collections, - * where *first* collection contains elements for which predicate yielded *true*, - * while *second* collection contains elements for which predicate yielded *false* + * where *first* collection contains elements for which [predicate] yielded [true], + * while *second* collection contains elements for which [predicate] yielded [false]. */ public inline fun ByteArray.partition(predicate: (Byte) -> Boolean): Pair, List> { val first = ArrayList() @@ -446,8 +446,8 @@ public inline fun ByteArray.partition(predicate: (Byte) -> Boolean): Pair Boolean): Pair, List> { val first = ArrayList() @@ -464,8 +464,8 @@ public inline fun CharArray.partition(predicate: (Char) -> Boolean): Pair Boolean): Pair, List> { val first = ArrayList() @@ -482,8 +482,8 @@ public inline fun DoubleArray.partition(predicate: (Double) -> Boolean): Pair
  • Boolean): Pair, List> { val first = ArrayList() @@ -500,8 +500,8 @@ public inline fun FloatArray.partition(predicate: (Float) -> Boolean): Pair Boolean): Pair, List> { val first = ArrayList() @@ -518,8 +518,8 @@ public inline fun IntArray.partition(predicate: (Int) -> Boolean): Pair Boolean): Pair, List> { val first = ArrayList() @@ -536,8 +536,8 @@ public inline fun LongArray.partition(predicate: (Long) -> Boolean): Pair Boolean): Pair, List> { val first = ArrayList() @@ -554,8 +554,8 @@ public inline fun ShortArray.partition(predicate: (Short) -> Boolean): Pair Iterable.partition(predicate: (T) -> Boolean): Pair, List> { val first = ArrayList() @@ -572,8 +572,8 @@ public inline fun Iterable.partition(predicate: (T) -> Boolean): Pair Sequence.partition(predicate: (T) -> Boolean): Pair, List> { val first = ArrayList() @@ -592,8 +592,8 @@ public inline fun Sequence.partition(predicate: (T) -> Boolean): Pair and respective functions") /** * Splits original collection into pair of collections, - * where *first* collection contains elements for which predicate yielded *true*, - * while *second* collection contains elements for which predicate yielded *false* + * where *first* collection contains elements for which [predicate] yielded [true], + * while *second* collection contains elements for which [predicate] yielded [false]. */ public inline fun Stream.partition(predicate: (T) -> Boolean): Pair, List> { val first = ArrayList() @@ -610,8 +610,8 @@ public inline fun Stream.partition(predicate: (T) -> Boolean): Pair Boolean): Pair { val first = StringBuilder() @@ -627,7 +627,7 @@ public inline fun String.partition(predicate: (Char) -> Boolean): Pair Array.plus(array: Array): List { val answer = ArrayList(size() + array.size()) @@ -637,7 +637,7 @@ public fun Array.plus(array: Array): List { } /** - * Returns a list containing all elements of original collection and then all elements of the given *collection* + * Returns a list containing all elements of original collection and then all elements of the given [collection]. */ public fun BooleanArray.plus(array: Array): List { val answer = ArrayList(size() + array.size()) @@ -647,7 +647,7 @@ public fun BooleanArray.plus(array: Array): List { } /** - * Returns a list containing all elements of original collection and then all elements of the given *collection* + * Returns a list containing all elements of original collection and then all elements of the given [collection]. */ public fun ByteArray.plus(array: Array): List { val answer = ArrayList(size() + array.size()) @@ -657,7 +657,7 @@ public fun ByteArray.plus(array: Array): List { } /** - * Returns a list containing all elements of original collection and then all elements of the given *collection* + * Returns a list containing all elements of original collection and then all elements of the given [collection]. */ public fun CharArray.plus(array: Array): List { val answer = ArrayList(size() + array.size()) @@ -667,7 +667,7 @@ public fun CharArray.plus(array: Array): List { } /** - * Returns a list containing all elements of original collection and then all elements of the given *collection* + * Returns a list containing all elements of original collection and then all elements of the given [collection]. */ public fun DoubleArray.plus(array: Array): List { val answer = ArrayList(size() + array.size()) @@ -677,7 +677,7 @@ public fun DoubleArray.plus(array: Array): List { } /** - * Returns a list containing all elements of original collection and then all elements of the given *collection* + * Returns a list containing all elements of original collection and then all elements of the given [collection]. */ public fun FloatArray.plus(array: Array): List { val answer = ArrayList(size() + array.size()) @@ -687,7 +687,7 @@ public fun FloatArray.plus(array: Array): List { } /** - * Returns a list containing all elements of original collection and then all elements of the given *collection* + * Returns a list containing all elements of original collection and then all elements of the given [collection]. */ public fun IntArray.plus(array: Array): List { val answer = ArrayList(size() + array.size()) @@ -697,7 +697,7 @@ public fun IntArray.plus(array: Array): List { } /** - * Returns a list containing all elements of original collection and then all elements of the given *collection* + * Returns a list containing all elements of original collection and then all elements of the given [collection]. */ public fun LongArray.plus(array: Array): List { val answer = ArrayList(size() + array.size()) @@ -707,7 +707,7 @@ public fun LongArray.plus(array: Array): List { } /** - * Returns a list containing all elements of original collection and then all elements of the given *collection* + * Returns a list containing all elements of original collection and then all elements of the given [collection]. */ public fun ShortArray.plus(array: Array): List { val answer = ArrayList(size() + array.size()) @@ -717,7 +717,7 @@ public fun ShortArray.plus(array: Array): List { } /** - * Returns a list containing all elements of original collection and then all elements of the given *collection* + * Returns a list containing all elements of original collection and then all elements of the given [collection]. */ public fun Iterable.plus(array: Array): List { val answer = ArrayList(collectionSizeOrDefault(10) + array.size()) @@ -727,7 +727,7 @@ public fun Iterable.plus(array: Array): List { } /** - * Returns a list containing all elements of original collection and then all elements of the given *collection* + * Returns a list containing all elements of original collection and then all elements of the given [collection]. */ public fun Array.plus(collection: Iterable): List { val answer = ArrayList(size() + collection.collectionSizeOrDefault(10)) @@ -737,7 +737,7 @@ public fun Array.plus(collection: Iterable): List { } /** - * Returns a list containing all elements of original collection and then all elements of the given *collection* + * Returns a list containing all elements of original collection and then all elements of the given [collection]. */ public fun BooleanArray.plus(collection: Iterable): List { val answer = ArrayList(size() + collection.collectionSizeOrDefault(10)) @@ -747,7 +747,7 @@ public fun BooleanArray.plus(collection: Iterable): List { } /** - * Returns a list containing all elements of original collection and then all elements of the given *collection* + * Returns a list containing all elements of original collection and then all elements of the given [collection]. */ public fun ByteArray.plus(collection: Iterable): List { val answer = ArrayList(size() + collection.collectionSizeOrDefault(10)) @@ -757,7 +757,7 @@ public fun ByteArray.plus(collection: Iterable): List { } /** - * Returns a list containing all elements of original collection and then all elements of the given *collection* + * Returns a list containing all elements of original collection and then all elements of the given [collection]. */ public fun CharArray.plus(collection: Iterable): List { val answer = ArrayList(size() + collection.collectionSizeOrDefault(10)) @@ -767,7 +767,7 @@ public fun CharArray.plus(collection: Iterable): List { } /** - * Returns a list containing all elements of original collection and then all elements of the given *collection* + * Returns a list containing all elements of original collection and then all elements of the given [collection]. */ public fun DoubleArray.plus(collection: Iterable): List { val answer = ArrayList(size() + collection.collectionSizeOrDefault(10)) @@ -777,7 +777,7 @@ public fun DoubleArray.plus(collection: Iterable): List { } /** - * Returns a list containing all elements of original collection and then all elements of the given *collection* + * Returns a list containing all elements of original collection and then all elements of the given [collection]. */ public fun FloatArray.plus(collection: Iterable): List { val answer = ArrayList(size() + collection.collectionSizeOrDefault(10)) @@ -787,7 +787,7 @@ public fun FloatArray.plus(collection: Iterable): List { } /** - * Returns a list containing all elements of original collection and then all elements of the given *collection* + * Returns a list containing all elements of original collection and then all elements of the given [collection]. */ public fun IntArray.plus(collection: Iterable): List { val answer = ArrayList(size() + collection.collectionSizeOrDefault(10)) @@ -797,7 +797,7 @@ public fun IntArray.plus(collection: Iterable): List { } /** - * Returns a list containing all elements of original collection and then all elements of the given *collection* + * Returns a list containing all elements of original collection and then all elements of the given [collection]. */ public fun LongArray.plus(collection: Iterable): List { val answer = ArrayList(size() + collection.collectionSizeOrDefault(10)) @@ -807,7 +807,7 @@ public fun LongArray.plus(collection: Iterable): List { } /** - * Returns a list containing all elements of original collection and then all elements of the given *collection* + * Returns a list containing all elements of original collection and then all elements of the given [collection]. */ public fun ShortArray.plus(collection: Iterable): List { val answer = ArrayList(size() + collection.collectionSizeOrDefault(10)) @@ -817,7 +817,7 @@ public fun ShortArray.plus(collection: Iterable): List { } /** - * Returns a list containing all elements of original collection and then all elements of the given *collection* + * Returns a list containing all elements of original collection and then all elements of the given [collection]. */ public fun Iterable.plus(collection: Iterable): List { val answer = ArrayList(collectionSizeOrDefault(10) + collection.collectionSizeOrDefault(10)) @@ -827,7 +827,7 @@ public fun Iterable.plus(collection: Iterable): List { } /** - * Returns a sequence containing all elements of original sequence and then all elements of the given [collection] + * Returns a sequence containing all elements of original sequence and then all elements of the given [collection]. */ public fun Sequence.plus(collection: Iterable): Sequence { return sequenceOf(this, collection.sequence()).flatten() @@ -836,14 +836,14 @@ public fun Sequence.plus(collection: Iterable): Sequence { deprecated("Migrate to using Sequence and respective functions") /** - * Returns a stream containing all elements of original stream and then all elements of the given [collection] + * Returns a stream containing all elements of original stream and then all elements of the given [collection]. */ public fun Stream.plus(collection: Iterable): Stream { return streamOf(this, collection.stream()).flatten() } /** - * Returns a list containing all elements of original collection and then the given element + * Returns a list containing all elements of original collection and then the given [element]. */ public fun Array.plus(element: T): List { val answer = ArrayList(size()+1) @@ -853,7 +853,7 @@ public fun Array.plus(element: T): List { } /** - * Returns a list containing all elements of original collection and then the given element + * Returns a list containing all elements of original collection and then the given [element]. */ public fun BooleanArray.plus(element: Boolean): List { val answer = ArrayList(size()+1) @@ -863,7 +863,7 @@ public fun BooleanArray.plus(element: Boolean): List { } /** - * Returns a list containing all elements of original collection and then the given element + * Returns a list containing all elements of original collection and then the given [element]. */ public fun ByteArray.plus(element: Byte): List { val answer = ArrayList(size()+1) @@ -873,7 +873,7 @@ public fun ByteArray.plus(element: Byte): List { } /** - * Returns a list containing all elements of original collection and then the given element + * Returns a list containing all elements of original collection and then the given [element]. */ public fun CharArray.plus(element: Char): List { val answer = ArrayList(size()+1) @@ -883,7 +883,7 @@ public fun CharArray.plus(element: Char): List { } /** - * Returns a list containing all elements of original collection and then the given element + * Returns a list containing all elements of original collection and then the given [element]. */ public fun DoubleArray.plus(element: Double): List { val answer = ArrayList(size()+1) @@ -893,7 +893,7 @@ public fun DoubleArray.plus(element: Double): List { } /** - * Returns a list containing all elements of original collection and then the given element + * Returns a list containing all elements of original collection and then the given [element]. */ public fun FloatArray.plus(element: Float): List { val answer = ArrayList(size()+1) @@ -903,7 +903,7 @@ public fun FloatArray.plus(element: Float): List { } /** - * Returns a list containing all elements of original collection and then the given element + * Returns a list containing all elements of original collection and then the given [element]. */ public fun IntArray.plus(element: Int): List { val answer = ArrayList(size()+1) @@ -913,7 +913,7 @@ public fun IntArray.plus(element: Int): List { } /** - * Returns a list containing all elements of original collection and then the given element + * Returns a list containing all elements of original collection and then the given [element]. */ public fun LongArray.plus(element: Long): List { val answer = ArrayList(size()+1) @@ -923,7 +923,7 @@ public fun LongArray.plus(element: Long): List { } /** - * Returns a list containing all elements of original collection and then the given element + * Returns a list containing all elements of original collection and then the given [element]. */ public fun ShortArray.plus(element: Short): List { val answer = ArrayList(size()+1) @@ -933,7 +933,7 @@ public fun ShortArray.plus(element: Short): List { } /** - * Returns a list containing all elements of original collection and then the given element + * Returns a list containing all elements of original collection and then the given [element]. */ public fun Iterable.plus(element: T): List { val answer = ArrayList(collectionSizeOrNull()?.let { it + 1 } ?: 10) @@ -943,7 +943,7 @@ public fun Iterable.plus(element: T): List { } /** - * Returns a sequence containing all elements of original sequence and then the given element + * Returns a sequence containing all elements of original sequence and then the given [element]. */ public fun Sequence.plus(element: T): Sequence { return sequenceOf(this, sequenceOf(element)).flatten() @@ -952,14 +952,14 @@ public fun Sequence.plus(element: T): Sequence { deprecated("Migrate to using Sequence and respective functions") /** - * Returns a stream containing all elements of original stream and then the given element + * Returns a stream containing all elements of original stream and then the given [element]. */ public fun Stream.plus(element: T): Stream { return streamOf(this, streamOf(element)).flatten() } /** - * Returns a sequence containing all elements of original sequence and then all elements of the given [sequence] + * Returns a sequence containing all elements of original sequence and then all elements of the given [sequence]. */ public fun Sequence.plus(sequence: Sequence): Sequence { return sequenceOf(this, sequence).flatten() @@ -968,7 +968,7 @@ public fun Sequence.plus(sequence: Sequence): Sequence { deprecated("Migrate to using Sequence and respective functions") /** - * Returns a stream containing all elements of original stream and then all elements of the given [stream] + * Returns a stream containing all elements of original stream and then all elements of the given [stream]. */ public fun Stream.plus(stream: Stream): Stream { return streamOf(this, stream).flatten() diff --git a/libraries/stdlib/src/generated/_Guards.kt b/libraries/stdlib/src/generated/_Guards.kt index ce5593be8eb..8f55e8ab638 100644 --- a/libraries/stdlib/src/generated/_Guards.kt +++ b/libraries/stdlib/src/generated/_Guards.kt @@ -11,54 +11,54 @@ import java.util.* import java.util.Collections // TODO: it's temporary while we have java.util.Collections in js /** - * Returns an original collection containing all the non-*null* elements, throwing an [[IllegalArgumentException]] if there are any null elements + * Returns an original collection containing all the non-`null` elements, throwing an [IllegalArgumentException] if there are any `null` elements. */ public fun Array.requireNoNulls(): Array { for (element in this) { if (element == null) { - throw IllegalArgumentException("null element found in $this") + throw IllegalArgumentException("null element found in $this.") } } return this as Array } /** - * Returns an original collection containing all the non-*null* elements, throwing an [[IllegalArgumentException]] if there are any null elements + * Returns an original collection containing all the non-`null` elements, throwing an [IllegalArgumentException] if there are any `null` elements. */ public fun Iterable.requireNoNulls(): Iterable { for (element in this) { if (element == null) { - throw IllegalArgumentException("null element found in $this") + throw IllegalArgumentException("null element found in $this.") } } return this as Iterable } /** - * Returns an original collection containing all the non-*null* elements, throwing an [[IllegalArgumentException]] if there are any null elements + * Returns an original collection containing all the non-`null` elements, throwing an [IllegalArgumentException] if there are any `null` elements. */ public fun List.requireNoNulls(): List { for (element in this) { if (element == null) { - throw IllegalArgumentException("null element found in $this") + throw IllegalArgumentException("null element found in $this.") } } return this as List } /** - * Returns an original collection containing all the non-*null* elements, throwing an [[IllegalArgumentException]] if there are any null elements + * Returns an original collection containing all the non-`null` elements, throwing an [IllegalArgumentException] if there are any `null` elements. */ public fun Sequence.requireNoNulls(): Sequence { - return map { it ?: throw IllegalArgumentException("null element found in $this") } + return map { it ?: throw IllegalArgumentException("null element found in $this.") } } deprecated("Migrate to using Sequence and respective functions") /** - * Returns an original collection containing all the non-*null* elements, throwing an [[IllegalArgumentException]] if there are any null elements + * Returns an original collection containing all the non-`null` elements, throwing an [IllegalArgumentException] if there are any `null` elements. */ public fun Stream.requireNoNulls(): Stream { - return map { it ?: throw IllegalArgumentException("null element found in $this") } + return map { it ?: throw IllegalArgumentException("null element found in $this.") } } diff --git a/libraries/stdlib/src/generated/_Mapping.kt b/libraries/stdlib/src/generated/_Mapping.kt index b6a8541d96a..9807b37eb55 100644 --- a/libraries/stdlib/src/generated/_Mapping.kt +++ b/libraries/stdlib/src/generated/_Mapping.kt @@ -11,91 +11,91 @@ import java.util.* import java.util.Collections // TODO: it's temporary while we have java.util.Collections in js /** - * Returns a single list of all elements yielded from results of *transform* function being invoked on each element of original collection + * Returns a single list of all elements yielded from results of [transform] function being invoked on each element of original collection. */ public inline fun Array.flatMap(transform: (T) -> Iterable): List { return flatMapTo(ArrayList(), transform) } /** - * Returns a single list of all elements yielded from results of *transform* function being invoked on each element of original collection + * Returns a single list of all elements yielded from results of [transform] function being invoked on each element of original collection. */ public inline fun BooleanArray.flatMap(transform: (Boolean) -> Iterable): List { return flatMapTo(ArrayList(), transform) } /** - * Returns a single list of all elements yielded from results of *transform* function being invoked on each element of original collection + * Returns a single list of all elements yielded from results of [transform] function being invoked on each element of original collection. */ public inline fun ByteArray.flatMap(transform: (Byte) -> Iterable): List { return flatMapTo(ArrayList(), transform) } /** - * Returns a single list of all elements yielded from results of *transform* function being invoked on each element of original collection + * Returns a single list of all elements yielded from results of [transform] function being invoked on each element of original collection. */ public inline fun CharArray.flatMap(transform: (Char) -> Iterable): List { return flatMapTo(ArrayList(), transform) } /** - * Returns a single list of all elements yielded from results of *transform* function being invoked on each element of original collection + * Returns a single list of all elements yielded from results of [transform] function being invoked on each element of original collection. */ public inline fun DoubleArray.flatMap(transform: (Double) -> Iterable): List { return flatMapTo(ArrayList(), transform) } /** - * Returns a single list of all elements yielded from results of *transform* function being invoked on each element of original collection + * Returns a single list of all elements yielded from results of [transform] function being invoked on each element of original collection. */ public inline fun FloatArray.flatMap(transform: (Float) -> Iterable): List { return flatMapTo(ArrayList(), transform) } /** - * Returns a single list of all elements yielded from results of *transform* function being invoked on each element of original collection + * Returns a single list of all elements yielded from results of [transform] function being invoked on each element of original collection. */ public inline fun IntArray.flatMap(transform: (Int) -> Iterable): List { return flatMapTo(ArrayList(), transform) } /** - * Returns a single list of all elements yielded from results of *transform* function being invoked on each element of original collection + * Returns a single list of all elements yielded from results of [transform] function being invoked on each element of original collection. */ public inline fun LongArray.flatMap(transform: (Long) -> Iterable): List { return flatMapTo(ArrayList(), transform) } /** - * Returns a single list of all elements yielded from results of *transform* function being invoked on each element of original collection + * Returns a single list of all elements yielded from results of [transform] function being invoked on each element of original collection. */ public inline fun ShortArray.flatMap(transform: (Short) -> Iterable): List { return flatMapTo(ArrayList(), transform) } /** - * Returns a single list of all elements yielded from results of *transform* function being invoked on each element of original collection + * Returns a single list of all elements yielded from results of [transform] function being invoked on each element of original collection. */ public inline fun Iterable.flatMap(transform: (T) -> Iterable): List { return flatMapTo(ArrayList(), transform) } /** - * Returns a single list of all elements yielded from results of *transform* function being invoked on each element of original collection + * Returns a single list of all elements yielded from results of [transform] function being invoked on each element of original collection. */ public inline fun Map.flatMap(transform: (Map.Entry) -> Iterable): List { return flatMapTo(ArrayList(), transform) } /** - * Returns a single list of all elements yielded from results of *transform* function being invoked on each element of original collection + * Returns a single list of all elements yielded from results of [transform] function being invoked on each element of original collection. */ public inline fun String.flatMap(transform: (Char) -> Iterable): List { return flatMapTo(ArrayList(), transform) } /** - * Returns a single sequence of all elements from results of *transform* function being invoked on each element of original sequence + * Returns a single sequence of all elements from results of [transform] function being invoked on each element of original sequence. */ public fun Sequence.flatMap(transform: (T) -> Sequence): Sequence { return FlatteningSequence(this, transform) @@ -104,14 +104,14 @@ public fun Sequence.flatMap(transform: (T) -> Sequence): Sequence and respective functions") /** - * Returns a single stream of all elements from results of *transform* function being invoked on each element of original stream + * Returns a single stream of all elements from results of [transform] function being invoked on each element of original stream. */ public fun Stream.flatMap(transform: (T) -> Stream): Stream { return FlatteningStream(this, transform) } /** - * Appends all elements yielded from results of *transform* function being invoked on each element of original collection, to the given *destination* + * Appends all elements yielded from results of [transform] function being invoked on each element of original collection, to the given [destination]. */ public inline fun > Array.flatMapTo(destination: C, transform: (T) -> Iterable): C { for (element in this) { @@ -122,7 +122,7 @@ public inline fun > Array.flatMapTo(des } /** - * Appends all elements yielded from results of *transform* function being invoked on each element of original collection, to the given *destination* + * Appends all elements yielded from results of [transform] function being invoked on each element of original collection, to the given [destination]. */ public inline fun > BooleanArray.flatMapTo(destination: C, transform: (Boolean) -> Iterable): C { for (element in this) { @@ -133,7 +133,7 @@ public inline fun > BooleanArray.flatMapTo(destin } /** - * Appends all elements yielded from results of *transform* function being invoked on each element of original collection, to the given *destination* + * Appends all elements yielded from results of [transform] function being invoked on each element of original collection, to the given [destination]. */ public inline fun > ByteArray.flatMapTo(destination: C, transform: (Byte) -> Iterable): C { for (element in this) { @@ -144,7 +144,7 @@ public inline fun > ByteArray.flatMapTo(destinati } /** - * Appends all elements yielded from results of *transform* function being invoked on each element of original collection, to the given *destination* + * Appends all elements yielded from results of [transform] function being invoked on each element of original collection, to the given [destination]. */ public inline fun > CharArray.flatMapTo(destination: C, transform: (Char) -> Iterable): C { for (element in this) { @@ -155,7 +155,7 @@ public inline fun > CharArray.flatMapTo(destinati } /** - * Appends all elements yielded from results of *transform* function being invoked on each element of original collection, to the given *destination* + * Appends all elements yielded from results of [transform] function being invoked on each element of original collection, to the given [destination]. */ public inline fun > DoubleArray.flatMapTo(destination: C, transform: (Double) -> Iterable): C { for (element in this) { @@ -166,7 +166,7 @@ public inline fun > DoubleArray.flatMapTo(destina } /** - * Appends all elements yielded from results of *transform* function being invoked on each element of original collection, to the given *destination* + * Appends all elements yielded from results of [transform] function being invoked on each element of original collection, to the given [destination]. */ public inline fun > FloatArray.flatMapTo(destination: C, transform: (Float) -> Iterable): C { for (element in this) { @@ -177,7 +177,7 @@ public inline fun > FloatArray.flatMapTo(destinat } /** - * Appends all elements yielded from results of *transform* function being invoked on each element of original collection, to the given *destination* + * Appends all elements yielded from results of [transform] function being invoked on each element of original collection, to the given [destination]. */ public inline fun > IntArray.flatMapTo(destination: C, transform: (Int) -> Iterable): C { for (element in this) { @@ -188,7 +188,7 @@ public inline fun > IntArray.flatMapTo(destinatio } /** - * Appends all elements yielded from results of *transform* function being invoked on each element of original collection, to the given *destination* + * Appends all elements yielded from results of [transform] function being invoked on each element of original collection, to the given [destination]. */ public inline fun > LongArray.flatMapTo(destination: C, transform: (Long) -> Iterable): C { for (element in this) { @@ -199,7 +199,7 @@ public inline fun > LongArray.flatMapTo(destinati } /** - * Appends all elements yielded from results of *transform* function being invoked on each element of original collection, to the given *destination* + * Appends all elements yielded from results of [transform] function being invoked on each element of original collection, to the given [destination]. */ public inline fun > ShortArray.flatMapTo(destination: C, transform: (Short) -> Iterable): C { for (element in this) { @@ -210,7 +210,7 @@ public inline fun > ShortArray.flatMapTo(destinat } /** - * Appends all elements yielded from results of *transform* function being invoked on each element of original collection, to the given *destination* + * Appends all elements yielded from results of [transform] function being invoked on each element of original collection, to the given [destination]. */ public inline fun > Iterable.flatMapTo(destination: C, transform: (T) -> Iterable): C { for (element in this) { @@ -221,7 +221,7 @@ public inline fun > Iterable.flatMapTo(dest } /** - * Appends all elements yielded from results of *transform* function being invoked on each element of original collection, to the given *destination* + * Appends all elements yielded from results of [transform] function being invoked on each element of original collection, to the given [destination]. */ public inline fun > Map.flatMapTo(destination: C, transform: (Map.Entry) -> Iterable): C { for (element in this) { @@ -232,7 +232,7 @@ public inline fun > Map.flatMapTo(des } /** - * Appends all elements yielded from results of *transform* function being invoked on each element of original collection, to the given *destination* + * Appends all elements yielded from results of [transform] function being invoked on each element of original collection, to the given [destination]. */ public inline fun > String.flatMapTo(destination: C, transform: (Char) -> Iterable): C { for (element in this) { @@ -243,7 +243,7 @@ public inline fun > String.flatMapTo(destination: } /** - * Appends all elements yielded from results of *transform* function being invoked on each element of original sequence, to the given *destination* + * Appends all elements yielded from results of [transform] function being invoked on each element of original sequence, to the given [destination]. */ public inline fun > Sequence.flatMapTo(destination: C, transform: (T) -> Sequence): C { for (element in this) { @@ -256,7 +256,7 @@ public inline fun > Sequence.flatMapTo(dest deprecated("Migrate to using Sequence and respective functions") /** - * Appends all elements yielded from results of *transform* function being invoked on each element of original stream, to the given *destination* + * Appends all elements yielded from results of [transform] function being invoked on each element of original stream, to the given [destination]. */ public inline fun > Stream.flatMapTo(destination: C, transform: (T) -> Stream): C { for (element in this) { @@ -267,77 +267,77 @@ public inline fun > Stream.flatMapTo(destin } /** - * Returns a map of the elements in original collection grouped by the result of given *toKey* function + * Returns a map of the elements in original collection grouped by the result of given [toKey] function. */ public inline fun Array.groupBy(toKey: (T) -> K): Map> { return groupByTo(LinkedHashMap>(), toKey) } /** - * Returns a map of the elements in original collection grouped by the result of given *toKey* function + * Returns a map of the elements in original collection grouped by the result of given [toKey] function. */ public inline fun BooleanArray.groupBy(toKey: (Boolean) -> K): Map> { return groupByTo(LinkedHashMap>(), toKey) } /** - * Returns a map of the elements in original collection grouped by the result of given *toKey* function + * Returns a map of the elements in original collection grouped by the result of given [toKey] function. */ public inline fun ByteArray.groupBy(toKey: (Byte) -> K): Map> { return groupByTo(LinkedHashMap>(), toKey) } /** - * Returns a map of the elements in original collection grouped by the result of given *toKey* function + * Returns a map of the elements in original collection grouped by the result of given [toKey] function. */ public inline fun CharArray.groupBy(toKey: (Char) -> K): Map> { return groupByTo(LinkedHashMap>(), toKey) } /** - * Returns a map of the elements in original collection grouped by the result of given *toKey* function + * Returns a map of the elements in original collection grouped by the result of given [toKey] function. */ public inline fun DoubleArray.groupBy(toKey: (Double) -> K): Map> { return groupByTo(LinkedHashMap>(), toKey) } /** - * Returns a map of the elements in original collection grouped by the result of given *toKey* function + * Returns a map of the elements in original collection grouped by the result of given [toKey] function. */ public inline fun FloatArray.groupBy(toKey: (Float) -> K): Map> { return groupByTo(LinkedHashMap>(), toKey) } /** - * Returns a map of the elements in original collection grouped by the result of given *toKey* function + * Returns a map of the elements in original collection grouped by the result of given [toKey] function. */ public inline fun IntArray.groupBy(toKey: (Int) -> K): Map> { return groupByTo(LinkedHashMap>(), toKey) } /** - * Returns a map of the elements in original collection grouped by the result of given *toKey* function + * Returns a map of the elements in original collection grouped by the result of given [toKey] function. */ public inline fun LongArray.groupBy(toKey: (Long) -> K): Map> { return groupByTo(LinkedHashMap>(), toKey) } /** - * Returns a map of the elements in original collection grouped by the result of given *toKey* function + * Returns a map of the elements in original collection grouped by the result of given [toKey] function. */ public inline fun ShortArray.groupBy(toKey: (Short) -> K): Map> { return groupByTo(LinkedHashMap>(), toKey) } /** - * Returns a map of the elements in original collection grouped by the result of given *toKey* function + * Returns a map of the elements in original collection grouped by the result of given [toKey] function. */ public inline fun Iterable.groupBy(toKey: (T) -> K): Map> { return groupByTo(LinkedHashMap>(), toKey) } /** - * Returns a map of the elements in original collection grouped by the result of given *toKey* function + * Returns a map of the elements in original collection grouped by the result of given [toKey] function. */ public inline fun Sequence.groupBy(toKey: (T) -> K): Map> { return groupByTo(LinkedHashMap>(), toKey) @@ -346,21 +346,21 @@ public inline fun Sequence.groupBy(toKey: (T) -> K): Map> { deprecated("Migrate to using Sequence and respective functions") /** - * Returns a map of the elements in original collection grouped by the result of given *toKey* function + * Returns a map of the elements in original collection grouped by the result of given [toKey] function. */ public inline fun Stream.groupBy(toKey: (T) -> K): Map> { return groupByTo(LinkedHashMap>(), toKey) } /** - * Returns a map of the elements in original collection grouped by the result of given *toKey* function + * Returns a map of the elements in original collection grouped by the result of given [toKey] function. */ public inline fun String.groupBy(toKey: (Char) -> K): Map> { return groupByTo(LinkedHashMap>(), toKey) } /** - * Appends elements from original collection grouped by the result of given *toKey* function to the given *map* + * Appends elements from original collection grouped by the result of given [toKey] function to the given [map]. */ public inline fun Array.groupByTo(map: MutableMap>, toKey: (T) -> K): Map> { for (element in this) { @@ -372,7 +372,7 @@ public inline fun Array.groupByTo(map: MutableMap BooleanArray.groupByTo(map: MutableMap>, toKey: (Boolean) -> K): Map> { for (element in this) { @@ -384,7 +384,7 @@ public inline fun BooleanArray.groupByTo(map: MutableMap ByteArray.groupByTo(map: MutableMap>, toKey: (Byte) -> K): Map> { for (element in this) { @@ -396,7 +396,7 @@ public inline fun ByteArray.groupByTo(map: MutableMap>, } /** - * Appends elements from original collection grouped by the result of given *toKey* function to the given *map* + * Appends elements from original collection grouped by the result of given [toKey] function to the given [map]. */ public inline fun CharArray.groupByTo(map: MutableMap>, toKey: (Char) -> K): Map> { for (element in this) { @@ -408,7 +408,7 @@ public inline fun CharArray.groupByTo(map: MutableMap>, } /** - * Appends elements from original collection grouped by the result of given *toKey* function to the given *map* + * Appends elements from original collection grouped by the result of given [toKey] function to the given [map]. */ public inline fun DoubleArray.groupByTo(map: MutableMap>, toKey: (Double) -> K): Map> { for (element in this) { @@ -420,7 +420,7 @@ public inline fun DoubleArray.groupByTo(map: MutableMap FloatArray.groupByTo(map: MutableMap>, toKey: (Float) -> K): Map> { for (element in this) { @@ -432,7 +432,7 @@ public inline fun FloatArray.groupByTo(map: MutableMap } /** - * Appends elements from original collection grouped by the result of given *toKey* function to the given *map* + * Appends elements from original collection grouped by the result of given [toKey] function to the given [map]. */ public inline fun IntArray.groupByTo(map: MutableMap>, toKey: (Int) -> K): Map> { for (element in this) { @@ -444,7 +444,7 @@ public inline fun IntArray.groupByTo(map: MutableMap>, t } /** - * Appends elements from original collection grouped by the result of given *toKey* function to the given *map* + * Appends elements from original collection grouped by the result of given [toKey] function to the given [map]. */ public inline fun LongArray.groupByTo(map: MutableMap>, toKey: (Long) -> K): Map> { for (element in this) { @@ -456,7 +456,7 @@ public inline fun LongArray.groupByTo(map: MutableMap>, } /** - * Appends elements from original collection grouped by the result of given *toKey* function to the given *map* + * Appends elements from original collection grouped by the result of given [toKey] function to the given [map]. */ public inline fun ShortArray.groupByTo(map: MutableMap>, toKey: (Short) -> K): Map> { for (element in this) { @@ -468,7 +468,7 @@ public inline fun ShortArray.groupByTo(map: MutableMap } /** - * Appends elements from original collection grouped by the result of given *toKey* function to the given *map* + * Appends elements from original collection grouped by the result of given [toKey] function to the given [map]. */ public inline fun Iterable.groupByTo(map: MutableMap>, toKey: (T) -> K): Map> { for (element in this) { @@ -480,7 +480,7 @@ public inline fun Iterable.groupByTo(map: MutableMap } /** - * Appends elements from original collection grouped by the result of given *toKey* function to the given *map* + * Appends elements from original collection grouped by the result of given [toKey] function to the given [map]. */ public inline fun Sequence.groupByTo(map: MutableMap>, toKey: (T) -> K): Map> { for (element in this) { @@ -494,7 +494,7 @@ public inline fun Sequence.groupByTo(map: MutableMap deprecated("Migrate to using Sequence and respective functions") /** - * Appends elements from original collection grouped by the result of given *toKey* function to the given *map* + * Appends elements from original collection grouped by the result of given [toKey] function to the given [map]. */ public inline fun Stream.groupByTo(map: MutableMap>, toKey: (T) -> K): Map> { for (element in this) { @@ -506,7 +506,7 @@ public inline fun Stream.groupByTo(map: MutableMap>, } /** - * Appends elements from original collection grouped by the result of given *toKey* function to the given *map* + * Appends elements from original collection grouped by the result of given [toKey] function to the given [map]. */ public inline fun String.groupByTo(map: MutableMap>, toKey: (Char) -> K): Map> { for (element in this) { @@ -518,84 +518,84 @@ public inline fun String.groupByTo(map: MutableMap>, to } /** - * Returns a list containing the results of applying the given *transform* function to each element of the original collection + * Returns a list containing the results of applying the given [transform] function to each element of the original collection. */ public inline fun Array.map(transform: (T) -> R): List { return mapTo(ArrayList(size()), transform) } /** - * Returns a list containing the results of applying the given *transform* function to each element of the original collection + * Returns a list containing the results of applying the given [transform] function to each element of the original collection. */ public inline fun BooleanArray.map(transform: (Boolean) -> R): List { return mapTo(ArrayList(size()), transform) } /** - * Returns a list containing the results of applying the given *transform* function to each element of the original collection + * Returns a list containing the results of applying the given [transform] function to each element of the original collection. */ public inline fun ByteArray.map(transform: (Byte) -> R): List { return mapTo(ArrayList(size()), transform) } /** - * Returns a list containing the results of applying the given *transform* function to each element of the original collection + * Returns a list containing the results of applying the given [transform] function to each element of the original collection. */ public inline fun CharArray.map(transform: (Char) -> R): List { return mapTo(ArrayList(size()), transform) } /** - * Returns a list containing the results of applying the given *transform* function to each element of the original collection + * Returns a list containing the results of applying the given [transform] function to each element of the original collection. */ public inline fun DoubleArray.map(transform: (Double) -> R): List { return mapTo(ArrayList(size()), transform) } /** - * Returns a list containing the results of applying the given *transform* function to each element of the original collection + * Returns a list containing the results of applying the given [transform] function to each element of the original collection. */ public inline fun FloatArray.map(transform: (Float) -> R): List { return mapTo(ArrayList(size()), transform) } /** - * Returns a list containing the results of applying the given *transform* function to each element of the original collection + * Returns a list containing the results of applying the given [transform] function to each element of the original collection. */ public inline fun IntArray.map(transform: (Int) -> R): List { return mapTo(ArrayList(size()), transform) } /** - * Returns a list containing the results of applying the given *transform* function to each element of the original collection + * Returns a list containing the results of applying the given [transform] function to each element of the original collection. */ public inline fun LongArray.map(transform: (Long) -> R): List { return mapTo(ArrayList(size()), transform) } /** - * Returns a list containing the results of applying the given *transform* function to each element of the original collection + * Returns a list containing the results of applying the given [transform] function to each element of the original collection. */ public inline fun ShortArray.map(transform: (Short) -> R): List { return mapTo(ArrayList(size()), transform) } /** - * Returns a list containing the results of applying the given *transform* function to each element of the original collection + * Returns a list containing the results of applying the given [transform] function to each element of the original collection. */ public inline fun Iterable.map(transform: (T) -> R): List { return mapTo(ArrayList(collectionSizeOrDefault(10)), transform) } /** - * Returns a list containing the results of applying the given *transform* function to each element of the original collection + * Returns a list containing the results of applying the given [transform] function to each element of the original collection. */ public inline fun Map.map(transform: (Map.Entry) -> R): List { return mapTo(ArrayList(size()), transform) } /** - * Returns a sequence containing the results of applying the given *transform* function to each element of the original sequence + * Returns a sequence containing the results of applying the given [transform] function to each element of the original sequence. */ public fun Sequence.map(transform: (T) -> R): Sequence { return TransformingSequence(this, transform) @@ -604,91 +604,91 @@ public fun Sequence.map(transform: (T) -> R): Sequence { deprecated("Migrate to using Sequence and respective functions") /** - * Returns a stream containing the results of applying the given *transform* function to each element of the original stream + * Returns a stream containing the results of applying the given [transform] function to each element of the original stream. */ public fun Stream.map(transform: (T) -> R): Stream { return TransformingStream(this, transform) } /** - * Returns a list containing the results of applying the given *transform* function to each element of the original collection + * Returns a list containing the results of applying the given [transform] function to each element of the original collection. */ public inline fun String.map(transform: (Char) -> R): List { return mapTo(ArrayList(length()), transform) } /** - * Returns a list containing the results of applying the given *transform* function to each element and its index of the original collection + * Returns a list containing the results of applying the given [transform] function to each element and its index of the original collection. */ public inline fun Array.mapIndexed(transform: (Int, T) -> R): List { return mapIndexedTo(ArrayList(size()), transform) } /** - * Returns a list containing the results of applying the given *transform* function to each element and its index of the original collection + * Returns a list containing the results of applying the given [transform] function to each element and its index of the original collection. */ public inline fun BooleanArray.mapIndexed(transform: (Int, Boolean) -> R): List { return mapIndexedTo(ArrayList(size()), transform) } /** - * Returns a list containing the results of applying the given *transform* function to each element and its index of the original collection + * Returns a list containing the results of applying the given [transform] function to each element and its index of the original collection. */ public inline fun ByteArray.mapIndexed(transform: (Int, Byte) -> R): List { return mapIndexedTo(ArrayList(size()), transform) } /** - * Returns a list containing the results of applying the given *transform* function to each element and its index of the original collection + * Returns a list containing the results of applying the given [transform] function to each element and its index of the original collection. */ public inline fun CharArray.mapIndexed(transform: (Int, Char) -> R): List { return mapIndexedTo(ArrayList(size()), transform) } /** - * Returns a list containing the results of applying the given *transform* function to each element and its index of the original collection + * Returns a list containing the results of applying the given [transform] function to each element and its index of the original collection. */ public inline fun DoubleArray.mapIndexed(transform: (Int, Double) -> R): List { return mapIndexedTo(ArrayList(size()), transform) } /** - * Returns a list containing the results of applying the given *transform* function to each element and its index of the original collection + * Returns a list containing the results of applying the given [transform] function to each element and its index of the original collection. */ public inline fun FloatArray.mapIndexed(transform: (Int, Float) -> R): List { return mapIndexedTo(ArrayList(size()), transform) } /** - * Returns a list containing the results of applying the given *transform* function to each element and its index of the original collection + * Returns a list containing the results of applying the given [transform] function to each element and its index of the original collection. */ public inline fun IntArray.mapIndexed(transform: (Int, Int) -> R): List { return mapIndexedTo(ArrayList(size()), transform) } /** - * Returns a list containing the results of applying the given *transform* function to each element and its index of the original collection + * Returns a list containing the results of applying the given [transform] function to each element and its index of the original collection. */ public inline fun LongArray.mapIndexed(transform: (Int, Long) -> R): List { return mapIndexedTo(ArrayList(size()), transform) } /** - * Returns a list containing the results of applying the given *transform* function to each element and its index of the original collection + * Returns a list containing the results of applying the given [transform] function to each element and its index of the original collection. */ public inline fun ShortArray.mapIndexed(transform: (Int, Short) -> R): List { return mapIndexedTo(ArrayList(size()), transform) } /** - * Returns a list containing the results of applying the given *transform* function to each element and its index of the original collection + * Returns a list containing the results of applying the given [transform] function to each element and its index of the original collection. */ public inline fun Iterable.mapIndexed(transform: (Int, T) -> R): List { return mapIndexedTo(ArrayList(collectionSizeOrDefault(10)), transform) } /** - * Returns a sequence containing the results of applying the given *transform* function to each element and its index of the original sequence + * Returns a sequence containing the results of applying the given [transform] function to each element and its index of the original sequence. */ public fun Sequence.mapIndexed(transform: (Int, T) -> R): Sequence { return TransformingIndexedSequence(this, transform) @@ -697,22 +697,22 @@ public fun Sequence.mapIndexed(transform: (Int, T) -> R): Sequence deprecated("Migrate to using Sequence and respective functions") /** - * Returns a stream containing the results of applying the given *transform* function to each element and its index of the original stream + * Returns a stream containing the results of applying the given [transform] function to each element and its index of the original stream. */ public fun Stream.mapIndexed(transform: (Int, T) -> R): Stream { return TransformingIndexedStream(this, transform) } /** - * Returns a list containing the results of applying the given *transform* function to each element and its index of the original collection + * Returns a list containing the results of applying the given [transform] function to each element and its index of the original collection. */ public inline fun String.mapIndexed(transform: (Int, Char) -> R): List { return mapIndexedTo(ArrayList(length()), transform) } /** - * Appends transformed elements and their indices of the original collection using the given *transform* function - * to the given *destination* + * Appends transformed elements and their indices of the original collection using the given [transform] function + * to the given [destination]. */ public inline fun > Array.mapIndexedTo(destination: C, transform: (Int, T) -> R): C { var index = 0 @@ -722,8 +722,8 @@ public inline fun > Array.mapIndexedTo( } /** - * Appends transformed elements and their indices of the original collection using the given *transform* function - * to the given *destination* + * Appends transformed elements and their indices of the original collection using the given [transform] function + * to the given [destination]. */ public inline fun > BooleanArray.mapIndexedTo(destination: C, transform: (Int, Boolean) -> R): C { var index = 0 @@ -733,8 +733,8 @@ public inline fun > BooleanArray.mapIndexedTo(des } /** - * Appends transformed elements and their indices of the original collection using the given *transform* function - * to the given *destination* + * Appends transformed elements and their indices of the original collection using the given [transform] function + * to the given [destination]. */ public inline fun > ByteArray.mapIndexedTo(destination: C, transform: (Int, Byte) -> R): C { var index = 0 @@ -744,8 +744,8 @@ public inline fun > ByteArray.mapIndexedTo(destin } /** - * Appends transformed elements and their indices of the original collection using the given *transform* function - * to the given *destination* + * Appends transformed elements and their indices of the original collection using the given [transform] function + * to the given [destination]. */ public inline fun > CharArray.mapIndexedTo(destination: C, transform: (Int, Char) -> R): C { var index = 0 @@ -755,8 +755,8 @@ public inline fun > CharArray.mapIndexedTo(destin } /** - * Appends transformed elements and their indices of the original collection using the given *transform* function - * to the given *destination* + * Appends transformed elements and their indices of the original collection using the given [transform] function + * to the given [destination]. */ public inline fun > DoubleArray.mapIndexedTo(destination: C, transform: (Int, Double) -> R): C { var index = 0 @@ -766,8 +766,8 @@ public inline fun > DoubleArray.mapIndexedTo(dest } /** - * Appends transformed elements and their indices of the original collection using the given *transform* function - * to the given *destination* + * Appends transformed elements and their indices of the original collection using the given [transform] function + * to the given [destination]. */ public inline fun > FloatArray.mapIndexedTo(destination: C, transform: (Int, Float) -> R): C { var index = 0 @@ -777,8 +777,8 @@ public inline fun > FloatArray.mapIndexedTo(desti } /** - * Appends transformed elements and their indices of the original collection using the given *transform* function - * to the given *destination* + * Appends transformed elements and their indices of the original collection using the given [transform] function + * to the given [destination]. */ public inline fun > IntArray.mapIndexedTo(destination: C, transform: (Int, Int) -> R): C { var index = 0 @@ -788,8 +788,8 @@ public inline fun > IntArray.mapIndexedTo(destina } /** - * Appends transformed elements and their indices of the original collection using the given *transform* function - * to the given *destination* + * Appends transformed elements and their indices of the original collection using the given [transform] function + * to the given [destination]. */ public inline fun > LongArray.mapIndexedTo(destination: C, transform: (Int, Long) -> R): C { var index = 0 @@ -799,8 +799,8 @@ public inline fun > LongArray.mapIndexedTo(destin } /** - * Appends transformed elements and their indices of the original collection using the given *transform* function - * to the given *destination* + * Appends transformed elements and their indices of the original collection using the given [transform] function + * to the given [destination]. */ public inline fun > ShortArray.mapIndexedTo(destination: C, transform: (Int, Short) -> R): C { var index = 0 @@ -810,8 +810,8 @@ public inline fun > ShortArray.mapIndexedTo(desti } /** - * Appends transformed elements and their indices of the original collection using the given *transform* function - * to the given *destination* + * Appends transformed elements and their indices of the original collection using the given [transform] function + * to the given [destination]. */ public inline fun > Iterable.mapIndexedTo(destination: C, transform: (Int, T) -> R): C { var index = 0 @@ -821,8 +821,8 @@ public inline fun > Iterable.mapIndexedTo(d } /** - * Appends transformed elements and their indices of the original collection using the given *transform* function - * to the given *destination* + * Appends transformed elements and their indices of the original collection using the given [transform] function + * to the given [destination]. */ public inline fun > Map.mapIndexedTo(destination: C, transform: (Int, Map.Entry) -> R): C { var index = 0 @@ -832,8 +832,8 @@ public inline fun > Map.mapIndexedTo( } /** - * Appends transformed elements and their indices of the original collection using the given *transform* function - * to the given *destination* + * Appends transformed elements and their indices of the original collection using the given [transform] function + * to the given [destination]. */ public inline fun > Sequence.mapIndexedTo(destination: C, transform: (Int, T) -> R): C { var index = 0 @@ -845,8 +845,8 @@ public inline fun > Sequence.mapIndexedTo(d deprecated("Migrate to using Sequence and respective functions") /** - * Appends transformed elements and their indices of the original collection using the given *transform* function - * to the given *destination* + * Appends transformed elements and their indices of the original collection using the given [transform] function + * to the given [destination]. */ public inline fun > Stream.mapIndexedTo(destination: C, transform: (Int, T) -> R): C { var index = 0 @@ -856,8 +856,8 @@ public inline fun > Stream.mapIndexedTo(des } /** - * Appends transformed elements and their indices of the original collection using the given *transform* function - * to the given *destination* + * Appends transformed elements and their indices of the original collection using the given [transform] function + * to the given [destination]. */ public inline fun > String.mapIndexedTo(destination: C, transform: (Int, Char) -> R): C { var index = 0 @@ -867,21 +867,21 @@ public inline fun > String.mapIndexedTo(destinati } /** - * Returns a list containing the results of applying the given *transform* function to each non-null element of the original collection + * Returns a list containing the results of applying the given [transform] function to each non-null element of the original collection. */ public inline fun Array.mapNotNull(transform: (T) -> R): List { return mapNotNullTo(ArrayList(), transform) } /** - * Returns a list containing the results of applying the given *transform* function to each non-null element of the original collection + * Returns a list containing the results of applying the given [transform] function to each non-null element of the original collection. */ public inline fun Iterable.mapNotNull(transform: (T) -> R): List { return mapNotNullTo(ArrayList(), transform) } /** - * Returns a sequence containing the results of applying the given *transform* function to each non-null element of the original sequence + * Returns a sequence containing the results of applying the given [transform] function to each non-null element of the original sequence. */ public fun Sequence.mapNotNull(transform: (T) -> R): Sequence { return TransformingSequence(FilteringSequence(this, false, { it == null }) as Sequence, transform) @@ -890,15 +890,15 @@ public fun Sequence.mapNotNull(transform: (T) -> R): Sequence and respective functions") /** - * Returns a stream containing the results of applying the given *transform* function to each non-null element of the original stream + * Returns a stream containing the results of applying the given [transform] function to each non-null element of the original stream. */ public fun Stream.mapNotNull(transform: (T) -> R): Stream { return TransformingStream(FilteringStream(this, false, { it == null }) as Stream, transform) } /** - * Appends transformed non-null elements of original collection using the given *transform* function - * to the given *destination* + * Appends transformed non-null elements of original collection using the given [transform] function + * to the given [destination]. */ public inline fun > Array.mapNotNullTo(destination: C, transform: (T) -> R): C { for (element in this) { @@ -910,8 +910,8 @@ public inline fun > Array.mapNot } /** - * Appends transformed non-null elements of original collection using the given *transform* function - * to the given *destination* + * Appends transformed non-null elements of original collection using the given [transform] function + * to the given [destination]. */ public inline fun > Iterable.mapNotNullTo(destination: C, transform: (T) -> R): C { for (element in this) { @@ -923,8 +923,8 @@ public inline fun > Iterable.mapNotN } /** - * Appends transformed non-null elements of original collection using the given *transform* function - * to the given *destination* + * Appends transformed non-null elements of original collection using the given [transform] function + * to the given [destination]. */ public inline fun > Sequence.mapNotNullTo(destination: C, transform: (T) -> R): C { for (element in this) { @@ -938,8 +938,8 @@ public inline fun > Sequence.mapNotN deprecated("Migrate to using Sequence and respective functions") /** - * Appends transformed non-null elements of original collection using the given *transform* function - * to the given *destination* + * Appends transformed non-null elements of original collection using the given [transform] function + * to the given [destination]. */ public inline fun > Stream.mapNotNullTo(destination: C, transform: (T) -> R): C { for (element in this) { @@ -951,8 +951,8 @@ public inline fun > Stream.mapNotNul } /** - * Appends transformed elements of the original collection using the given *transform* function - * to the given *destination* + * Appends transformed elements of the original collection using the given [transform] function + * to the given [destination]. */ public inline fun > Array.mapTo(destination: C, transform: (T) -> R): C { for (item in this) @@ -961,8 +961,8 @@ public inline fun > Array.mapTo(destina } /** - * Appends transformed elements of the original collection using the given *transform* function - * to the given *destination* + * Appends transformed elements of the original collection using the given [transform] function + * to the given [destination]. */ public inline fun > BooleanArray.mapTo(destination: C, transform: (Boolean) -> R): C { for (item in this) @@ -971,8 +971,8 @@ public inline fun > BooleanArray.mapTo(destinatio } /** - * Appends transformed elements of the original collection using the given *transform* function - * to the given *destination* + * Appends transformed elements of the original collection using the given [transform] function + * to the given [destination]. */ public inline fun > ByteArray.mapTo(destination: C, transform: (Byte) -> R): C { for (item in this) @@ -981,8 +981,8 @@ public inline fun > ByteArray.mapTo(destination: } /** - * Appends transformed elements of the original collection using the given *transform* function - * to the given *destination* + * Appends transformed elements of the original collection using the given [transform] function + * to the given [destination]. */ public inline fun > CharArray.mapTo(destination: C, transform: (Char) -> R): C { for (item in this) @@ -991,8 +991,8 @@ public inline fun > CharArray.mapTo(destination: } /** - * Appends transformed elements of the original collection using the given *transform* function - * to the given *destination* + * Appends transformed elements of the original collection using the given [transform] function + * to the given [destination]. */ public inline fun > DoubleArray.mapTo(destination: C, transform: (Double) -> R): C { for (item in this) @@ -1001,8 +1001,8 @@ public inline fun > DoubleArray.mapTo(destination } /** - * Appends transformed elements of the original collection using the given *transform* function - * to the given *destination* + * Appends transformed elements of the original collection using the given [transform] function + * to the given [destination]. */ public inline fun > FloatArray.mapTo(destination: C, transform: (Float) -> R): C { for (item in this) @@ -1011,8 +1011,8 @@ public inline fun > FloatArray.mapTo(destination: } /** - * Appends transformed elements of the original collection using the given *transform* function - * to the given *destination* + * Appends transformed elements of the original collection using the given [transform] function + * to the given [destination]. */ public inline fun > IntArray.mapTo(destination: C, transform: (Int) -> R): C { for (item in this) @@ -1021,8 +1021,8 @@ public inline fun > IntArray.mapTo(destination: C } /** - * Appends transformed elements of the original collection using the given *transform* function - * to the given *destination* + * Appends transformed elements of the original collection using the given [transform] function + * to the given [destination]. */ public inline fun > LongArray.mapTo(destination: C, transform: (Long) -> R): C { for (item in this) @@ -1031,8 +1031,8 @@ public inline fun > LongArray.mapTo(destination: } /** - * Appends transformed elements of the original collection using the given *transform* function - * to the given *destination* + * Appends transformed elements of the original collection using the given [transform] function + * to the given [destination]. */ public inline fun > ShortArray.mapTo(destination: C, transform: (Short) -> R): C { for (item in this) @@ -1041,8 +1041,8 @@ public inline fun > ShortArray.mapTo(destination: } /** - * Appends transformed elements of the original collection using the given *transform* function - * to the given *destination* + * Appends transformed elements of the original collection using the given [transform] function + * to the given [destination]. */ public inline fun > Iterable.mapTo(destination: C, transform: (T) -> R): C { for (item in this) @@ -1051,8 +1051,8 @@ public inline fun > Iterable.mapTo(destinat } /** - * Appends transformed elements of the original collection using the given *transform* function - * to the given *destination* + * Appends transformed elements of the original collection using the given [transform] function + * to the given [destination]. */ public inline fun > Map.mapTo(destination: C, transform: (Map.Entry) -> R): C { for (item in this) @@ -1061,8 +1061,8 @@ public inline fun > Map.mapTo(destina } /** - * Appends transformed elements of the original collection using the given *transform* function - * to the given *destination* + * Appends transformed elements of the original collection using the given [transform] function + * to the given [destination]. */ public inline fun > Sequence.mapTo(destination: C, transform: (T) -> R): C { for (item in this) @@ -1073,8 +1073,8 @@ public inline fun > Sequence.mapTo(destinat deprecated("Migrate to using Sequence and respective functions") /** - * Appends transformed elements of the original collection using the given *transform* function - * to the given *destination* + * Appends transformed elements of the original collection using the given [transform] function + * to the given [destination]. */ public inline fun > Stream.mapTo(destination: C, transform: (T) -> R): C { for (item in this) @@ -1083,8 +1083,8 @@ public inline fun > Stream.mapTo(destinatio } /** - * Appends transformed elements of the original collection using the given *transform* function - * to the given *destination* + * Appends transformed elements of the original collection using the given [transform] function + * to the given [destination]. */ public inline fun > String.mapTo(destination: C, transform: (Char) -> R): C { for (item in this) @@ -1093,77 +1093,77 @@ public inline fun > String.mapTo(destination: C, } /** - * Returns a lazy [Iterable] of [IndexedValue] for each element of the original collection + * Returns a lazy [Iterable] of [IndexedValue] for each element of the original collection. */ public fun Array.withIndex(): Iterable> { return IndexingIterable { iterator() } } /** - * Returns a lazy [Iterable] of [IndexedValue] for each element of the original collection + * Returns a lazy [Iterable] of [IndexedValue] for each element of the original collection. */ public fun BooleanArray.withIndex(): Iterable> { return IndexingIterable { iterator() } } /** - * Returns a lazy [Iterable] of [IndexedValue] for each element of the original collection + * Returns a lazy [Iterable] of [IndexedValue] for each element of the original collection. */ public fun ByteArray.withIndex(): Iterable> { return IndexingIterable { iterator() } } /** - * Returns a lazy [Iterable] of [IndexedValue] for each element of the original collection + * Returns a lazy [Iterable] of [IndexedValue] for each element of the original collection. */ public fun CharArray.withIndex(): Iterable> { return IndexingIterable { iterator() } } /** - * Returns a lazy [Iterable] of [IndexedValue] for each element of the original collection + * Returns a lazy [Iterable] of [IndexedValue] for each element of the original collection. */ public fun DoubleArray.withIndex(): Iterable> { return IndexingIterable { iterator() } } /** - * Returns a lazy [Iterable] of [IndexedValue] for each element of the original collection + * Returns a lazy [Iterable] of [IndexedValue] for each element of the original collection. */ public fun FloatArray.withIndex(): Iterable> { return IndexingIterable { iterator() } } /** - * Returns a lazy [Iterable] of [IndexedValue] for each element of the original collection + * Returns a lazy [Iterable] of [IndexedValue] for each element of the original collection. */ public fun IntArray.withIndex(): Iterable> { return IndexingIterable { iterator() } } /** - * Returns a lazy [Iterable] of [IndexedValue] for each element of the original collection + * Returns a lazy [Iterable] of [IndexedValue] for each element of the original collection. */ public fun LongArray.withIndex(): Iterable> { return IndexingIterable { iterator() } } /** - * Returns a lazy [Iterable] of [IndexedValue] for each element of the original collection + * Returns a lazy [Iterable] of [IndexedValue] for each element of the original collection. */ public fun ShortArray.withIndex(): Iterable> { return IndexingIterable { iterator() } } /** - * Returns a lazy [Iterable] of [IndexedValue] for each element of the original collection + * Returns a lazy [Iterable] of [IndexedValue] for each element of the original collection. */ public fun Iterable.withIndex(): Iterable> { return IndexingIterable { iterator() } } /** - * Returns a sequence of [IndexedValue] for each element of the original sequence + * Returns a sequence of [IndexedValue] for each element of the original sequence. */ public fun Sequence.withIndex(): Sequence> { return IndexingSequence(this) @@ -1172,21 +1172,21 @@ public fun Sequence.withIndex(): Sequence> { deprecated("Migrate to using Sequence and respective functions") /** - * Returns a stream of [IndexedValue] for each element of the original stream + * Returns a stream of [IndexedValue] for each element of the original stream. */ public fun Stream.withIndex(): Stream> { return IndexingStream(this) } /** - * Returns a lazy [Iterable] of [IndexedValue] for each element of the original collection + * Returns a lazy [Iterable] of [IndexedValue] for each element of the original collection. */ public fun String.withIndex(): Iterable> { return IndexingIterable { iterator() } } /** - * Returns a list containing pairs of each element of the original collection and their index + * Returns a list containing pairs of each element of the original collection and their index. */ deprecated("Use withIndex() instead.") public fun Array.withIndices(): List> { @@ -1195,7 +1195,7 @@ public fun Array.withIndices(): List> { } /** - * Returns a list containing pairs of each element of the original collection and their index + * Returns a list containing pairs of each element of the original collection and their index. */ deprecated("Use withIndex() instead.") public fun BooleanArray.withIndices(): List> { @@ -1204,7 +1204,7 @@ public fun BooleanArray.withIndices(): List> { } /** - * Returns a list containing pairs of each element of the original collection and their index + * Returns a list containing pairs of each element of the original collection and their index. */ deprecated("Use withIndex() instead.") public fun ByteArray.withIndices(): List> { @@ -1213,7 +1213,7 @@ public fun ByteArray.withIndices(): List> { } /** - * Returns a list containing pairs of each element of the original collection and their index + * Returns a list containing pairs of each element of the original collection and their index. */ deprecated("Use withIndex() instead.") public fun CharArray.withIndices(): List> { @@ -1222,7 +1222,7 @@ public fun CharArray.withIndices(): List> { } /** - * Returns a list containing pairs of each element of the original collection and their index + * Returns a list containing pairs of each element of the original collection and their index. */ deprecated("Use withIndex() instead.") public fun DoubleArray.withIndices(): List> { @@ -1231,7 +1231,7 @@ public fun DoubleArray.withIndices(): List> { } /** - * Returns a list containing pairs of each element of the original collection and their index + * Returns a list containing pairs of each element of the original collection and their index. */ deprecated("Use withIndex() instead.") public fun FloatArray.withIndices(): List> { @@ -1240,7 +1240,7 @@ public fun FloatArray.withIndices(): List> { } /** - * Returns a list containing pairs of each element of the original collection and their index + * Returns a list containing pairs of each element of the original collection and their index. */ deprecated("Use withIndex() instead.") public fun IntArray.withIndices(): List> { @@ -1249,7 +1249,7 @@ public fun IntArray.withIndices(): List> { } /** - * Returns a list containing pairs of each element of the original collection and their index + * Returns a list containing pairs of each element of the original collection and their index. */ deprecated("Use withIndex() instead.") public fun LongArray.withIndices(): List> { @@ -1258,7 +1258,7 @@ public fun LongArray.withIndices(): List> { } /** - * Returns a list containing pairs of each element of the original collection and their index + * Returns a list containing pairs of each element of the original collection and their index. */ deprecated("Use withIndex() instead.") public fun ShortArray.withIndices(): List> { @@ -1267,7 +1267,7 @@ public fun ShortArray.withIndices(): List> { } /** - * Returns a list containing pairs of each element of the original collection and their index + * Returns a list containing pairs of each element of the original collection and their index. */ deprecated("Use withIndex() instead.") public fun Iterable.withIndices(): List> { @@ -1276,7 +1276,7 @@ public fun Iterable.withIndices(): List> { } /** - * Returns a sequence containing pairs of each element of the original collection and their index + * Returns a sequence containing pairs of each element of the original collection and their index. */ deprecated("Use withIndex() instead.") public fun Sequence.withIndices(): Sequence> { @@ -1286,7 +1286,7 @@ public fun Sequence.withIndices(): Sequence> { /** - * Returns a stream containing pairs of each element of the original collection and their index + * Returns a stream containing pairs of each element of the original collection and their index. */ deprecated("Use withIndex() instead.") public fun Stream.withIndices(): Stream> { @@ -1295,7 +1295,7 @@ public fun Stream.withIndices(): Stream> { } /** - * Returns a list containing pairs of each element of the original collection and their index + * Returns a list containing pairs of each element of the original collection and their index. */ deprecated("Use withIndex() instead.") public fun String.withIndices(): List> { diff --git a/libraries/stdlib/src/generated/_Numeric.kt b/libraries/stdlib/src/generated/_Numeric.kt index 40bd9d35c4f..06dd2884a75 100644 --- a/libraries/stdlib/src/generated/_Numeric.kt +++ b/libraries/stdlib/src/generated/_Numeric.kt @@ -11,7 +11,7 @@ import java.util.* import java.util.Collections // TODO: it's temporary while we have java.util.Collections in js /** - * Returns an average value of elements in the collection + * Returns an average value of elements in the collection. */ platformName("averageOfInt") public fun Iterable.average(): Double { @@ -26,7 +26,7 @@ public fun Iterable.average(): Double { } /** - * Returns an average value of elements in the collection + * Returns an average value of elements in the collection. */ platformName("averageOfInt") public fun Sequence.average(): Double { @@ -43,7 +43,7 @@ public fun Sequence.average(): Double { deprecated("Migrate to using Sequence and respective functions") /** - * Returns an average value of elements in the collection + * Returns an average value of elements in the collection. */ platformName("averageOfInt") public fun Stream.average(): Double { @@ -58,7 +58,7 @@ public fun Stream.average(): Double { } /** - * Returns an average value of elements in the collection + * Returns an average value of elements in the collection. */ platformName("averageOfInt") public fun Array.average(): Double { @@ -73,7 +73,7 @@ public fun Array.average(): Double { } /** - * Returns an average value of elements in the collection + * Returns an average value of elements in the collection. */ public fun IntArray.average(): Double { val iterator = iterator() @@ -87,7 +87,7 @@ public fun IntArray.average(): Double { } /** - * Returns an average value of elements in the collection + * Returns an average value of elements in the collection. */ platformName("averageOfLong") public fun Iterable.average(): Double { @@ -102,7 +102,7 @@ public fun Iterable.average(): Double { } /** - * Returns an average value of elements in the collection + * Returns an average value of elements in the collection. */ platformName("averageOfLong") public fun Sequence.average(): Double { @@ -119,7 +119,7 @@ public fun Sequence.average(): Double { deprecated("Migrate to using Sequence and respective functions") /** - * Returns an average value of elements in the collection + * Returns an average value of elements in the collection. */ platformName("averageOfLong") public fun Stream.average(): Double { @@ -134,7 +134,7 @@ public fun Stream.average(): Double { } /** - * Returns an average value of elements in the collection + * Returns an average value of elements in the collection. */ platformName("averageOfLong") public fun Array.average(): Double { @@ -149,7 +149,7 @@ public fun Array.average(): Double { } /** - * Returns an average value of elements in the collection + * Returns an average value of elements in the collection. */ public fun LongArray.average(): Double { val iterator = iterator() @@ -163,7 +163,7 @@ public fun LongArray.average(): Double { } /** - * Returns an average value of elements in the collection + * Returns an average value of elements in the collection. */ platformName("averageOfByte") public fun Iterable.average(): Double { @@ -178,7 +178,7 @@ public fun Iterable.average(): Double { } /** - * Returns an average value of elements in the collection + * Returns an average value of elements in the collection. */ platformName("averageOfByte") public fun Sequence.average(): Double { @@ -195,7 +195,7 @@ public fun Sequence.average(): Double { deprecated("Migrate to using Sequence and respective functions") /** - * Returns an average value of elements in the collection + * Returns an average value of elements in the collection. */ platformName("averageOfByte") public fun Stream.average(): Double { @@ -210,7 +210,7 @@ public fun Stream.average(): Double { } /** - * Returns an average value of elements in the collection + * Returns an average value of elements in the collection. */ platformName("averageOfByte") public fun Array.average(): Double { @@ -225,7 +225,7 @@ public fun Array.average(): Double { } /** - * Returns an average value of elements in the collection + * Returns an average value of elements in the collection. */ public fun ByteArray.average(): Double { val iterator = iterator() @@ -239,7 +239,7 @@ public fun ByteArray.average(): Double { } /** - * Returns an average value of elements in the collection + * Returns an average value of elements in the collection. */ platformName("averageOfShort") public fun Iterable.average(): Double { @@ -254,7 +254,7 @@ public fun Iterable.average(): Double { } /** - * Returns an average value of elements in the collection + * Returns an average value of elements in the collection. */ platformName("averageOfShort") public fun Sequence.average(): Double { @@ -271,7 +271,7 @@ public fun Sequence.average(): Double { deprecated("Migrate to using Sequence and respective functions") /** - * Returns an average value of elements in the collection + * Returns an average value of elements in the collection. */ platformName("averageOfShort") public fun Stream.average(): Double { @@ -286,7 +286,7 @@ public fun Stream.average(): Double { } /** - * Returns an average value of elements in the collection + * Returns an average value of elements in the collection. */ platformName("averageOfShort") public fun Array.average(): Double { @@ -301,7 +301,7 @@ public fun Array.average(): Double { } /** - * Returns an average value of elements in the collection + * Returns an average value of elements in the collection. */ public fun ShortArray.average(): Double { val iterator = iterator() @@ -315,7 +315,7 @@ public fun ShortArray.average(): Double { } /** - * Returns an average value of elements in the collection + * Returns an average value of elements in the collection. */ platformName("averageOfDouble") public fun Iterable.average(): Double { @@ -330,7 +330,7 @@ public fun Iterable.average(): Double { } /** - * Returns an average value of elements in the collection + * Returns an average value of elements in the collection. */ platformName("averageOfDouble") public fun Sequence.average(): Double { @@ -347,7 +347,7 @@ public fun Sequence.average(): Double { deprecated("Migrate to using Sequence and respective functions") /** - * Returns an average value of elements in the collection + * Returns an average value of elements in the collection. */ platformName("averageOfDouble") public fun Stream.average(): Double { @@ -362,7 +362,7 @@ public fun Stream.average(): Double { } /** - * Returns an average value of elements in the collection + * Returns an average value of elements in the collection. */ platformName("averageOfDouble") public fun Array.average(): Double { @@ -377,7 +377,7 @@ public fun Array.average(): Double { } /** - * Returns an average value of elements in the collection + * Returns an average value of elements in the collection. */ public fun DoubleArray.average(): Double { val iterator = iterator() @@ -391,7 +391,7 @@ public fun DoubleArray.average(): Double { } /** - * Returns an average value of elements in the collection + * Returns an average value of elements in the collection. */ platformName("averageOfFloat") public fun Iterable.average(): Double { @@ -406,7 +406,7 @@ public fun Iterable.average(): Double { } /** - * Returns an average value of elements in the collection + * Returns an average value of elements in the collection. */ platformName("averageOfFloat") public fun Sequence.average(): Double { @@ -423,7 +423,7 @@ public fun Sequence.average(): Double { deprecated("Migrate to using Sequence and respective functions") /** - * Returns an average value of elements in the collection + * Returns an average value of elements in the collection. */ platformName("averageOfFloat") public fun Stream.average(): Double { @@ -438,7 +438,7 @@ public fun Stream.average(): Double { } /** - * Returns an average value of elements in the collection + * Returns an average value of elements in the collection. */ platformName("averageOfFloat") public fun Array.average(): Double { @@ -453,7 +453,7 @@ public fun Array.average(): Double { } /** - * Returns an average value of elements in the collection + * Returns an average value of elements in the collection. */ public fun FloatArray.average(): Double { val iterator = iterator() diff --git a/libraries/stdlib/src/generated/_Ordering.kt b/libraries/stdlib/src/generated/_Ordering.kt index e2bf5091a23..1c06521a4ca 100644 --- a/libraries/stdlib/src/generated/_Ordering.kt +++ b/libraries/stdlib/src/generated/_Ordering.kt @@ -11,7 +11,7 @@ import java.util.* import java.util.Collections // TODO: it's temporary while we have java.util.Collections in js /** - * Returns a list with elements in reversed order + * Returns a list with elements in reversed order. */ public fun Array.reverse(): List { val list = toArrayList() @@ -20,7 +20,7 @@ public fun Array.reverse(): List { } /** - * Returns a list with elements in reversed order + * Returns a list with elements in reversed order. */ public fun BooleanArray.reverse(): List { val list = toArrayList() @@ -29,7 +29,7 @@ public fun BooleanArray.reverse(): List { } /** - * Returns a list with elements in reversed order + * Returns a list with elements in reversed order. */ public fun ByteArray.reverse(): List { val list = toArrayList() @@ -38,7 +38,7 @@ public fun ByteArray.reverse(): List { } /** - * Returns a list with elements in reversed order + * Returns a list with elements in reversed order. */ public fun CharArray.reverse(): List { val list = toArrayList() @@ -47,7 +47,7 @@ public fun CharArray.reverse(): List { } /** - * Returns a list with elements in reversed order + * Returns a list with elements in reversed order. */ public fun DoubleArray.reverse(): List { val list = toArrayList() @@ -56,7 +56,7 @@ public fun DoubleArray.reverse(): List { } /** - * Returns a list with elements in reversed order + * Returns a list with elements in reversed order. */ public fun FloatArray.reverse(): List { val list = toArrayList() @@ -65,7 +65,7 @@ public fun FloatArray.reverse(): List { } /** - * Returns a list with elements in reversed order + * Returns a list with elements in reversed order. */ public fun IntArray.reverse(): List { val list = toArrayList() @@ -74,7 +74,7 @@ public fun IntArray.reverse(): List { } /** - * Returns a list with elements in reversed order + * Returns a list with elements in reversed order. */ public fun LongArray.reverse(): List { val list = toArrayList() @@ -83,7 +83,7 @@ public fun LongArray.reverse(): List { } /** - * Returns a list with elements in reversed order + * Returns a list with elements in reversed order. */ public fun ShortArray.reverse(): List { val list = toArrayList() @@ -92,7 +92,7 @@ public fun ShortArray.reverse(): List { } /** - * Returns a list with elements in reversed order + * Returns a list with elements in reversed order. */ public fun Iterable.reverse(): List { val list = toArrayList() @@ -101,14 +101,14 @@ public fun Iterable.reverse(): List { } /** - * Returns a string with characters in reversed order + * Returns a string with characters in reversed order. */ public fun String.reverse(): String { return StringBuilder().append(this).reverse().toString() } /** - * Returns a sorted list of all elements + * Returns a sorted list of all elements. */ public fun > Iterable.sort(): List { val sortedList = toArrayList() @@ -117,7 +117,7 @@ public fun > Iterable.sort(): List { } /** - * Returns a list of all elements, sorted by the specified *comparator* + * Returns a list of all elements, sorted by the specified [comparator]. */ public fun Array.sortBy(comparator: Comparator): List { val sortedList = toArrayList() @@ -126,7 +126,7 @@ public fun Array.sortBy(comparator: Comparator): List { } /** - * Returns a list of all elements, sorted by the specified *comparator* + * Returns a list of all elements, sorted by the specified [comparator]. */ public fun Iterable.sortBy(comparator: Comparator): List { val sortedList = toArrayList() @@ -135,7 +135,7 @@ public fun Iterable.sortBy(comparator: Comparator): List { } /** - * Returns a sorted list of all elements, ordered by results of specified *order* function. + * Returns a sorted list of all elements, ordered by results of specified [order] function. */ public inline fun > Array.sortBy(inlineOptions(InlineOption.ONLY_LOCAL_RETURN) order: (T) -> R): List { val sortedList = toArrayList() @@ -145,7 +145,7 @@ public inline fun > Array.sortBy(inlineOptions(Inlin } /** - * Returns a sorted list of all elements, ordered by results of specified *order* function. + * Returns a sorted list of all elements, ordered by results of specified [order] function. */ public inline fun > Iterable.sortBy(inlineOptions(InlineOption.ONLY_LOCAL_RETURN) order: (T) -> R): List { val sortedList = toArrayList() @@ -155,7 +155,7 @@ public inline fun > Iterable.sortBy(inlineOptions(Inline } /** - * Returns a sorted list of all elements, in descending order + * Returns a sorted list of all elements, in descending order. */ public fun > Iterable.sortDescending(): List { val sortedList = toArrayList() @@ -164,7 +164,7 @@ public fun > Iterable.sortDescending(): List { } /** - * Returns a sorted list of all elements, in descending order by results of specified *order* function. + * Returns a sorted list of all elements, in descending order by results of specified [order] function. */ public inline fun > Array.sortDescendingBy(inlineOptions(InlineOption.ONLY_LOCAL_RETURN) order: (T) -> R): List { val sortedList = toArrayList() @@ -174,7 +174,7 @@ public inline fun > Array.sortDescendingBy(inlineOpt } /** - * Returns a sorted list of all elements, in descending order by results of specified *order* function. + * Returns a sorted list of all elements, in descending order by results of specified [order] function. */ public inline fun > Iterable.sortDescendingBy(inlineOptions(InlineOption.ONLY_LOCAL_RETURN) order: (T) -> R): List { val sortedList = toArrayList() @@ -184,7 +184,7 @@ public inline fun > Iterable.sortDescendingBy(inlineOpti } /** - * Returns a sorted list of all elements + * Returns a sorted list of all elements. */ public fun > Array.toSortedList(): List { val sortedList = toArrayList() @@ -193,7 +193,7 @@ public fun > Array.toSortedList(): List { } /** - * Returns a sorted list of all elements + * Returns a sorted list of all elements. */ public fun BooleanArray.toSortedList(): List { val sortedList = toArrayList() @@ -202,7 +202,7 @@ public fun BooleanArray.toSortedList(): List { } /** - * Returns a sorted list of all elements + * Returns a sorted list of all elements. */ public fun ByteArray.toSortedList(): List { val sortedList = toArrayList() @@ -211,7 +211,7 @@ public fun ByteArray.toSortedList(): List { } /** - * Returns a sorted list of all elements + * Returns a sorted list of all elements. */ public fun CharArray.toSortedList(): List { val sortedList = toArrayList() @@ -220,7 +220,7 @@ public fun CharArray.toSortedList(): List { } /** - * Returns a sorted list of all elements + * Returns a sorted list of all elements. */ public fun DoubleArray.toSortedList(): List { val sortedList = toArrayList() @@ -229,7 +229,7 @@ public fun DoubleArray.toSortedList(): List { } /** - * Returns a sorted list of all elements + * Returns a sorted list of all elements. */ public fun FloatArray.toSortedList(): List { val sortedList = toArrayList() @@ -238,7 +238,7 @@ public fun FloatArray.toSortedList(): List { } /** - * Returns a sorted list of all elements + * Returns a sorted list of all elements. */ public fun IntArray.toSortedList(): List { val sortedList = toArrayList() @@ -247,7 +247,7 @@ public fun IntArray.toSortedList(): List { } /** - * Returns a sorted list of all elements + * Returns a sorted list of all elements. */ public fun LongArray.toSortedList(): List { val sortedList = toArrayList() @@ -256,7 +256,7 @@ public fun LongArray.toSortedList(): List { } /** - * Returns a sorted list of all elements + * Returns a sorted list of all elements. */ public fun ShortArray.toSortedList(): List { val sortedList = toArrayList() @@ -265,7 +265,7 @@ public fun ShortArray.toSortedList(): List { } /** - * Returns a sorted list of all elements + * Returns a sorted list of all elements. */ public fun > Iterable.toSortedList(): List { val sortedList = toArrayList() @@ -274,7 +274,7 @@ public fun > Iterable.toSortedList(): List { } /** - * Returns a sorted list of all elements + * Returns a sorted list of all elements. */ public fun > Sequence.toSortedList(): List { val sortedList = toArrayList() @@ -285,7 +285,7 @@ public fun > Sequence.toSortedList(): List { deprecated("Migrate to using Sequence and respective functions") /** - * Returns a sorted list of all elements + * Returns a sorted list of all elements. */ public fun > Stream.toSortedList(): List { val sortedList = toArrayList() @@ -294,7 +294,7 @@ public fun > Stream.toSortedList(): List { } /** - * Returns a sorted list of all elements, ordered by results of specified *order* function. + * Returns a sorted list of all elements, ordered by results of specified [order] function. */ public fun > Array.toSortedListBy(order: (T) -> V): List { val sortedList = toArrayList() @@ -304,7 +304,7 @@ public fun > Array.toSortedListBy(order: (T) -> V): } /** - * Returns a sorted list of all elements, ordered by results of specified *order* function. + * Returns a sorted list of all elements, ordered by results of specified [order] function. */ public fun > BooleanArray.toSortedListBy(order: (Boolean) -> V): List { val sortedList = toArrayList() @@ -314,7 +314,7 @@ public fun > BooleanArray.toSortedListBy(order: (Boolean) -> V } /** - * Returns a sorted list of all elements, ordered by results of specified *order* function. + * Returns a sorted list of all elements, ordered by results of specified [order] function. */ public fun > ByteArray.toSortedListBy(order: (Byte) -> V): List { val sortedList = toArrayList() @@ -324,7 +324,7 @@ public fun > ByteArray.toSortedListBy(order: (Byte) -> V): Lis } /** - * Returns a sorted list of all elements, ordered by results of specified *order* function. + * Returns a sorted list of all elements, ordered by results of specified [order] function. */ public fun > CharArray.toSortedListBy(order: (Char) -> V): List { val sortedList = toArrayList() @@ -334,7 +334,7 @@ public fun > CharArray.toSortedListBy(order: (Char) -> V): Lis } /** - * Returns a sorted list of all elements, ordered by results of specified *order* function. + * Returns a sorted list of all elements, ordered by results of specified [order] function. */ public fun > DoubleArray.toSortedListBy(order: (Double) -> V): List { val sortedList = toArrayList() @@ -344,7 +344,7 @@ public fun > DoubleArray.toSortedListBy(order: (Double) -> V): } /** - * Returns a sorted list of all elements, ordered by results of specified *order* function. + * Returns a sorted list of all elements, ordered by results of specified [order] function. */ public fun > FloatArray.toSortedListBy(order: (Float) -> V): List { val sortedList = toArrayList() @@ -354,7 +354,7 @@ public fun > FloatArray.toSortedListBy(order: (Float) -> V): L } /** - * Returns a sorted list of all elements, ordered by results of specified *order* function. + * Returns a sorted list of all elements, ordered by results of specified [order] function. */ public fun > IntArray.toSortedListBy(order: (Int) -> V): List { val sortedList = toArrayList() @@ -364,7 +364,7 @@ public fun > IntArray.toSortedListBy(order: (Int) -> V): List< } /** - * Returns a sorted list of all elements, ordered by results of specified *order* function. + * Returns a sorted list of all elements, ordered by results of specified [order] function. */ public fun > LongArray.toSortedListBy(order: (Long) -> V): List { val sortedList = toArrayList() @@ -374,7 +374,7 @@ public fun > LongArray.toSortedListBy(order: (Long) -> V): Lis } /** - * Returns a sorted list of all elements, ordered by results of specified *order* function. + * Returns a sorted list of all elements, ordered by results of specified [order] function. */ public fun > ShortArray.toSortedListBy(order: (Short) -> V): List { val sortedList = toArrayList() @@ -384,7 +384,7 @@ public fun > ShortArray.toSortedListBy(order: (Short) -> V): L } /** - * Returns a sorted list of all elements, ordered by results of specified *order* function. + * Returns a sorted list of all elements, ordered by results of specified [order] function. */ public fun > Iterable.toSortedListBy(order: (T) -> V): List { val sortedList = toArrayList() @@ -394,7 +394,7 @@ public fun > Iterable.toSortedListBy(order: (T) -> V): L } /** - * Returns a sorted list of all elements, ordered by results of specified *order* function. + * Returns a sorted list of all elements, ordered by results of specified [order] function. */ public fun > Sequence.toSortedListBy(order: (T) -> V): List { val sortedList = toArrayList() @@ -406,7 +406,7 @@ public fun > Sequence.toSortedListBy(order: (T) -> V): L deprecated("Migrate to using Sequence and respective functions") /** - * Returns a sorted list of all elements, ordered by results of specified *order* function. + * Returns a sorted list of all elements, ordered by results of specified [order] function. */ public fun > Stream.toSortedListBy(order: (T) -> V): List { val sortedList = toArrayList() diff --git a/libraries/stdlib/src/generated/_Ranges.kt b/libraries/stdlib/src/generated/_Ranges.kt index ebc0b39be71..0b283ce0a43 100644 --- a/libraries/stdlib/src/generated/_Ranges.kt +++ b/libraries/stdlib/src/generated/_Ranges.kt @@ -11,105 +11,105 @@ import java.util.* import java.util.Collections // TODO: it's temporary while we have java.util.Collections in js /** - * Returns a progression that goes over the same range in the opposite direction with the same step + * Returns a progression that goes over the same range in the opposite direction with the same step. */ public fun ByteProgression.reversed(): ByteProgression { return ByteProgression(end, start, -increment) } /** - * Returns a progression that goes over the same range in the opposite direction with the same step + * Returns a progression that goes over the same range in the opposite direction with the same step. */ public fun CharProgression.reversed(): CharProgression { return CharProgression(end, start, -increment) } /** - * Returns a progression that goes over the same range in the opposite direction with the same step + * Returns a progression that goes over the same range in the opposite direction with the same step. */ public fun DoubleProgression.reversed(): DoubleProgression { return DoubleProgression(end, start, -increment) } /** - * Returns a progression that goes over the same range in the opposite direction with the same step + * Returns a progression that goes over the same range in the opposite direction with the same step. */ public fun FloatProgression.reversed(): FloatProgression { return FloatProgression(end, start, -increment) } /** - * Returns a progression that goes over the same range in the opposite direction with the same step + * Returns a progression that goes over the same range in the opposite direction with the same step. */ public fun IntProgression.reversed(): IntProgression { return IntProgression(end, start, -increment) } /** - * Returns a progression that goes over the same range in the opposite direction with the same step + * Returns a progression that goes over the same range in the opposite direction with the same step. */ public fun LongProgression.reversed(): LongProgression { return LongProgression(end, start, -increment) } /** - * Returns a progression that goes over the same range in the opposite direction with the same step + * Returns a progression that goes over the same range in the opposite direction with the same step. */ public fun ShortProgression.reversed(): ShortProgression { return ShortProgression(end, start, -increment) } /** - * Returns a progression that goes over this range in reverse direction + * Returns a progression that goes over this range in reverse direction. */ public fun ByteRange.reversed(): ByteProgression { return ByteProgression(end, start, -1) } /** - * Returns a progression that goes over this range in reverse direction + * Returns a progression that goes over this range in reverse direction. */ public fun CharRange.reversed(): CharProgression { return CharProgression(end, start, -1) } /** - * Returns a progression that goes over this range in reverse direction + * Returns a progression that goes over this range in reverse direction. */ public fun DoubleRange.reversed(): DoubleProgression { return DoubleProgression(end, start, -1.0) } /** - * Returns a progression that goes over this range in reverse direction + * Returns a progression that goes over this range in reverse direction. */ public fun FloatRange.reversed(): FloatProgression { return FloatProgression(end, start, -1.0f) } /** - * Returns a progression that goes over this range in reverse direction + * Returns a progression that goes over this range in reverse direction. */ public fun IntRange.reversed(): IntProgression { return IntProgression(end, start, -1) } /** - * Returns a progression that goes over this range in reverse direction + * Returns a progression that goes over this range in reverse direction. */ public fun LongRange.reversed(): LongProgression { return LongProgression(end, start, -1.toLong()) } /** - * Returns a progression that goes over this range in reverse direction + * Returns a progression that goes over this range in reverse direction. */ public fun ShortRange.reversed(): ShortProgression { return ShortProgression(end, start, -1) } /** - * Returns a progression that goes over the same range with the given step + * Returns a progression that goes over the same range with the given step. */ public fun ByteProgression.step(step: Int): ByteProgression { checkStepIsPositive(step > 0, step) @@ -117,7 +117,7 @@ public fun ByteProgression.step(step: Int): ByteProgression { } /** - * Returns a progression that goes over the same range with the given step + * Returns a progression that goes over the same range with the given step. */ public fun CharProgression.step(step: Int): CharProgression { checkStepIsPositive(step > 0, step) @@ -125,7 +125,7 @@ public fun CharProgression.step(step: Int): CharProgression { } /** - * Returns a progression that goes over the same range with the given step + * Returns a progression that goes over the same range with the given step. */ public fun DoubleProgression.step(step: Double): DoubleProgression { checkStepIsPositive(step > 0, step) @@ -133,7 +133,7 @@ public fun DoubleProgression.step(step: Double): DoubleProgression { } /** - * Returns a progression that goes over the same range with the given step + * Returns a progression that goes over the same range with the given step. */ public fun FloatProgression.step(step: Float): FloatProgression { checkStepIsPositive(step > 0, step) @@ -141,7 +141,7 @@ public fun FloatProgression.step(step: Float): FloatProgression { } /** - * Returns a progression that goes over the same range with the given step + * Returns a progression that goes over the same range with the given step. */ public fun IntProgression.step(step: Int): IntProgression { checkStepIsPositive(step > 0, step) @@ -149,7 +149,7 @@ public fun IntProgression.step(step: Int): IntProgression { } /** - * Returns a progression that goes over the same range with the given step + * Returns a progression that goes over the same range with the given step. */ public fun LongProgression.step(step: Long): LongProgression { checkStepIsPositive(step > 0, step) @@ -157,7 +157,7 @@ public fun LongProgression.step(step: Long): LongProgression { } /** - * Returns a progression that goes over the same range with the given step + * Returns a progression that goes over the same range with the given step. */ public fun ShortProgression.step(step: Int): ShortProgression { checkStepIsPositive(step > 0, step) @@ -165,7 +165,7 @@ public fun ShortProgression.step(step: Int): ShortProgression { } /** - * Returns a progression that goes over this range with given step + * Returns a progression that goes over this range with given step. */ public fun ByteRange.step(step: Int): ByteProgression { checkStepIsPositive(step > 0, step) @@ -173,7 +173,7 @@ public fun ByteRange.step(step: Int): ByteProgression { } /** - * Returns a progression that goes over this range with given step + * Returns a progression that goes over this range with given step. */ public fun CharRange.step(step: Int): CharProgression { checkStepIsPositive(step > 0, step) @@ -181,25 +181,25 @@ public fun CharRange.step(step: Int): CharProgression { } /** - * Returns a progression that goes over this range with given step + * Returns a progression that goes over this range with given step. */ public fun DoubleRange.step(step: Double): DoubleProgression { - if (step.isNaN()) throw IllegalArgumentException("Step must not be NaN") + if (step.isNaN()) throw IllegalArgumentException("Step must not be NaN.") checkStepIsPositive(step > 0, step) return DoubleProgression(start, end, step) } /** - * Returns a progression that goes over this range with given step + * Returns a progression that goes over this range with given step. */ public fun FloatRange.step(step: Float): FloatProgression { - if (step.isNaN()) throw IllegalArgumentException("Step must not be NaN") + if (step.isNaN()) throw IllegalArgumentException("Step must not be NaN.") checkStepIsPositive(step > 0, step) return FloatProgression(start, end, step) } /** - * Returns a progression that goes over this range with given step + * Returns a progression that goes over this range with given step. */ public fun IntRange.step(step: Int): IntProgression { checkStepIsPositive(step > 0, step) @@ -207,7 +207,7 @@ public fun IntRange.step(step: Int): IntProgression { } /** - * Returns a progression that goes over this range with given step + * Returns a progression that goes over this range with given step. */ public fun LongRange.step(step: Long): LongProgression { checkStepIsPositive(step > 0, step) @@ -215,7 +215,7 @@ public fun LongRange.step(step: Long): LongProgression { } /** - * Returns a progression that goes over this range with given step + * Returns a progression that goes over this range with given step. */ public fun ShortRange.step(step: Int): ShortProgression { checkStepIsPositive(step > 0, step) diff --git a/libraries/stdlib/src/generated/_Sequences.kt b/libraries/stdlib/src/generated/_Sequences.kt index 515aedebb3f..2cd8cc72988 100644 --- a/libraries/stdlib/src/generated/_Sequences.kt +++ b/libraries/stdlib/src/generated/_Sequences.kt @@ -11,7 +11,7 @@ import java.util.* import java.util.Collections // TODO: it's temporary while we have java.util.Collections in js /** - * Returns a sequence from the given collection + * Returns a sequence from the given collection. */ public fun Array.asSequence(): Sequence { return object : Sequence { @@ -22,7 +22,7 @@ public fun Array.asSequence(): Sequence { } /** - * Returns a sequence from the given collection + * Returns a sequence from the given collection. */ public fun BooleanArray.asSequence(): Sequence { return object : Sequence { @@ -33,7 +33,7 @@ public fun BooleanArray.asSequence(): Sequence { } /** - * Returns a sequence from the given collection + * Returns a sequence from the given collection. */ public fun ByteArray.asSequence(): Sequence { return object : Sequence { @@ -44,7 +44,7 @@ public fun ByteArray.asSequence(): Sequence { } /** - * Returns a sequence from the given collection + * Returns a sequence from the given collection. */ public fun CharArray.asSequence(): Sequence { return object : Sequence { @@ -55,7 +55,7 @@ public fun CharArray.asSequence(): Sequence { } /** - * Returns a sequence from the given collection + * Returns a sequence from the given collection. */ public fun DoubleArray.asSequence(): Sequence { return object : Sequence { @@ -66,7 +66,7 @@ public fun DoubleArray.asSequence(): Sequence { } /** - * Returns a sequence from the given collection + * Returns a sequence from the given collection. */ public fun FloatArray.asSequence(): Sequence { return object : Sequence { @@ -77,7 +77,7 @@ public fun FloatArray.asSequence(): Sequence { } /** - * Returns a sequence from the given collection + * Returns a sequence from the given collection. */ public fun IntArray.asSequence(): Sequence { return object : Sequence { @@ -88,7 +88,7 @@ public fun IntArray.asSequence(): Sequence { } /** - * Returns a sequence from the given collection + * Returns a sequence from the given collection. */ public fun LongArray.asSequence(): Sequence { return object : Sequence { @@ -99,7 +99,7 @@ public fun LongArray.asSequence(): Sequence { } /** - * Returns a sequence from the given collection + * Returns a sequence from the given collection. */ public fun ShortArray.asSequence(): Sequence { return object : Sequence { @@ -110,7 +110,7 @@ public fun ShortArray.asSequence(): Sequence { } /** - * Returns a sequence from the given collection + * Returns a sequence from the given collection. */ public fun Iterable.asSequence(): Sequence { return object : Sequence { @@ -121,7 +121,7 @@ public fun Iterable.asSequence(): Sequence { } /** - * Returns a sequence from the given collection + * Returns a sequence from the given collection. */ public fun Map.asSequence(): Sequence> { return object : Sequence> { @@ -132,7 +132,7 @@ public fun Map.asSequence(): Sequence> { } /** - * Returns a sequence from the given collection + * Returns a sequence from the given collection. */ public fun Sequence.asSequence(): Sequence { return this @@ -141,14 +141,14 @@ public fun Sequence.asSequence(): Sequence { deprecated("Migrate to using Sequence and respective functions") /** - * Returns a stream from the given collection + * Returns a stream from the given collection. */ public fun Stream.asStream(): Stream { return this } /** - * Returns a sequence from the given collection + * Returns a sequence from the given collection. */ public fun String.asSequence(): Sequence { return object : Sequence { diff --git a/libraries/stdlib/src/generated/_Snapshots.kt b/libraries/stdlib/src/generated/_Snapshots.kt index 0afa499dcc7..828e25fc107 100644 --- a/libraries/stdlib/src/generated/_Snapshots.kt +++ b/libraries/stdlib/src/generated/_Snapshots.kt @@ -11,14 +11,14 @@ import java.util.* import java.util.Collections // TODO: it's temporary while we have java.util.Collections in js /** - * Returns an ArrayList of all elements + * Returns an [ArrayList] of all elements. */ public fun Array.toArrayList(): ArrayList { return this.asList().toArrayList() } /** - * Returns an ArrayList of all elements + * Returns an [ArrayList] of all elements. */ public fun BooleanArray.toArrayList(): ArrayList { val list = ArrayList(size()) @@ -27,7 +27,7 @@ public fun BooleanArray.toArrayList(): ArrayList { } /** - * Returns an ArrayList of all elements + * Returns an [ArrayList] of all elements. */ public fun ByteArray.toArrayList(): ArrayList { val list = ArrayList(size()) @@ -36,7 +36,7 @@ public fun ByteArray.toArrayList(): ArrayList { } /** - * Returns an ArrayList of all elements + * Returns an [ArrayList] of all elements. */ public fun CharArray.toArrayList(): ArrayList { val list = ArrayList(size()) @@ -45,7 +45,7 @@ public fun CharArray.toArrayList(): ArrayList { } /** - * Returns an ArrayList of all elements + * Returns an [ArrayList] of all elements. */ public fun DoubleArray.toArrayList(): ArrayList { val list = ArrayList(size()) @@ -54,7 +54,7 @@ public fun DoubleArray.toArrayList(): ArrayList { } /** - * Returns an ArrayList of all elements + * Returns an [ArrayList] of all elements. */ public fun FloatArray.toArrayList(): ArrayList { val list = ArrayList(size()) @@ -63,7 +63,7 @@ public fun FloatArray.toArrayList(): ArrayList { } /** - * Returns an ArrayList of all elements + * Returns an [ArrayList] of all elements. */ public fun IntArray.toArrayList(): ArrayList { val list = ArrayList(size()) @@ -72,7 +72,7 @@ public fun IntArray.toArrayList(): ArrayList { } /** - * Returns an ArrayList of all elements + * Returns an [ArrayList] of all elements. */ public fun LongArray.toArrayList(): ArrayList { val list = ArrayList(size()) @@ -81,7 +81,7 @@ public fun LongArray.toArrayList(): ArrayList { } /** - * Returns an ArrayList of all elements + * Returns an [ArrayList] of all elements. */ public fun ShortArray.toArrayList(): ArrayList { val list = ArrayList(size()) @@ -90,14 +90,14 @@ public fun ShortArray.toArrayList(): ArrayList { } /** - * Returns an ArrayList of all elements + * Returns an [ArrayList] of all elements. */ public fun Collection.toArrayList(): ArrayList { return ArrayList(this) } /** - * Returns an ArrayList of all elements + * Returns an [ArrayList] of all elements. */ public fun Iterable.toArrayList(): ArrayList { if (this is Collection) @@ -106,7 +106,7 @@ public fun Iterable.toArrayList(): ArrayList { } /** - * Returns an ArrayList of all elements + * Returns an [ArrayList] of all elements. */ public fun Sequence.toArrayList(): ArrayList { return toCollection(ArrayList()) @@ -115,21 +115,21 @@ public fun Sequence.toArrayList(): ArrayList { deprecated("Migrate to using Sequence and respective functions") /** - * Returns an ArrayList of all elements + * Returns an [ArrayList] of all elements. */ public fun Stream.toArrayList(): ArrayList { return toCollection(ArrayList()) } /** - * Returns an ArrayList of all elements + * Returns an [ArrayList] of all elements. */ public fun String.toArrayList(): ArrayList { return toCollection(ArrayList(length())) } /** - * Appends all elements to the given *collection* + * Appends all elements to the given [collection]. */ public fun > Array.toCollection(collection: C): C { for (item in this) { @@ -139,7 +139,7 @@ public fun > Array.toCollection(collection } /** - * Appends all elements to the given *collection* + * Appends all elements to the given [collection]. */ public fun > BooleanArray.toCollection(collection: C): C { for (item in this) { @@ -149,7 +149,7 @@ public fun > BooleanArray.toCollection(collect } /** - * Appends all elements to the given *collection* + * Appends all elements to the given [collection]. */ public fun > ByteArray.toCollection(collection: C): C { for (item in this) { @@ -159,7 +159,7 @@ public fun > ByteArray.toCollection(collection: C } /** - * Appends all elements to the given *collection* + * Appends all elements to the given [collection]. */ public fun > CharArray.toCollection(collection: C): C { for (item in this) { @@ -169,7 +169,7 @@ public fun > CharArray.toCollection(collection: C } /** - * Appends all elements to the given *collection* + * Appends all elements to the given [collection]. */ public fun > DoubleArray.toCollection(collection: C): C { for (item in this) { @@ -179,7 +179,7 @@ public fun > DoubleArray.toCollection(collectio } /** - * Appends all elements to the given *collection* + * Appends all elements to the given [collection]. */ public fun > FloatArray.toCollection(collection: C): C { for (item in this) { @@ -189,7 +189,7 @@ public fun > FloatArray.toCollection(collection: } /** - * Appends all elements to the given *collection* + * Appends all elements to the given [collection]. */ public fun > IntArray.toCollection(collection: C): C { for (item in this) { @@ -199,7 +199,7 @@ public fun > IntArray.toCollection(collection: C): } /** - * Appends all elements to the given *collection* + * Appends all elements to the given [collection]. */ public fun > LongArray.toCollection(collection: C): C { for (item in this) { @@ -209,7 +209,7 @@ public fun > LongArray.toCollection(collection: C } /** - * Appends all elements to the given *collection* + * Appends all elements to the given [collection]. */ public fun > ShortArray.toCollection(collection: C): C { for (item in this) { @@ -219,7 +219,7 @@ public fun > ShortArray.toCollection(collection: } /** - * Appends all elements to the given *collection* + * Appends all elements to the given [collection]. */ public fun > Iterable.toCollection(collection: C): C { for (item in this) { @@ -229,7 +229,7 @@ public fun > Iterable.toCollection(collection: } /** - * Appends all elements to the given *collection* + * Appends all elements to the given [collection]. */ public fun > Sequence.toCollection(collection: C): C { for (item in this) { @@ -241,7 +241,7 @@ public fun > Sequence.toCollection(collection: deprecated("Migrate to using Sequence and respective functions") /** - * Appends all elements to the given *collection* + * Appends all elements to the given [collection]. */ public fun > Stream.toCollection(collection: C): C { for (item in this) { @@ -251,7 +251,7 @@ public fun > Stream.toCollection(collection: C } /** - * Appends all elements to the given *collection* + * Appends all elements to the given [collection]. */ public fun > String.toCollection(collection: C): C { for (item in this) { @@ -261,77 +261,77 @@ public fun > String.toCollection(collection: C): } /** - * Returns a HashSet of all elements + * Returns a [HashSet] of all elements. */ public fun Array.toHashSet(): HashSet { return toCollection(HashSet(mapCapacity(size()))) } /** - * Returns a HashSet of all elements + * Returns a [HashSet] of all elements. */ public fun BooleanArray.toHashSet(): HashSet { return toCollection(HashSet(mapCapacity(size()))) } /** - * Returns a HashSet of all elements + * Returns a [HashSet] of all elements. */ public fun ByteArray.toHashSet(): HashSet { return toCollection(HashSet(mapCapacity(size()))) } /** - * Returns a HashSet of all elements + * Returns a [HashSet] of all elements. */ public fun CharArray.toHashSet(): HashSet { return toCollection(HashSet(mapCapacity(size()))) } /** - * Returns a HashSet of all elements + * Returns a [HashSet] of all elements. */ public fun DoubleArray.toHashSet(): HashSet { return toCollection(HashSet(mapCapacity(size()))) } /** - * Returns a HashSet of all elements + * Returns a [HashSet] of all elements. */ public fun FloatArray.toHashSet(): HashSet { return toCollection(HashSet(mapCapacity(size()))) } /** - * Returns a HashSet of all elements + * Returns a [HashSet] of all elements. */ public fun IntArray.toHashSet(): HashSet { return toCollection(HashSet(mapCapacity(size()))) } /** - * Returns a HashSet of all elements + * Returns a [HashSet] of all elements. */ public fun LongArray.toHashSet(): HashSet { return toCollection(HashSet(mapCapacity(size()))) } /** - * Returns a HashSet of all elements + * Returns a [HashSet] of all elements. */ public fun ShortArray.toHashSet(): HashSet { return toCollection(HashSet(mapCapacity(size()))) } /** - * Returns a HashSet of all elements + * Returns a [HashSet] of all elements. */ public fun Iterable.toHashSet(): HashSet { return toCollection(HashSet(mapCapacity(collectionSizeOrDefault(12)))) } /** - * Returns a HashSet of all elements + * Returns a [HashSet] of all elements. */ public fun Sequence.toHashSet(): HashSet { return toCollection(HashSet()) @@ -340,91 +340,91 @@ public fun Sequence.toHashSet(): HashSet { deprecated("Migrate to using Sequence and respective functions") /** - * Returns a HashSet of all elements + * Returns a [HashSet] of all elements. */ public fun Stream.toHashSet(): HashSet { return toCollection(HashSet()) } /** - * Returns a HashSet of all elements + * Returns a [HashSet] of all elements. */ public fun String.toHashSet(): HashSet { return toCollection(HashSet(mapCapacity(length()))) } /** - * Returns a LinkedList containing all elements + * Returns a [LinkedList] containing all elements. */ public fun Array.toLinkedList(): LinkedList { return toCollection(LinkedList()) } /** - * Returns a LinkedList containing all elements + * Returns a [LinkedList] containing all elements. */ public fun BooleanArray.toLinkedList(): LinkedList { return toCollection(LinkedList()) } /** - * Returns a LinkedList containing all elements + * Returns a [LinkedList] containing all elements. */ public fun ByteArray.toLinkedList(): LinkedList { return toCollection(LinkedList()) } /** - * Returns a LinkedList containing all elements + * Returns a [LinkedList] containing all elements. */ public fun CharArray.toLinkedList(): LinkedList { return toCollection(LinkedList()) } /** - * Returns a LinkedList containing all elements + * Returns a [LinkedList] containing all elements. */ public fun DoubleArray.toLinkedList(): LinkedList { return toCollection(LinkedList()) } /** - * Returns a LinkedList containing all elements + * Returns a [LinkedList] containing all elements. */ public fun FloatArray.toLinkedList(): LinkedList { return toCollection(LinkedList()) } /** - * Returns a LinkedList containing all elements + * Returns a [LinkedList] containing all elements. */ public fun IntArray.toLinkedList(): LinkedList { return toCollection(LinkedList()) } /** - * Returns a LinkedList containing all elements + * Returns a [LinkedList] containing all elements. */ public fun LongArray.toLinkedList(): LinkedList { return toCollection(LinkedList()) } /** - * Returns a LinkedList containing all elements + * Returns a [LinkedList] containing all elements. */ public fun ShortArray.toLinkedList(): LinkedList { return toCollection(LinkedList()) } /** - * Returns a LinkedList containing all elements + * Returns a [LinkedList] containing all elements. */ public fun Iterable.toLinkedList(): LinkedList { return toCollection(LinkedList()) } /** - * Returns a LinkedList containing all elements + * Returns a [LinkedList] containing all elements. */ public fun Sequence.toLinkedList(): LinkedList { return toCollection(LinkedList()) @@ -433,21 +433,21 @@ public fun Sequence.toLinkedList(): LinkedList { deprecated("Migrate to using Sequence and respective functions") /** - * Returns a LinkedList containing all elements + * Returns a [LinkedList] containing all elements. */ public fun Stream.toLinkedList(): LinkedList { return toCollection(LinkedList()) } /** - * Returns a LinkedList containing all elements + * Returns a [LinkedList] containing all elements. */ public fun String.toLinkedList(): LinkedList { return toCollection(LinkedList()) } /** - * Returns a List containing all key-value pairs + * Returns a [List] containing all key-value pairs. */ public fun Map.toList(): List> { val result = ArrayList>(size()) @@ -457,77 +457,77 @@ public fun Map.toList(): List> { } /** - * Returns a List containing all elements + * Returns a [List] containing all elements. */ public fun Array.toList(): List { return this.toArrayList() } /** - * Returns a List containing all elements + * Returns a [List] containing all elements. */ public fun BooleanArray.toList(): List { return this.toArrayList() } /** - * Returns a List containing all elements + * Returns a [List] containing all elements. */ public fun ByteArray.toList(): List { return this.toArrayList() } /** - * Returns a List containing all elements + * Returns a [List] containing all elements. */ public fun CharArray.toList(): List { return this.toArrayList() } /** - * Returns a List containing all elements + * Returns a [List] containing all elements. */ public fun DoubleArray.toList(): List { return this.toArrayList() } /** - * Returns a List containing all elements + * Returns a [List] containing all elements. */ public fun FloatArray.toList(): List { return this.toArrayList() } /** - * Returns a List containing all elements + * Returns a [List] containing all elements. */ public fun IntArray.toList(): List { return this.toArrayList() } /** - * Returns a List containing all elements + * Returns a [List] containing all elements. */ public fun LongArray.toList(): List { return this.toArrayList() } /** - * Returns a List containing all elements + * Returns a [List] containing all elements. */ public fun ShortArray.toList(): List { return this.toArrayList() } /** - * Returns a List containing all elements + * Returns a [List] containing all elements. */ public fun Iterable.toList(): List { return this.toArrayList() } /** - * Returns a List containing all elements + * Returns a [List] containing all elements. */ public fun Sequence.toList(): List { return this.toArrayList() @@ -536,21 +536,21 @@ public fun Sequence.toList(): List { deprecated("Migrate to using Sequence and respective functions") /** - * Returns a List containing all elements + * Returns a [List] containing all elements. */ public fun Stream.toList(): List { return this.toArrayList() } /** - * Returns a List containing all elements + * Returns a [List] containing all elements. */ public fun String.toList(): List { return this.toArrayList() } /** - * Returns Map containing all the values from the given collection indexed by *selector* + * Returns Map containing all the values from the given collection indexed by [selector]. */ public inline fun Array.toMap(selector: (T) -> K): Map { val capacity = (size()/.75f) + 1 @@ -562,7 +562,7 @@ public inline fun Array.toMap(selector: (T) -> K): Map { } /** - * Returns Map containing all the values from the given collection indexed by *selector* + * Returns Map containing all the values from the given collection indexed by [selector]. */ public inline fun BooleanArray.toMap(selector: (Boolean) -> K): Map { val capacity = (size()/.75f) + 1 @@ -574,7 +574,7 @@ public inline fun BooleanArray.toMap(selector: (Boolean) -> K): Map ByteArray.toMap(selector: (Byte) -> K): Map { val capacity = (size()/.75f) + 1 @@ -586,7 +586,7 @@ public inline fun ByteArray.toMap(selector: (Byte) -> K): Map { } /** - * Returns Map containing all the values from the given collection indexed by *selector* + * Returns Map containing all the values from the given collection indexed by [selector]. */ public inline fun CharArray.toMap(selector: (Char) -> K): Map { val capacity = (size()/.75f) + 1 @@ -598,7 +598,7 @@ public inline fun CharArray.toMap(selector: (Char) -> K): Map { } /** - * Returns Map containing all the values from the given collection indexed by *selector* + * Returns Map containing all the values from the given collection indexed by [selector]. */ public inline fun DoubleArray.toMap(selector: (Double) -> K): Map { val capacity = (size()/.75f) + 1 @@ -610,7 +610,7 @@ public inline fun DoubleArray.toMap(selector: (Double) -> K): Map } /** - * Returns Map containing all the values from the given collection indexed by *selector* + * Returns Map containing all the values from the given collection indexed by [selector]. */ public inline fun FloatArray.toMap(selector: (Float) -> K): Map { val capacity = (size()/.75f) + 1 @@ -622,7 +622,7 @@ public inline fun FloatArray.toMap(selector: (Float) -> K): Map { } /** - * Returns Map containing all the values from the given collection indexed by *selector* + * Returns Map containing all the values from the given collection indexed by [selector]. */ public inline fun IntArray.toMap(selector: (Int) -> K): Map { val capacity = (size()/.75f) + 1 @@ -634,7 +634,7 @@ public inline fun IntArray.toMap(selector: (Int) -> K): Map { } /** - * Returns Map containing all the values from the given collection indexed by *selector* + * Returns Map containing all the values from the given collection indexed by [selector]. */ public inline fun LongArray.toMap(selector: (Long) -> K): Map { val capacity = (size()/.75f) + 1 @@ -646,7 +646,7 @@ public inline fun LongArray.toMap(selector: (Long) -> K): Map { } /** - * Returns Map containing all the values from the given collection indexed by *selector* + * Returns Map containing all the values from the given collection indexed by [selector]. */ public inline fun ShortArray.toMap(selector: (Short) -> K): Map { val capacity = (size()/.75f) + 1 @@ -658,7 +658,7 @@ public inline fun ShortArray.toMap(selector: (Short) -> K): Map { } /** - * Returns Map containing all the values from the given collection indexed by *selector* + * Returns Map containing all the values from the given collection indexed by [selector]. */ public inline fun Iterable.toMap(selector: (T) -> K): Map { val capacity = (collectionSizeOrDefault(10)/.75f) + 1 @@ -670,7 +670,7 @@ public inline fun Iterable.toMap(selector: (T) -> K): Map { } /** - * Returns Map containing all the values from the given collection indexed by *selector* + * Returns Map containing all the values from the given collection indexed by [selector]. */ public inline fun Sequence.toMap(selector: (T) -> K): Map { val result = LinkedHashMap() @@ -683,7 +683,7 @@ public inline fun Sequence.toMap(selector: (T) -> K): Map { deprecated("Migrate to using Sequence and respective functions") /** - * Returns Map containing all the values from the given collection indexed by *selector* + * Returns Map containing all the values from the given collection indexed by [selector]. */ public inline fun Stream.toMap(selector: (T) -> K): Map { val result = LinkedHashMap() @@ -694,7 +694,7 @@ public inline fun Stream.toMap(selector: (T) -> K): Map { } /** - * Returns Map containing all the values from the given collection indexed by *selector* + * Returns Map containing all the values from the given collection indexed by [selector]. */ public inline fun String.toMap(selector: (Char) -> K): Map { val capacity = (length()/.75f) + 1 @@ -706,7 +706,7 @@ public inline fun String.toMap(selector: (Char) -> K): Map { } /** - * Returns Map containing all the values provided by *transform* and indexed by *selector* from the given collection + * Returns Map containing all the values provided by [transform] and indexed by [selector] from the given collection. */ public inline fun Array.toMap(selector: (T) -> K, transform: (T) -> V): Map { val capacity = (size()/.75f) + 1 @@ -718,7 +718,7 @@ public inline fun Array.toMap(selector: (T) -> K, transform: (T } /** - * Returns Map containing all the values provided by *transform* and indexed by *selector* from the given collection + * Returns Map containing all the values provided by [transform] and indexed by [selector] from the given collection. */ public inline fun BooleanArray.toMap(selector: (Boolean) -> K, transform: (Boolean) -> V): Map { val capacity = (size()/.75f) + 1 @@ -730,7 +730,7 @@ public inline fun BooleanArray.toMap(selector: (Boolean) -> K, transform: } /** - * Returns Map containing all the values provided by *transform* and indexed by *selector* from the given collection + * Returns Map containing all the values provided by [transform] and indexed by [selector] from the given collection. */ public inline fun ByteArray.toMap(selector: (Byte) -> K, transform: (Byte) -> V): Map { val capacity = (size()/.75f) + 1 @@ -742,7 +742,7 @@ public inline fun ByteArray.toMap(selector: (Byte) -> K, transform: (Byte } /** - * Returns Map containing all the values provided by *transform* and indexed by *selector* from the given collection + * Returns Map containing all the values provided by [transform] and indexed by [selector] from the given collection. */ public inline fun CharArray.toMap(selector: (Char) -> K, transform: (Char) -> V): Map { val capacity = (size()/.75f) + 1 @@ -754,7 +754,7 @@ public inline fun CharArray.toMap(selector: (Char) -> K, transform: (Char } /** - * Returns Map containing all the values provided by *transform* and indexed by *selector* from the given collection + * Returns Map containing all the values provided by [transform] and indexed by [selector] from the given collection. */ public inline fun DoubleArray.toMap(selector: (Double) -> K, transform: (Double) -> V): Map { val capacity = (size()/.75f) + 1 @@ -766,7 +766,7 @@ public inline fun DoubleArray.toMap(selector: (Double) -> K, transform: ( } /** - * Returns Map containing all the values provided by *transform* and indexed by *selector* from the given collection + * Returns Map containing all the values provided by [transform] and indexed by [selector] from the given collection. */ public inline fun FloatArray.toMap(selector: (Float) -> K, transform: (Float) -> V): Map { val capacity = (size()/.75f) + 1 @@ -778,7 +778,7 @@ public inline fun FloatArray.toMap(selector: (Float) -> K, transform: (Fl } /** - * Returns Map containing all the values provided by *transform* and indexed by *selector* from the given collection + * Returns Map containing all the values provided by [transform] and indexed by [selector] from the given collection. */ public inline fun IntArray.toMap(selector: (Int) -> K, transform: (Int) -> V): Map { val capacity = (size()/.75f) + 1 @@ -790,7 +790,7 @@ public inline fun IntArray.toMap(selector: (Int) -> K, transform: (Int) - } /** - * Returns Map containing all the values provided by *transform* and indexed by *selector* from the given collection + * Returns Map containing all the values provided by [transform] and indexed by [selector] from the given collection. */ public inline fun LongArray.toMap(selector: (Long) -> K, transform: (Long) -> V): Map { val capacity = (size()/.75f) + 1 @@ -802,7 +802,7 @@ public inline fun LongArray.toMap(selector: (Long) -> K, transform: (Long } /** - * Returns Map containing all the values provided by *transform* and indexed by *selector* from the given collection + * Returns Map containing all the values provided by [transform] and indexed by [selector] from the given collection. */ public inline fun ShortArray.toMap(selector: (Short) -> K, transform: (Short) -> V): Map { val capacity = (size()/.75f) + 1 @@ -814,7 +814,7 @@ public inline fun ShortArray.toMap(selector: (Short) -> K, transform: (Sh } /** - * Returns Map containing all the values provided by *transform* and indexed by *selector* from the given collection + * Returns Map containing all the values provided by [transform] and indexed by [selector] from the given collection. */ public inline fun Iterable.toMap(selector: (T) -> K, transform: (T) -> V): Map { val capacity = (collectionSizeOrDefault(10)/.75f) + 1 @@ -826,7 +826,7 @@ public inline fun Iterable.toMap(selector: (T) -> K, transform: (T) } /** - * Returns Map containing all the values provided by *transform* and indexed by *selector* from the given collection + * Returns Map containing all the values provided by [transform] and indexed by [selector] from the given collection. */ public inline fun Sequence.toMap(selector: (T) -> K, transform: (T) -> V): Map { val result = LinkedHashMap() @@ -839,7 +839,7 @@ public inline fun Sequence.toMap(selector: (T) -> K, transform: (T) deprecated("Migrate to using Sequence and respective functions") /** - * Returns Map containing all the values provided by *transform* and indexed by *selector* from the given collection + * Returns Map containing all the values provided by [transform] and indexed by [selector] from the given collection. */ public inline fun Stream.toMap(selector: (T) -> K, transform: (T) -> V): Map { val result = LinkedHashMap() @@ -850,7 +850,7 @@ public inline fun Stream.toMap(selector: (T) -> K, transform: (T) - } /** - * Returns Map containing all the values provided by *transform* and indexed by *selector* from the given collection + * Returns Map containing all the values provided by [transform] and indexed by [selector] from the given collection. */ public inline fun String.toMap(selector: (Char) -> K, transform: (Char) -> V): Map { val capacity = (length()/.75f) + 1 @@ -862,77 +862,77 @@ public inline fun String.toMap(selector: (Char) -> K, transform: (Char) - } /** - * Returns a Set of all elements + * Returns a [Set] of all elements. */ public fun Array.toSet(): Set { return toCollection(LinkedHashSet(mapCapacity(size()))) } /** - * Returns a Set of all elements + * Returns a [Set] of all elements. */ public fun BooleanArray.toSet(): Set { return toCollection(LinkedHashSet(mapCapacity(size()))) } /** - * Returns a Set of all elements + * Returns a [Set] of all elements. */ public fun ByteArray.toSet(): Set { return toCollection(LinkedHashSet(mapCapacity(size()))) } /** - * Returns a Set of all elements + * Returns a [Set] of all elements. */ public fun CharArray.toSet(): Set { return toCollection(LinkedHashSet(mapCapacity(size()))) } /** - * Returns a Set of all elements + * Returns a [Set] of all elements. */ public fun DoubleArray.toSet(): Set { return toCollection(LinkedHashSet(mapCapacity(size()))) } /** - * Returns a Set of all elements + * Returns a [Set] of all elements. */ public fun FloatArray.toSet(): Set { return toCollection(LinkedHashSet(mapCapacity(size()))) } /** - * Returns a Set of all elements + * Returns a [Set] of all elements. */ public fun IntArray.toSet(): Set { return toCollection(LinkedHashSet(mapCapacity(size()))) } /** - * Returns a Set of all elements + * Returns a [Set] of all elements. */ public fun LongArray.toSet(): Set { return toCollection(LinkedHashSet(mapCapacity(size()))) } /** - * Returns a Set of all elements + * Returns a [Set] of all elements. */ public fun ShortArray.toSet(): Set { return toCollection(LinkedHashSet(mapCapacity(size()))) } /** - * Returns a Set of all elements + * Returns a [Set] of all elements. */ public fun Iterable.toSet(): Set { return toCollection(LinkedHashSet(mapCapacity(collectionSizeOrDefault(12)))) } /** - * Returns a Set of all elements + * Returns a [Set] of all elements. */ public fun Sequence.toSet(): Set { return toCollection(LinkedHashSet()) @@ -941,91 +941,91 @@ public fun Sequence.toSet(): Set { deprecated("Migrate to using Sequence and respective functions") /** - * Returns a Set of all elements + * Returns a [Set] of all elements. */ public fun Stream.toSet(): Set { return toCollection(LinkedHashSet()) } /** - * Returns a Set of all elements + * Returns a [Set] of all elements. */ public fun String.toSet(): Set { return toCollection(LinkedHashSet(mapCapacity(length()))) } /** - * Returns a SortedSet of all elements + * Returns a [SortedSet] of all elements. */ public fun Array.toSortedSet(): SortedSet { return toCollection(TreeSet()) } /** - * Returns a SortedSet of all elements + * Returns a [SortedSet] of all elements. */ public fun BooleanArray.toSortedSet(): SortedSet { return toCollection(TreeSet()) } /** - * Returns a SortedSet of all elements + * Returns a [SortedSet] of all elements. */ public fun ByteArray.toSortedSet(): SortedSet { return toCollection(TreeSet()) } /** - * Returns a SortedSet of all elements + * Returns a [SortedSet] of all elements. */ public fun CharArray.toSortedSet(): SortedSet { return toCollection(TreeSet()) } /** - * Returns a SortedSet of all elements + * Returns a [SortedSet] of all elements. */ public fun DoubleArray.toSortedSet(): SortedSet { return toCollection(TreeSet()) } /** - * Returns a SortedSet of all elements + * Returns a [SortedSet] of all elements. */ public fun FloatArray.toSortedSet(): SortedSet { return toCollection(TreeSet()) } /** - * Returns a SortedSet of all elements + * Returns a [SortedSet] of all elements. */ public fun IntArray.toSortedSet(): SortedSet { return toCollection(TreeSet()) } /** - * Returns a SortedSet of all elements + * Returns a [SortedSet] of all elements. */ public fun LongArray.toSortedSet(): SortedSet { return toCollection(TreeSet()) } /** - * Returns a SortedSet of all elements + * Returns a [SortedSet] of all elements. */ public fun ShortArray.toSortedSet(): SortedSet { return toCollection(TreeSet()) } /** - * Returns a SortedSet of all elements + * Returns a [SortedSet] of all elements. */ public fun Iterable.toSortedSet(): SortedSet { return toCollection(TreeSet()) } /** - * Returns a SortedSet of all elements + * Returns a [SortedSet] of all elements. */ public fun Sequence.toSortedSet(): SortedSet { return toCollection(TreeSet()) @@ -1034,14 +1034,14 @@ public fun Sequence.toSortedSet(): SortedSet { deprecated("Migrate to using Sequence and respective functions") /** - * Returns a SortedSet of all elements + * Returns a [SortedSet] of all elements. */ public fun Stream.toSortedSet(): SortedSet { return toCollection(TreeSet()) } /** - * Returns a SortedSet of all elements + * Returns a [SortedSet] of all elements. */ public fun String.toSortedSet(): SortedSet { return toCollection(TreeSet()) diff --git a/libraries/stdlib/src/generated/_SpecialJVM.kt b/libraries/stdlib/src/generated/_SpecialJVM.kt index b05f53ad0e4..8c325de7f8c 100644 --- a/libraries/stdlib/src/generated/_SpecialJVM.kt +++ b/libraries/stdlib/src/generated/_SpecialJVM.kt @@ -11,14 +11,14 @@ import java.util.* import java.util.Collections // TODO: it's temporary while we have java.util.Collections in js /** - * Returns a list that wraps the original array + * Returns a [List] that wraps the original array. */ public fun Array.asList(): List { return Arrays.asList(*this) } /** - * Returns a list that wraps the original array + * Returns a [List] that wraps the original array. */ public fun BooleanArray.asList(): List { return object : AbstractList(), RandomAccess { @@ -33,7 +33,7 @@ public fun BooleanArray.asList(): List { } /** - * Returns a list that wraps the original array + * Returns a [List] that wraps the original array. */ public fun ByteArray.asList(): List { return object : AbstractList(), RandomAccess { @@ -48,7 +48,7 @@ public fun ByteArray.asList(): List { } /** - * Returns a list that wraps the original array + * Returns a [List] that wraps the original array. */ public fun CharArray.asList(): List { return object : AbstractList(), RandomAccess { @@ -63,7 +63,7 @@ public fun CharArray.asList(): List { } /** - * Returns a list that wraps the original array + * Returns a [List] that wraps the original array. */ public fun DoubleArray.asList(): List { return object : AbstractList(), RandomAccess { @@ -78,7 +78,7 @@ public fun DoubleArray.asList(): List { } /** - * Returns a list that wraps the original array + * Returns a [List] that wraps the original array. */ public fun FloatArray.asList(): List { return object : AbstractList(), RandomAccess { @@ -93,7 +93,7 @@ public fun FloatArray.asList(): List { } /** - * Returns a list that wraps the original array + * Returns a [List] that wraps the original array. */ public fun IntArray.asList(): List { return object : AbstractList(), RandomAccess { @@ -108,7 +108,7 @@ public fun IntArray.asList(): List { } /** - * Returns a list that wraps the original array + * Returns a [List] that wraps the original array. */ public fun LongArray.asList(): List { return object : AbstractList(), RandomAccess { @@ -123,7 +123,7 @@ public fun LongArray.asList(): List { } /** - * Returns a list that wraps the original array + * Returns a [List] that wraps the original array. */ public fun ShortArray.asList(): List { return object : AbstractList(), RandomAccess { @@ -194,196 +194,196 @@ public fun ShortArray.binarySearch(element: Short, fromIndex: Int = 0, toIndex: } /** - * Returns new array which is a copy of the original array + * Returns new array which is a copy of the original array. */ public fun Array.copyOf(): Array { return Arrays.copyOf(this, size()) as Array } /** - * Returns new array which is a copy of the original array + * Returns new array which is a copy of the original array. */ public fun BooleanArray.copyOf(): BooleanArray { return Arrays.copyOf(this, size()) } /** - * Returns new array which is a copy of the original array + * Returns new array which is a copy of the original array. */ public fun ByteArray.copyOf(): ByteArray { return Arrays.copyOf(this, size()) } /** - * Returns new array which is a copy of the original array + * Returns new array which is a copy of the original array. */ public fun CharArray.copyOf(): CharArray { return Arrays.copyOf(this, size()) } /** - * Returns new array which is a copy of the original array + * Returns new array which is a copy of the original array. */ public fun DoubleArray.copyOf(): DoubleArray { return Arrays.copyOf(this, size()) } /** - * Returns new array which is a copy of the original array + * Returns new array which is a copy of the original array. */ public fun FloatArray.copyOf(): FloatArray { return Arrays.copyOf(this, size()) } /** - * Returns new array which is a copy of the original array + * Returns new array which is a copy of the original array. */ public fun IntArray.copyOf(): IntArray { return Arrays.copyOf(this, size()) } /** - * Returns new array which is a copy of the original array + * Returns new array which is a copy of the original array. */ public fun LongArray.copyOf(): LongArray { return Arrays.copyOf(this, size()) } /** - * Returns new array which is a copy of the original array + * Returns new array which is a copy of the original array. */ public fun ShortArray.copyOf(): ShortArray { return Arrays.copyOf(this, size()) } /** - * Returns new array which is a copy of the original array + * Returns new array which is a copy of the original array. */ public fun Array.copyOf(newSize: Int): Array { return Arrays.copyOf(this, newSize) as Array } /** - * Returns new array which is a copy of the original array + * Returns new array which is a copy of the original array. */ public fun BooleanArray.copyOf(newSize: Int): BooleanArray { return Arrays.copyOf(this, newSize) } /** - * Returns new array which is a copy of the original array + * Returns new array which is a copy of the original array. */ public fun ByteArray.copyOf(newSize: Int): ByteArray { return Arrays.copyOf(this, newSize) } /** - * Returns new array which is a copy of the original array + * Returns new array which is a copy of the original array. */ public fun CharArray.copyOf(newSize: Int): CharArray { return Arrays.copyOf(this, newSize) } /** - * Returns new array which is a copy of the original array + * Returns new array which is a copy of the original array. */ public fun DoubleArray.copyOf(newSize: Int): DoubleArray { return Arrays.copyOf(this, newSize) } /** - * Returns new array which is a copy of the original array + * Returns new array which is a copy of the original array. */ public fun FloatArray.copyOf(newSize: Int): FloatArray { return Arrays.copyOf(this, newSize) } /** - * Returns new array which is a copy of the original array + * Returns new array which is a copy of the original array. */ public fun IntArray.copyOf(newSize: Int): IntArray { return Arrays.copyOf(this, newSize) } /** - * Returns new array which is a copy of the original array + * Returns new array which is a copy of the original array. */ public fun LongArray.copyOf(newSize: Int): LongArray { return Arrays.copyOf(this, newSize) } /** - * Returns new array which is a copy of the original array + * Returns new array which is a copy of the original array. */ public fun ShortArray.copyOf(newSize: Int): ShortArray { return Arrays.copyOf(this, newSize) } /** - * Returns new array which is a copy of range of original array + * Returns new array which is a copy of range of original array. */ public fun Array.copyOfRange(from: Int, to: Int): Array { return Arrays.copyOfRange(this, from, to) } /** - * Returns new array which is a copy of range of original array + * Returns new array which is a copy of range of original array. */ public fun BooleanArray.copyOfRange(from: Int, to: Int): BooleanArray { return Arrays.copyOfRange(this, from, to) } /** - * Returns new array which is a copy of range of original array + * Returns new array which is a copy of range of original array. */ public fun ByteArray.copyOfRange(from: Int, to: Int): ByteArray { return Arrays.copyOfRange(this, from, to) } /** - * Returns new array which is a copy of range of original array + * Returns new array which is a copy of range of original array. */ public fun CharArray.copyOfRange(from: Int, to: Int): CharArray { return Arrays.copyOfRange(this, from, to) } /** - * Returns new array which is a copy of range of original array + * Returns new array which is a copy of range of original array. */ public fun DoubleArray.copyOfRange(from: Int, to: Int): DoubleArray { return Arrays.copyOfRange(this, from, to) } /** - * Returns new array which is a copy of range of original array + * Returns new array which is a copy of range of original array. */ public fun FloatArray.copyOfRange(from: Int, to: Int): FloatArray { return Arrays.copyOfRange(this, from, to) } /** - * Returns new array which is a copy of range of original array + * Returns new array which is a copy of range of original array. */ public fun IntArray.copyOfRange(from: Int, to: Int): IntArray { return Arrays.copyOfRange(this, from, to) } /** - * Returns new array which is a copy of range of original array + * Returns new array which is a copy of range of original array. */ public fun LongArray.copyOfRange(from: Int, to: Int): LongArray { return Arrays.copyOfRange(this, from, to) } /** - * Returns new array which is a copy of range of original array + * Returns new array which is a copy of range of original array. */ public fun ShortArray.copyOfRange(from: Int, to: Int): ShortArray { return Arrays.copyOfRange(this, from, to) } /** - * Fills original array with the provided value + * Fills original array with the provided value. */ public fun Array.fill(element: T): Array { Arrays.fill(this, element) @@ -391,7 +391,7 @@ public fun Array.fill(element: T): Array { } /** - * Fills original array with the provided value + * Fills original array with the provided value. */ public fun BooleanArray.fill(element: Boolean): BooleanArray { Arrays.fill(this, element) @@ -399,7 +399,7 @@ public fun BooleanArray.fill(element: Boolean): BooleanArray { } /** - * Fills original array with the provided value + * Fills original array with the provided value. */ public fun ByteArray.fill(element: Byte): ByteArray { Arrays.fill(this, element) @@ -407,7 +407,7 @@ public fun ByteArray.fill(element: Byte): ByteArray { } /** - * Fills original array with the provided value + * Fills original array with the provided value. */ public fun CharArray.fill(element: Char): CharArray { Arrays.fill(this, element) @@ -415,7 +415,7 @@ public fun CharArray.fill(element: Char): CharArray { } /** - * Fills original array with the provided value + * Fills original array with the provided value. */ public fun DoubleArray.fill(element: Double): DoubleArray { Arrays.fill(this, element) @@ -423,7 +423,7 @@ public fun DoubleArray.fill(element: Double): DoubleArray { } /** - * Fills original array with the provided value + * Fills original array with the provided value. */ public fun FloatArray.fill(element: Float): FloatArray { Arrays.fill(this, element) @@ -431,7 +431,7 @@ public fun FloatArray.fill(element: Float): FloatArray { } /** - * Fills original array with the provided value + * Fills original array with the provided value. */ public fun IntArray.fill(element: Int): IntArray { Arrays.fill(this, element) @@ -439,7 +439,7 @@ public fun IntArray.fill(element: Int): IntArray { } /** - * Fills original array with the provided value + * Fills original array with the provided value. */ public fun LongArray.fill(element: Long): LongArray { Arrays.fill(this, element) @@ -447,7 +447,7 @@ public fun LongArray.fill(element: Long): LongArray { } /** - * Fills original array with the provided value + * Fills original array with the provided value. */ public fun ShortArray.fill(element: Short): ShortArray { Arrays.fill(this, element) @@ -455,21 +455,21 @@ public fun ShortArray.fill(element: Short): ShortArray { } /** - * Returns a list containing all elements that are instances of specified type parameter R + * Returns a list containing all elements that are instances of specified type parameter R. */ public inline fun Array<*>.filterIsInstance(): List { return filterIsInstanceTo(ArrayList()) } /** - * Returns a list containing all elements that are instances of specified type parameter R + * Returns a list containing all elements that are instances of specified type parameter R. */ public inline fun Iterable<*>.filterIsInstance(): List { return filterIsInstanceTo(ArrayList()) } /** - * Returns a sequence containing all elements that are instances of specified type parameter R + * Returns a sequence containing all elements that are instances of specified type parameter R. */ public inline fun Sequence<*>.filterIsInstance(): Sequence { return filter { it is R } as Sequence @@ -478,28 +478,28 @@ public inline fun Sequence<*>.filterIsInstance(): Sequence { deprecated("Migrate to using Sequence and respective functions") /** - * Returns a stream containing all elements that are instances of specified type parameter R + * Returns a stream containing all elements that are instances of specified type parameter R. */ public inline fun Stream<*>.filterIsInstance(): Stream { return filter { it is R } as Stream } /** - * Returns a list containing all elements that are instances of specified class + * Returns a list containing all elements that are instances of specified class. */ public fun Array<*>.filterIsInstance(klass: Class): List { return filterIsInstanceTo(ArrayList(), klass) } /** - * Returns a list containing all elements that are instances of specified class + * Returns a list containing all elements that are instances of specified class. */ public fun Iterable<*>.filterIsInstance(klass: Class): List { return filterIsInstanceTo(ArrayList(), klass) } /** - * Returns a sequence containing all elements that are instances of specified class + * Returns a sequence containing all elements that are instances of specified class. */ public fun Sequence<*>.filterIsInstance(klass: Class): Sequence { return filter { klass.isInstance(it) } as Sequence @@ -508,14 +508,14 @@ public fun Sequence<*>.filterIsInstance(klass: Class): Sequence { deprecated("Migrate to using Sequence and respective functions") /** - * Returns a stream containing all elements that are instances of specified class + * Returns a stream containing all elements that are instances of specified class. */ public fun Stream<*>.filterIsInstance(klass: Class): Stream { return filter { klass.isInstance(it) } as Stream } /** - * Appends all elements that are instances of specified type parameter R to the given *destination* + * Appends all elements that are instances of specified type parameter R to the given [destination]. */ public inline fun > Array<*>.filterIsInstanceTo(destination: C): C { for (element in this) if (element is R) destination.add(element) @@ -523,7 +523,7 @@ public inline fun > Array<*>.filterIsInst } /** - * Appends all elements that are instances of specified type parameter R to the given *destination* + * Appends all elements that are instances of specified type parameter R to the given [destination]. */ public inline fun > Iterable<*>.filterIsInstanceTo(destination: C): C { for (element in this) if (element is R) destination.add(element) @@ -531,7 +531,7 @@ public inline fun > Iterable<*>.filterIsI } /** - * Appends all elements that are instances of specified type parameter R to the given *destination* + * Appends all elements that are instances of specified type parameter R to the given [destination]. */ public inline fun > Sequence<*>.filterIsInstanceTo(destination: C): C { for (element in this) if (element is R) destination.add(element) @@ -541,7 +541,7 @@ public inline fun > Sequence<*>.filterIsI deprecated("Migrate to using Sequence and respective functions") /** - * Appends all elements that are instances of specified type parameter R to the given *destination* + * Appends all elements that are instances of specified type parameter R to the given [destination]. */ public inline fun > Stream<*>.filterIsInstanceTo(destination: C): C { for (element in this) if (element is R) destination.add(element) @@ -549,7 +549,7 @@ public inline fun > Stream<*>.filterIsIns } /** - * Appends all elements that are instances of specified class to the given *destination* + * Appends all elements that are instances of specified class to the given [destination]. */ public fun , R> Array<*>.filterIsInstanceTo(destination: C, klass: Class): C { for (element in this) if (klass.isInstance(element)) destination.add(element as R) @@ -557,7 +557,7 @@ public fun , R> Array<*>.filterIsInstanceTo(destinat } /** - * Appends all elements that are instances of specified class to the given *destination* + * Appends all elements that are instances of specified class to the given [destination]. */ public fun , R> Iterable<*>.filterIsInstanceTo(destination: C, klass: Class): C { for (element in this) if (klass.isInstance(element)) destination.add(element as R) @@ -565,7 +565,7 @@ public fun , R> Iterable<*>.filterIsInstanceTo(desti } /** - * Appends all elements that are instances of specified class to the given *destination* + * Appends all elements that are instances of specified class to the given [destination]. */ public fun , R> Sequence<*>.filterIsInstanceTo(destination: C, klass: Class): C { for (element in this) if (klass.isInstance(element)) destination.add(element as R) @@ -575,7 +575,7 @@ public fun , R> Sequence<*>.filterIsInstanceTo(desti deprecated("Migrate to using Sequence and respective functions") /** - * Appends all elements that are instances of specified class to the given *destination* + * Appends all elements that are instances of specified class to the given [destination]. */ public fun , R> Stream<*>.filterIsInstanceTo(destination: C, klass: Class): C { for (element in this) if (klass.isInstance(element)) destination.add(element as R) @@ -583,56 +583,56 @@ public fun , R> Stream<*>.filterIsInstanceTo(destina } /** - * Sorts array or range in array inplace + * Sorts array or range in array inplace. */ public fun Array.sort(fromIndex: Int = 0, toIndex: Int = size()): Unit { Arrays.sort(this, fromIndex, toIndex) } /** - * Sorts array or range in array inplace + * Sorts array or range in array inplace. */ public fun ByteArray.sort(fromIndex: Int = 0, toIndex: Int = size()): Unit { Arrays.sort(this, fromIndex, toIndex) } /** - * Sorts array or range in array inplace + * Sorts array or range in array inplace. */ public fun CharArray.sort(fromIndex: Int = 0, toIndex: Int = size()): Unit { Arrays.sort(this, fromIndex, toIndex) } /** - * Sorts array or range in array inplace + * Sorts array or range in array inplace. */ public fun DoubleArray.sort(fromIndex: Int = 0, toIndex: Int = size()): Unit { Arrays.sort(this, fromIndex, toIndex) } /** - * Sorts array or range in array inplace + * Sorts array or range in array inplace. */ public fun FloatArray.sort(fromIndex: Int = 0, toIndex: Int = size()): Unit { Arrays.sort(this, fromIndex, toIndex) } /** - * Sorts array or range in array inplace + * Sorts array or range in array inplace. */ public fun IntArray.sort(fromIndex: Int = 0, toIndex: Int = size()): Unit { Arrays.sort(this, fromIndex, toIndex) } /** - * Sorts array or range in array inplace + * Sorts array or range in array inplace. */ public fun LongArray.sort(fromIndex: Int = 0, toIndex: Int = size()): Unit { Arrays.sort(this, fromIndex, toIndex) } /** - * Sorts array or range in array inplace + * Sorts array or range in array inplace. */ public fun ShortArray.sort(fromIndex: Int = 0, toIndex: Int = size()): Unit { Arrays.sort(this, fromIndex, toIndex) diff --git a/libraries/tools/kotlin-stdlib-gen/src/templates/Aggregates.kt b/libraries/tools/kotlin-stdlib-gen/src/templates/Aggregates.kt index 9ecf1b99694..58681bf96db 100644 --- a/libraries/tools/kotlin-stdlib-gen/src/templates/Aggregates.kt +++ b/libraries/tools/kotlin-stdlib-gen/src/templates/Aggregates.kt @@ -7,7 +7,7 @@ fun aggregates(): List { templates add f("all(predicate: (T) -> Boolean)") { inline(true) - doc { "Returns *true* if all elements match the given *predicate*" } + doc { "Returns `true` if all elements match the given [predicate]." } returns("Boolean") body { """ @@ -21,7 +21,7 @@ fun aggregates(): List { templates add f("none(predicate: (T) -> Boolean)") { inline(true) - doc { "Returns *true* if no elements match the given *predicate*" } + doc { "Returns `true` if no elements match the given [predicate]." } returns("Boolean") body { """ @@ -33,7 +33,7 @@ fun aggregates(): List { } templates add f("none()") { - doc { "Returns *true* if collection has no elements" } + doc { "Returns `true` if collection has no elements." } returns("Boolean") body { """ @@ -47,7 +47,7 @@ fun aggregates(): List { templates add f("any(predicate: (T) -> Boolean)") { inline(true) - doc { "Returns *true* if any element matches the given [predicate]" } + doc { "Returns `true` if at least one element matches the given [predicate]." } returns("Boolean") body { """ @@ -59,7 +59,7 @@ fun aggregates(): List { } templates add f("any()") { - doc { "Returns *true* if collection has at least one element" } + doc { "Returns `true` if collection has at least one element." } returns("Boolean") body { """ @@ -73,7 +73,7 @@ fun aggregates(): List { templates add f("count(predicate: (T) -> Boolean)") { inline(true) - doc { "Returns the number of elements matching the given [predicate]" } + doc { "Returns the number of elements matching the given [predicate]." } returns("Int") body { """ @@ -86,7 +86,7 @@ fun aggregates(): List { } templates add f("count()") { - doc { "Returns the number of elements" } + doc { "Returns the number of elements in this collection." } returns("Int") body { """ @@ -95,6 +95,7 @@ fun aggregates(): List { return count """ } + doc(Strings) { "Returns the length of this string."} body(Strings) { "return length()" } @@ -105,8 +106,8 @@ fun aggregates(): List { templates add f("sumBy(transform: (T) -> Int)") { inline(true) - doc { "Returns the sum of all values produced by [transform] function from elements in the collection" } - doc(Strings) { "Returns the sum of all values produced by [transform] function from characters in the string" } + doc { "Returns the sum of all values produced by [transform] function from elements in the collection." } + doc(Strings) { "Returns the sum of all values produced by [transform] function from characters in the string." } returns("Int") body { """ @@ -121,8 +122,8 @@ fun aggregates(): List { templates add f("sumByDouble(transform: (T) -> Double)") { inline(true) - doc { "Returns the sum of all values produced by [transform] function from elements in the collection" } - doc(Strings) { "Returns the sum of all values produced by [transform] function from characters in the string" } + doc { "Returns the sum of all values produced by [transform] function from elements in the collection." } + doc(Strings) { "Returns the sum of all values produced by [transform] function from characters in the string." } returns("Double") body { """ @@ -136,7 +137,7 @@ fun aggregates(): List { } templates add f("min()") { - doc { "Returns the smallest element or null if there are no elements" } + doc { "Returns the smallest element or `null` if there are no elements." } returns("T?") exclude(PrimitiveType.Boolean) typeParam("T : Comparable") @@ -169,7 +170,7 @@ fun aggregates(): List { templates add f("minBy(f: (T) -> R)") { inline(true) - doc { "Returns the first element yielding the smallest value of the given function or null if there are no elements" } + doc { "Returns the first element yielding the smallest value of the given function or `null` if there are no elements." } typeParam("R : Comparable") typeParam("T : Any") returns("T?") @@ -214,7 +215,7 @@ fun aggregates(): List { inline(true) only(Maps) - doc { "Returns the first element yielding the smallest value of the given function or null if there are no elements" } + doc { "Returns the first element yielding the smallest value of the given function or `null` if there are no elements." } typeParam("R : Comparable") returns("T?") body { @@ -238,7 +239,7 @@ fun aggregates(): List { } templates add f("max()") { - doc { "Returns the largest element or null if there are no elements" } + doc { "Returns the largest element or `null` if there are no elements." } returns("T?") exclude(PrimitiveType.Boolean) typeParam("T : Comparable") @@ -273,7 +274,7 @@ fun aggregates(): List { templates add f("maxBy(f: (T) -> R)") { inline(true) - doc { "Returns the first element yielding the largest value of the given function or null if there are no elements" } + doc { "Returns the first element yielding the largest value of the given function or `null` if there are no elements." } typeParam("R : Comparable") typeParam("T : Any") returns("T?") @@ -318,7 +319,7 @@ fun aggregates(): List { inline(true) only(Maps) - doc { "Returns the first element yielding the largest value of the given function or null if there are no elements" } + doc { "Returns the first element yielding the largest value of the given function or `null` if there are no elements." } typeParam("R : Comparable") returns("T?") body { @@ -344,7 +345,7 @@ fun aggregates(): List { templates add f("fold(initial: R, operation: (R, T) -> R)") { inline(true) - doc { "Accumulates value starting with *initial* value and applying *operation* from left to right to current accumulator value and each element" } + doc { "Accumulates value starting with [initial] value and applying [operation] from left to right to current accumulator value and each element." } typeParam("R") returns("R") body { @@ -360,7 +361,7 @@ fun aggregates(): List { inline(true) only(Strings, Lists, ArraysOfObjects, ArraysOfPrimitives) - doc { "Accumulates value starting with *initial* value and applying *operation* from right to left to each element and current accumulator value" } + doc { "Accumulates value starting with [initial] value and applying [operation] from right to left to each element and current accumulator value." } typeParam("R") returns("R") body { @@ -380,12 +381,12 @@ fun aggregates(): List { inline(true) exclude(ArraysOfObjects, Iterables, Sequences) - doc { "Accumulates value starting with the first element and applying *operation* from left to right to current accumulator value and each element" } + doc { "Accumulates value starting with the first element and applying [operation] from left to right to current accumulator value and each element." } returns("T") body { """ val iterator = this.iterator() - if (!iterator.hasNext()) throw UnsupportedOperationException("Empty iterable can't be reduced") + if (!iterator.hasNext()) throw UnsupportedOperationException("Empty iterable can't be reduced.") var accumulator = iterator.next() while (iterator.hasNext()) { @@ -400,14 +401,14 @@ fun aggregates(): List { inline(true) only(ArraysOfObjects, Iterables, Sequences) - doc { "Accumulates value starting with the first element and applying *operation* from left to right to current accumulator value and each element" } + doc { "Accumulates value starting with the first element and applying [operation] from left to right to current accumulator value and each element." } typeParam("S") typeParam("T: S") returns("S") body { """ val iterator = this.iterator() - if (!iterator.hasNext()) throw UnsupportedOperationException("Empty iterable can't be reduced") + if (!iterator.hasNext()) throw UnsupportedOperationException("Empty iterable can't be reduced.") var accumulator: S = iterator.next() while (iterator.hasNext()) { @@ -422,12 +423,12 @@ fun aggregates(): List { inline(true) only(Strings, ArraysOfPrimitives) - doc { "Accumulates value starting with last element and applying *operation* from right to left to each element and current accumulator value" } + doc { "Accumulates value starting with last element and applying [operation] from right to left to each element and current accumulator value." } returns("T") body { """ var index = lastIndex - if (index < 0) throw UnsupportedOperationException("Empty iterable can't be reduced") + if (index < 0) throw UnsupportedOperationException("Empty iterable can't be reduced.") var accumulator = get(index--) while (index >= 0) { @@ -443,14 +444,14 @@ fun aggregates(): List { inline(true) only(Lists, ArraysOfObjects) - doc { "Accumulates value starting with last element and applying *operation* from right to left to each element and current accumulator value" } + doc { "Accumulates value starting with last element and applying [operation] from right to left to each element and current accumulator value." } typeParam("S") typeParam("T: S") returns("S") body { """ var index = lastIndex - if (index < 0) throw UnsupportedOperationException("Empty iterable can't be reduced") + if (index < 0) throw UnsupportedOperationException("Empty iterable can't be reduced.") var accumulator: S = get(index--) while (index >= 0) { @@ -465,7 +466,7 @@ fun aggregates(): List { templates add f("forEach(operation: (T) -> Unit)") { inline(true) - doc { "Performs the given *operation* on each element" } + doc { "Performs the given [operation] on each element." } returns("Unit") body { """ @@ -477,7 +478,7 @@ fun aggregates(): List { templates add f("forEachIndexed(operation: (Int, T) -> Unit)") { inline(true) - doc { "Performs the given *operation* on each element, providing sequential index with the element" } + doc { "Performs the given [operation] on each element, providing sequential index with the element." } returns("Unit") body { """ diff --git a/libraries/tools/kotlin-stdlib-gen/src/templates/Arrays.kt b/libraries/tools/kotlin-stdlib-gen/src/templates/Arrays.kt index 92c8f8784c4..99592c3663d 100644 --- a/libraries/tools/kotlin-stdlib-gen/src/templates/Arrays.kt +++ b/libraries/tools/kotlin-stdlib-gen/src/templates/Arrays.kt @@ -7,7 +7,7 @@ fun arrays(): List { templates add f("isEmpty()") { only(ArraysOfObjects, ArraysOfPrimitives) - doc { "Returns true if the array is empty" } + doc { "Returns `true` if the array is empty." } returns("Boolean") body { "return size() == 0" @@ -16,7 +16,7 @@ fun arrays(): List { templates add f("isNotEmpty()") { only(ArraysOfObjects, ArraysOfPrimitives) - doc { "Returns true if the array is not empty" } + doc { "Returns `true` if the array is not empty." } returns("Boolean") body { "return !isEmpty()" @@ -25,7 +25,7 @@ fun arrays(): List { templates add f("asIterable()") { only(ArraysOfObjects, ArraysOfPrimitives) - doc { "Returns the Iterable that wraps the original array" } + doc { "Returns the Iterable that wraps the original array." } returns("Iterable") body { """ @@ -38,7 +38,7 @@ fun arrays(): List { templates add pval("lastIndex") { only(ArraysOfObjects, ArraysOfPrimitives) - doc { "Returns the last valid index for the array" } + doc { "Returns the last valid index for the array." } returns("Int") body { "get() = size() - 1" @@ -47,7 +47,7 @@ fun arrays(): List { templates add pval("indices") { only(ArraysOfObjects, ArraysOfPrimitives) - doc { "Returns the range of valid indices for the array" } + doc { "Returns the range of valid indices for the array." } returns("IntRange") body { "get() = IntRange(0, lastIndex)" diff --git a/libraries/tools/kotlin-stdlib-gen/src/templates/Elements.kt b/libraries/tools/kotlin-stdlib-gen/src/templates/Elements.kt index 656311871f4..1a1553ee019 100644 --- a/libraries/tools/kotlin-stdlib-gen/src/templates/Elements.kt +++ b/libraries/tools/kotlin-stdlib-gen/src/templates/Elements.kt @@ -6,7 +6,7 @@ fun elements(): List { val templates = arrayListOf() templates add f("contains(element: T)") { - doc { "Returns true if *element* is found in the collection" } + doc { "Returns `true` if [element] is found in the collection." } returns("Boolean") body { """ @@ -25,7 +25,7 @@ fun elements(): List { templates add f("indexOf(element: T)") { exclude(Strings, Lists) // has native implementation - doc { "Returns first index of [element], or -1 if the collection does not contain element" } + doc { "Returns first index of [element], or -1 if the collection does not contain element." } returns("Int") body { """ @@ -71,7 +71,7 @@ fun elements(): List { templates add f("lastIndexOf(element: T)") { exclude(Strings, Lists) // has native implementation - doc { "Returns last index of *element*, or -1 if the collection does not contain element" } + doc { "Returns last index of [element], or -1 if the collection does not contain element." } returns("Int") body { """ @@ -119,7 +119,7 @@ fun elements(): List { templates add f("indexOfFirst(predicate: (T) -> Boolean)") { inline(true) - doc { "Returns index of the first element matching the given [predicate], or -1 if the collection does not contain such element" } + doc { "Returns index of the first element matching the given [predicate], or -1 if the collection does not contain such element." } returns("Int") body { """ @@ -148,7 +148,7 @@ fun elements(): List { templates add f("indexOfLast(predicate: (T) -> Boolean)") { inline(true) - doc { "Returns index of the last element matching the given [predicate], or -1 if the collection does not contain such element" } + doc { "Returns index of the last element matching the given [predicate], or -1 if the collection does not contain such element." } returns("Int") body { """ @@ -184,12 +184,12 @@ fun elements(): List { if (this is List) return get(index) - return elementAtOrElse(index) { throw IndexOutOfBoundsException("Collection doesn't contain element at index $index") } + return elementAtOrElse(index) { throw IndexOutOfBoundsException("Collection doesn't contain element at index $index.") } """ } body(Sequences) { """ - return elementAtOrElse(index) { throw IndexOutOfBoundsException("Sequence doesn't contain element at index $index") } + return elementAtOrElse(index) { throw IndexOutOfBoundsException("Sequence doesn't contain element at index $index.") } """ } body(Strings, Lists, ArraysOfObjects, ArraysOfPrimitives) { @@ -283,10 +283,10 @@ fun elements(): List { templates add f("first()") { doc { """Returns first element. - @throws NoSuchElementException if the collection is empty. + @throws [NoSuchElementException] if the collection is empty. """ } doc(Strings) { """Returns first character. - @throws NoSuchElementException if the string is empty. + @throws [NoSuchElementException] if the string is empty. """ } returns("T") body { @@ -294,14 +294,14 @@ fun elements(): List { when (this) { is List<*> -> { if (isEmpty()) - throw NoSuchElementException("Collection is empty") + throw NoSuchElementException("Collection is empty.") else return this[0] as T } else -> { val iterator = iterator() if (!iterator.hasNext()) - throw NoSuchElementException("Collection is empty") + throw NoSuchElementException("Collection is empty.") return iterator.next() } } @@ -310,14 +310,14 @@ fun elements(): List { body(Strings, Lists, ArraysOfObjects, ArraysOfPrimitives) { """ if (isEmpty()) - throw NoSuchElementException("Collection is empty") + throw NoSuchElementException("Collection is empty.") return this[0] """ } } templates add f("firstOrNull()") { - doc { "Returns the first element, or null if the collection is empty." } - doc(Strings) { "Returns the first character, or null if string is empty." } + doc { "Returns the first element, or `null` if the collection is empty." } + doc(Strings) { "Returns the first character, or `null` if string is empty." } returns("T?") body { """ @@ -348,14 +348,14 @@ fun elements(): List { inline(true) doc { """Returns the first element matching the given [predicate]. - @throws NoSuchElementException if no such element is found.""" } + @throws [NoSuchElementException] if no such element is found.""" } doc(Strings) { """Returns the first character matching the given [predicate]. - @throws NoSuchElementException if no such character is found.""" } + @throws [NoSuchElementException] if no such character is found.""" } returns("T") body { """ for (element in this) if (predicate(element)) return element - throw NoSuchElementException("No element matching predicate was found") + throw NoSuchElementException("No element matching predicate was found.") """ } } @@ -363,8 +363,8 @@ fun elements(): List { templates add f("firstOrNull(predicate: (T) -> Boolean)") { inline(true) - doc { "Returns the first element matching the given [predicate], or `null` if element was not found" } - doc(Strings) { "Returns the first character matching the given [predicate], or `null` if character was not found" } + doc { "Returns the first element matching the given [predicate], or `null` if element was not found." } + doc(Strings) { "Returns the first character matching the given [predicate], or `null` if character was not found." } returns("T?") body { """ @@ -376,23 +376,23 @@ fun elements(): List { templates add f("last()") { doc { """Returns the last element. - @throws NoSuchElementException if the collection is empty.""" } + @throws [NoSuchElementException] if the collection is empty.""" } doc(Strings) { """"Returns the last character. - @throws NoSuchElementException if the string is empty.""" } + @throws [NoSuchElementException] if the string is empty.""" } returns("T") body { """ when (this) { is List<*> -> { if (isEmpty()) - throw NoSuchElementException("Collection is empty") + throw NoSuchElementException("Collection is empty.") else return this[this.lastIndex] as T } else -> { val iterator = iterator() if (!iterator.hasNext()) - throw NoSuchElementException("Collection is empty") + throw NoSuchElementException("Collection is empty.") var last = iterator.next() while (iterator.hasNext()) last = iterator.next() @@ -405,7 +405,7 @@ fun elements(): List { """ val iterator = iterator() if (!iterator.hasNext()) - throw NoSuchElementException("Collection is empty") + throw NoSuchElementException("Collection is empty.") var last = iterator.next() while (iterator.hasNext()) last = iterator.next() @@ -415,15 +415,15 @@ fun elements(): List { body(Strings, Lists, ArraysOfObjects, ArraysOfPrimitives) { """ if (isEmpty()) - throw NoSuchElementException("Collection is empty") + throw NoSuchElementException("Collection is empty.") return this[lastIndex] """ } } templates add f("lastOrNull()") { - doc { "Returns the last element, or `null` if the collection is empty" } - doc(Strings) { "Returns the last character, or `null` if the string is empty" } + doc { "Returns the last element, or `null` if the collection is empty." } + doc(Strings) { "Returns the last character, or `null` if the string is empty." } returns("T?") body { """ @@ -467,9 +467,9 @@ fun elements(): List { templates add f("last(predicate: (T) -> Boolean)") { inline(true) doc { """Returns the last element matching the given [predicate]. - @throws NoSuchElementException if no such element is found.""" } + @throws [NoSuchElementException] if no such element is found.""" } doc(Strings) { """"Returns the last character matching the given [predicate]. - @throws NoSuchElementException if no such character is found.""" } + @throws [NoSuchElementException] if no such character is found.""" } returns("T") body { """ @@ -568,17 +568,17 @@ fun elements(): List { """ when (this) { is List<*> -> return when (size()) { - 0 -> throw NoSuchElementException("Collection is empty") + 0 -> throw NoSuchElementException("Collection is empty.") 1 -> this[0] as T - else -> throw IllegalArgumentException("Collection has more than one element") + else -> throw IllegalArgumentException("Collection has more than one element.") } else -> { val iterator = iterator() if (!iterator.hasNext()) - throw NoSuchElementException("Collection is empty") + throw NoSuchElementException("Collection is empty.") var single = iterator.next() if (iterator.hasNext()) - throw IllegalArgumentException("Collection has more than one element") + throw IllegalArgumentException("Collection has more than one element.") return single } } @@ -587,18 +587,18 @@ fun elements(): List { body(Strings) { """ return when (length()) { - 0 -> throw NoSuchElementException("Collection is empty") + 0 -> throw NoSuchElementException("Collection is empty.") 1 -> this[0] - else -> throw IllegalArgumentException("Collection has more than one element") + else -> throw IllegalArgumentException("Collection has more than one element.") } """ } body(Lists, ArraysOfObjects, ArraysOfPrimitives) { """ return when (size()) { - 0 -> throw NoSuchElementException("Collection is empty") + 0 -> throw NoSuchElementException("Collection is empty.") 1 -> this[0] - else -> throw IllegalArgumentException("Collection has more than one element") + else -> throw IllegalArgumentException("Collection has more than one element.") } """ } @@ -638,8 +638,8 @@ fun elements(): List { templates add f("single(predicate: (T) -> Boolean)") { inline(true) - doc { "Returns the single element matching the given [predicate], or throws exception if there is no or more than one matching element" } - doc(Strings) { "Returns the single character matching the given [predicate], or throws exception if there is no or more than one matching character" } + doc { "Returns the single element matching the given [predicate], or throws exception if there is no or more than one matching element." } + doc(Strings) { "Returns the single character matching the given [predicate], or throws exception if there is no or more than one matching character." } returns("T") body { """ @@ -647,12 +647,12 @@ fun elements(): List { var found = false for (element in this) { if (predicate(element)) { - if (found) throw IllegalArgumentException("Collection contains more than one matching element") + if (found) throw IllegalArgumentException("Collection contains more than one matching element.") single = element found = true } } - if (!found) throw NoSuchElementException("Collection doesn't contain any element matching predicate") + if (!found) throw NoSuchElementException("Collection doesn't contain any element matching predicate.") return single as T """ } @@ -660,8 +660,8 @@ fun elements(): List { templates add f("singleOrNull(predicate: (T) -> Boolean)") { inline(true) - doc { "Returns the single element matching the given [predicate], or `null` if element was not found or more than one element was found" } - doc(Strings) { "Returns the single character matching the given [predicate], or `null` if character was not found or more than one character was found" } + doc { "Returns the single element matching the given [predicate], or `null` if element was not found or more than one element was found." } + doc(Strings) { "Returns the single character matching the given [predicate], or `null` if character was not found or more than one character was found." } returns("T?") body { """ diff --git a/libraries/tools/kotlin-stdlib-gen/src/templates/Filtering.kt b/libraries/tools/kotlin-stdlib-gen/src/templates/Filtering.kt index 71dc776db15..f6b10ecd454 100644 --- a/libraries/tools/kotlin-stdlib-gen/src/templates/Filtering.kt +++ b/libraries/tools/kotlin-stdlib-gen/src/templates/Filtering.kt @@ -7,7 +7,7 @@ fun filtering(): List { templates add f("drop(n: Int)") { val n = "\$n" - doc { "Returns a list containing all elements except first [n] elements" } + doc { "Returns a list containing all elements except first [n] elements." } returns("List") body { """ @@ -37,7 +37,7 @@ fun filtering(): List { """ } - doc(Sequences) { "Returns a sequence containing all elements except first [n] elements" } + doc(Sequences) { "Returns a sequence containing all elements except first [n] elements." } returns(Sequences) { "Sequence" } body(Sequences) { """ @@ -46,7 +46,7 @@ fun filtering(): List { """ } - doc(Strings) { "Returns a string with the first [n] characters removed"} + doc(Strings) { "Returns a string with the first [n] characters removed."} body(Strings) { "return substring(Math.min(n, length()))" } returns(Strings) { "String" } @@ -67,7 +67,7 @@ fun filtering(): List { templates add f("take(n: Int)") { val n = "\$n" - doc { "Returns a list containing first [n] elements" } + doc { "Returns a list containing first [n] elements." } returns("List") body { """ @@ -83,7 +83,7 @@ fun filtering(): List { """ } - doc(Strings) { "Returns a string containing the first [n] characters from this string, or the entire string if this string is shorter"} + doc(Strings) { "Returns a string containing the first [n] characters from this string, or the entire string if this string is shorter."} body(Strings) { """ require(n >= 0, { "Requested element count $n is less than zero." }) @@ -92,7 +92,7 @@ fun filtering(): List { } returns(Strings) { "String" } - doc(Sequences) { "Returns a sequence containing first *n* elements" } + doc(Sequences) { "Returns a sequence containing first [n] elements." } returns(Sequences) { "Sequence" } body(Sequences) { """ @@ -119,11 +119,11 @@ fun filtering(): List { templates add f("takeLast(n: Int)") { val n = "\$n" - doc { "Returns a list containing last [n] elements" } + doc { "Returns a list containing last [n] elements." } only(Lists, ArraysOfObjects, ArraysOfPrimitives, Strings) returns("List") - doc(Strings) { "Returns a string containing the last [n] characters from this string, or the entire string if this string is shorter"} + doc(Strings) { "Returns a string containing the last [n] characters from this string, or the entire string if this string is shorter."} body(Strings) { """ require(n >= 0, { "Requested element count $n is less than zero." }) @@ -149,7 +149,7 @@ fun filtering(): List { templates add f("dropWhile(predicate: (T) -> Boolean)") { inline(true) - doc { "Returns a list containing all elements except first elements that satisfy the given [predicate]" } + doc { "Returns a list containing all elements except first elements that satisfy the given [predicate]." } returns("List") body { """ @@ -166,7 +166,7 @@ fun filtering(): List { """ } - doc(Strings) { "Returns a string containing all characters except first characters that satisfy the given [predicate]" } + doc(Strings) { "Returns a string containing all characters except first characters that satisfy the given [predicate]." } returns(Strings) { "String" } body(Strings) { """ @@ -179,7 +179,7 @@ fun filtering(): List { } inline(false, Sequences) - doc(Sequences) { "Returns a sequence containing all elements except first elements that satisfy the given [predicate]" } + doc(Sequences) { "Returns a sequence containing all elements except first elements that satisfy the given [predicate]." } returns(Sequences) { "Sequence" } body(Sequences) { """ @@ -192,7 +192,7 @@ fun filtering(): List { templates add f("takeWhile(predicate: (T) -> Boolean)") { inline(true) - doc { "Returns a list containing first elements satisfying the given [predicate]" } + doc { "Returns a list containing first elements satisfying the given [predicate]." } returns("List") body { """ @@ -206,7 +206,7 @@ fun filtering(): List { """ } - doc(Strings) { "Returns a string containing the first characters that satisfy the given [predicate]"} + doc(Strings) { "Returns a string containing the first characters that satisfy the given [predicate]."} returns(Strings) { "String" } body(Strings) { """ @@ -219,7 +219,7 @@ fun filtering(): List { } inline(false, Sequences) - doc(Sequences) { "Returns a sequence containing first elements satisfying the given [predicate]" } + doc(Sequences) { "Returns a sequence containing first elements satisfying the given [predicate]." } returns(Sequences) { "Sequence" } body(Sequences) { """ @@ -231,7 +231,7 @@ fun filtering(): List { templates add f("filter(predicate: (T) -> Boolean)") { inline(true) - doc { "Returns a list containing all elements matching the given [predicate]" } + doc { "Returns a list containing all elements matching the given [predicate]." } returns("List") body { """ @@ -239,7 +239,7 @@ fun filtering(): List { """ } - doc(Strings) { "Returns a string containing only those characters from the original string that match the given [predicate]" } + doc(Strings) { "Returns a string containing only those characters from the original string that match the given [predicate]." } returns(Strings) { "String" } body(Strings) { """ @@ -248,7 +248,7 @@ fun filtering(): List { } inline(false, Sequences) - doc(Sequences) { "Returns a sequence containing all elements matching the given [predicate]" } + doc(Sequences) { "Returns a sequence containing all elements matching the given [predicate]." } returns(Sequences) { "Sequence" } body(Sequences) { """ @@ -260,7 +260,7 @@ fun filtering(): List { templates add f("filterTo(destination: C, predicate: (T) -> Boolean)") { inline(true) - doc { "Appends all elements matching the given [predicate] into the given [destination]" } + doc { "Appends all elements matching the given [predicate] into the given [destination]." } typeParam("C : TCollection") returns("C") @@ -271,7 +271,7 @@ fun filtering(): List { """ } - doc(Strings) { "Appends all characters matching the given [predicate] to the given [destination]" } + doc(Strings) { "Appends all characters matching the given [predicate] to the given [destination]." } body(Strings) { """ for (index in 0..length - 1) { @@ -286,7 +286,7 @@ fun filtering(): List { templates add f("filterNot(predicate: (T) -> Boolean)") { inline(true) - doc { "Returns a list containing all elements not matching the given [predicate]" } + doc { "Returns a list containing all elements not matching the given [predicate]." } returns("List") body { """ @@ -294,7 +294,7 @@ fun filtering(): List { """ } - doc(Strings) { "Returns a string containing only those characters from the original string that do not match the given [predicate]" } + doc(Strings) { "Returns a string containing only those characters from the original string that do not match the given [predicate]." } returns(Strings) { "String" } body(Strings) { """ @@ -303,7 +303,7 @@ fun filtering(): List { } inline(false, Sequences) - doc(Sequences) { "Returns a sequence containing all elements not matching the given [predicate]" } + doc(Sequences) { "Returns a sequence containing all elements not matching the given [predicate]." } returns(Sequences) { "Sequence" } body(Sequences) { """ @@ -315,7 +315,7 @@ fun filtering(): List { templates add f("filterNotTo(destination: C, predicate: (T) -> Boolean)") { inline(true) - doc { "Appends all elements not matching the given [predicate] to the given [destination]" } + doc { "Appends all elements not matching the given [predicate] to the given [destination]." } typeParam("C : TCollection") returns("C") @@ -326,7 +326,7 @@ fun filtering(): List { """ } - doc(Strings) { "Appends all characters not matching the given [predicate] to the given [destination]" } + doc(Strings) { "Appends all characters not matching the given [predicate] to the given [destination]." } body(Strings) { """ for (element in this) if (!predicate(element)) destination.append(element) @@ -337,7 +337,7 @@ fun filtering(): List { templates add f("filterNotNull()") { exclude(ArraysOfPrimitives, Strings) - doc { "Returns a list containing all elements that are not null" } + doc { "Returns a list containing all elements that are not `null`." } typeParam("T : Any") returns("List") toNullableT = true @@ -347,7 +347,7 @@ fun filtering(): List { """ } - doc(Sequences) { "Returns a sequence containing all elements that are not null" } + doc(Sequences) { "Returns a sequence containing all elements that are not `null`." } returns(Sequences) { "Sequence" } body(Sequences) { """ @@ -358,7 +358,7 @@ fun filtering(): List { templates add f("filterNotNullTo(destination: C)") { exclude(ArraysOfPrimitives, Strings) - doc { "Appends all elements that are not null to the given [destination]" } + doc { "Appends all elements that are not `null` to the given [destination]." } returns("C") typeParam("C : TCollection") typeParam("T : Any") @@ -373,7 +373,7 @@ fun filtering(): List { templates add f("slice(indices: Iterable)") { only(Strings, Lists, ArraysOfPrimitives, ArraysOfObjects) - doc { "Returns a list containing elements at specified positions" } + doc { "Returns a list containing elements at specified [indices]." } returns("List") body { """ @@ -385,7 +385,7 @@ fun filtering(): List { """ } - doc(Strings) { "Returns a string containing characters at specified positions" } + doc(Strings) { "Returns a string containing characters at specified [indices]." } returns(Strings) { "String" } body(Strings) { """ diff --git a/libraries/tools/kotlin-stdlib-gen/src/templates/Generators.kt b/libraries/tools/kotlin-stdlib-gen/src/templates/Generators.kt index 83786c50b03..d0ad881be7b 100644 --- a/libraries/tools/kotlin-stdlib-gen/src/templates/Generators.kt +++ b/libraries/tools/kotlin-stdlib-gen/src/templates/Generators.kt @@ -7,7 +7,7 @@ fun generators(): List { templates add f("plus(element: T)") { exclude(Strings) - doc { "Returns a list containing all elements of original collection and then the given element" } + doc { "Returns a list containing all elements of original collection and then the given [element]." } returns("List") body { """ @@ -26,7 +26,7 @@ fun generators(): List { """ } - doc(Sequences) { "Returns a sequence containing all elements of original sequence and then the given element" } + doc(Sequences) { "Returns a sequence containing all elements of original sequence and then the given [element]." } returns(Sequences) { "Sequence" } body(Sequences) { """ @@ -37,7 +37,7 @@ fun generators(): List { templates add f("plus(collection: Iterable)") { exclude(Strings, Sequences) - doc { "Returns a list containing all elements of original collection and then all elements of the given *collection*" } + doc { "Returns a list containing all elements of original collection and then all elements of the given [collection]." } returns("List") body { """ @@ -60,7 +60,7 @@ fun generators(): List { templates add f("plus(array: Array)") { exclude(Strings, Sequences) - doc { "Returns a list containing all elements of original collection and then all elements of the given *collection*" } + doc { "Returns a list containing all elements of original collection and then all elements of the given [collection]." } returns("List") body { """ @@ -82,7 +82,7 @@ fun generators(): List { templates add f("plus(collection: Iterable)") { only(Sequences) - doc { "Returns a sequence containing all elements of original sequence and then all elements of the given [collection]" } + doc { "Returns a sequence containing all elements of original sequence and then all elements of the given [collection]." } returns("Sequence") body { """ @@ -93,7 +93,7 @@ fun generators(): List { templates add f("plus(sequence: Sequence)") { only(Sequences) - doc { "Returns a sequence containing all elements of original sequence and then all elements of the given [sequence]" } + doc { "Returns a sequence containing all elements of original sequence and then all elements of the given [sequence]." } returns("Sequence") body { """ @@ -108,8 +108,8 @@ fun generators(): List { doc { """ Splits original collection into pair of collections, - where *first* collection contains elements for which predicate yielded *true*, - while *second* collection contains elements for which predicate yielded *false* + where *first* collection contains elements for which [predicate] yielded [true], + while *second* collection contains elements for which [predicate] yielded [false]. """ } // TODO: Sequence variant @@ -150,7 +150,7 @@ fun generators(): List { exclude(Sequences, Strings) doc { """ - Returns a list of values built from elements of both collections with same indexes using provided *transform*. List has length of shortest collection. + Returns a list of values built from elements of both collections with same indexes using provided [transform]. List has length of shortest collection. """ } typeParam("R") @@ -185,7 +185,7 @@ fun generators(): List { exclude(Sequences, Strings) doc { """ - Returns a list of values built from elements of both collections with same indexes using provided *transform*. List has length of shortest collection. + Returns a list of values built from elements of both collections with same indexes using provided [transform]. List has length of shortest collection. """ } typeParam("R") @@ -222,7 +222,7 @@ fun generators(): List { only(ArraysOfPrimitives) doc { """ - Returns a list of values built from elements of both collections with same indexes using provided *transform*. List has length of shortest collection. + Returns a list of values built from elements of both collections with same indexes using provided [transform]. List has length of shortest collection. """ } typeParam("V") @@ -246,7 +246,7 @@ fun generators(): List { only(Sequences) doc { """ - 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. + 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. """ } typeParam("R") diff --git a/libraries/tools/kotlin-stdlib-gen/src/templates/Guards.kt b/libraries/tools/kotlin-stdlib-gen/src/templates/Guards.kt index f924fc323b8..a3d7b38453a 100644 --- a/libraries/tools/kotlin-stdlib-gen/src/templates/Guards.kt +++ b/libraries/tools/kotlin-stdlib-gen/src/templates/Guards.kt @@ -11,7 +11,7 @@ fun guards(): List { templates add f("requireNoNulls()") { include(Lists) exclude(Strings, ArraysOfPrimitives) - doc { "Returns an original collection containing all the non-*null* elements, throwing an [[IllegalArgumentException]] if there are any null elements" } + doc { "Returns an original collection containing all the non-`null` elements, throwing an [IllegalArgumentException] if there are any `null` elements." } typeParam("T : Any") toNullableT = true returns("SELF") @@ -19,7 +19,7 @@ fun guards(): List { """ for (element in this) { if (element == null) { - throw IllegalArgumentException("null element found in $THIS") + throw IllegalArgumentException("null element found in $THIS.") } } return this as SELF @@ -27,7 +27,7 @@ fun guards(): List { } body(Sequences) { """ - return map { it ?: throw IllegalArgumentException("null element found in $THIS") } + return map { it ?: throw IllegalArgumentException("null element found in $THIS.") } """ } } diff --git a/libraries/tools/kotlin-stdlib-gen/src/templates/Mapping.kt b/libraries/tools/kotlin-stdlib-gen/src/templates/Mapping.kt index 563679e2be3..d0213bb3762 100644 --- a/libraries/tools/kotlin-stdlib-gen/src/templates/Mapping.kt +++ b/libraries/tools/kotlin-stdlib-gen/src/templates/Mapping.kt @@ -7,7 +7,7 @@ fun mapping(): List { templates add f("withIndices()") { deprecate { "Use withIndex() instead." } - doc { "Returns a list containing pairs of each element of the original collection and their index" } + doc { "Returns a list containing pairs of each element of the original collection and their index." } returns("List>") body { """ @@ -17,7 +17,7 @@ fun mapping(): List { } returns(Sequences) { "Sequence>" } - doc(Sequences) { "Returns a sequence containing pairs of each element of the original collection and their index" } + doc(Sequences) { "Returns a sequence containing pairs of each element of the original collection and their index." } body(Sequences) { """ var index = 0 @@ -27,7 +27,7 @@ fun mapping(): List { } templates add f("withIndex()") { - doc { "Returns a lazy [Iterable] of [IndexedValue] for each element of the original collection" } + doc { "Returns a lazy [Iterable] of [IndexedValue] for each element of the original collection." } returns("Iterable>") body { """ @@ -36,7 +36,7 @@ fun mapping(): List { } returns(Sequences) { "Sequence>" } - doc(Sequences) { "Returns a sequence of [IndexedValue] for each element of the original sequence" } + doc(Sequences) { "Returns a sequence of [IndexedValue] for each element of the original sequence." } body(Sequences) { """ return IndexingSequence(this) @@ -47,7 +47,7 @@ fun mapping(): List { templates add f("mapIndexed(transform: (Int, T) -> R)") { inline(true) - doc { "Returns a list containing the results of applying the given *transform* function to each element and its index of the original collection" } + doc { "Returns a list containing the results of applying the given [transform] function to each element and its index of the original collection." } typeParam("R") returns("List") body { @@ -61,7 +61,7 @@ fun mapping(): List { } inline(false, Sequences) returns(Sequences) { "Sequence" } - doc(Sequences) { "Returns a sequence containing the results of applying the given *transform* function to each element and its index of the original sequence" } + doc(Sequences) { "Returns a sequence containing the results of applying the given [transform] function to each element and its index of the original sequence." } body(Sequences) { "return TransformingIndexedSequence(this, transform)" } @@ -70,7 +70,7 @@ fun mapping(): List { templates add f("map(transform: (T) -> R)") { inline(true) - doc { "Returns a list containing the results of applying the given *transform* function to each element of the original collection" } + doc { "Returns a list containing the results of applying the given [transform] function to each element of the original collection." } typeParam("R") returns("List") body { @@ -85,7 +85,7 @@ fun mapping(): List { inline(false, Sequences) returns(Sequences) { "Sequence" } - doc(Sequences) { "Returns a sequence containing the results of applying the given *transform* function to each element of the original sequence" } + doc(Sequences) { "Returns a sequence containing the results of applying the given [transform] function to each element of the original sequence." } body(Sequences) { "return TransformingSequence(this, transform)" } @@ -95,7 +95,7 @@ fun mapping(): List { templates add f("mapNotNull(transform: (T) -> R)") { inline(true) exclude(Strings, ArraysOfPrimitives) - doc { "Returns a list containing the results of applying the given *transform* function to each non-null element of the original collection" } + doc { "Returns a list containing the results of applying the given [transform] function to each non-null element of the original collection." } typeParam("T : Any") typeParam("R") returns("List") @@ -106,7 +106,7 @@ fun mapping(): List { """ } - doc(Sequences) { "Returns a sequence containing the results of applying the given *transform* function to each non-null element of the original sequence" } + doc(Sequences) { "Returns a sequence containing the results of applying the given [transform] function to each non-null element of the original sequence." } returns(Sequences) { "Sequence" } inline(false, Sequences) body(Sequences) { @@ -121,8 +121,8 @@ fun mapping(): List { doc { """ - Appends transformed elements of the original collection using the given *transform* function - to the given *destination* + Appends transformed elements of the original collection using the given [transform] function + to the given [destination]. """ } typeParam("R") @@ -144,8 +144,8 @@ fun mapping(): List { doc { """ - Appends transformed elements and their indices of the original collection using the given *transform* function - to the given *destination* + Appends transformed elements and their indices of the original collection using the given [transform] function + to the given [destination]. """ } typeParam("R") @@ -168,8 +168,8 @@ fun mapping(): List { exclude(Strings, ArraysOfPrimitives) doc { """ - Appends transformed non-null elements of original collection using the given *transform* function - to the given *destination* + Appends transformed non-null elements of original collection using the given [transform] function + to the given [destination]. """ } typeParam("T : Any") @@ -193,7 +193,7 @@ fun mapping(): List { inline(true) exclude(Sequences) - doc { "Returns a single list of all elements yielded from results of *transform* function being invoked on each element of original collection" } + doc { "Returns a single list of all elements yielded from results of [transform] function being invoked on each element of original collection." } typeParam("R") returns("List") body { @@ -204,7 +204,7 @@ fun mapping(): List { templates add f("flatMap(transform: (T) -> Sequence)") { only(Sequences) - doc { "Returns a single sequence of all elements from results of *transform* function being invoked on each element of original sequence" } + doc { "Returns a single sequence of all elements from results of [transform] function being invoked on each element of original sequence." } typeParam("R") returns("Sequence") body { @@ -215,7 +215,7 @@ fun mapping(): List { templates add f("flatMapTo(destination: C, transform: (T) -> Iterable)") { inline(true) exclude(Sequences) - doc { "Appends all elements yielded from results of *transform* function being invoked on each element of original collection, to the given *destination*" } + doc { "Appends all elements yielded from results of [transform] function being invoked on each element of original collection, to the given [destination]." } typeParam("R") typeParam("C : MutableCollection") returns("C") @@ -235,7 +235,7 @@ fun mapping(): List { inline(true) only(Sequences) - doc { "Appends all elements yielded from results of *transform* function being invoked on each element of original sequence, to the given *destination*" } + doc { "Appends all elements yielded from results of [transform] function being invoked on each element of original sequence, to the given [destination]." } typeParam("R") typeParam("C : MutableCollection") returns("C") @@ -253,7 +253,7 @@ fun mapping(): List { templates add f("groupBy(toKey: (T) -> K)") { inline(true) - doc { "Returns a map of the elements in original collection grouped by the result of given *toKey* function" } + doc { "Returns a map of the elements in original collection grouped by the result of given [toKey] function." } typeParam("K") returns("Map>") body { "return groupByTo(LinkedHashMap>(), toKey)" } @@ -263,7 +263,7 @@ fun mapping(): List { inline(true) typeParam("K") - doc { "Appends elements from original collection grouped by the result of given *toKey* function to the given *map*" } + doc { "Appends elements from original collection grouped by the result of given [toKey] function to the given [map]." } returns("Map>") body { """ diff --git a/libraries/tools/kotlin-stdlib-gen/src/templates/Numeric.kt b/libraries/tools/kotlin-stdlib-gen/src/templates/Numeric.kt index e225101e52f..4fea19c46c0 100644 --- a/libraries/tools/kotlin-stdlib-gen/src/templates/Numeric.kt +++ b/libraries/tools/kotlin-stdlib-gen/src/templates/Numeric.kt @@ -24,7 +24,7 @@ fun numeric(): List { templates add f("average()") { exclude(Strings) - doc { "Returns an average value of elements in the collection"} + doc { "Returns an average value of elements in the collection."} returns("Double") platformName("averageOf") body { diff --git a/libraries/tools/kotlin-stdlib-gen/src/templates/Ordering.kt b/libraries/tools/kotlin-stdlib-gen/src/templates/Ordering.kt index 408f4119539..02206b18a89 100644 --- a/libraries/tools/kotlin-stdlib-gen/src/templates/Ordering.kt +++ b/libraries/tools/kotlin-stdlib-gen/src/templates/Ordering.kt @@ -6,7 +6,7 @@ fun ordering(): List { val templates = arrayListOf() templates add f("reverse()") { - doc { "Returns a list with elements in reversed order" } + doc { "Returns a list with elements in reversed order." } returns { "List" } body { """ @@ -16,7 +16,7 @@ fun ordering(): List { """ } - doc(Strings) { "Returns a string with characters in reversed order" } + doc(Strings) { "Returns a string with characters in reversed order." } returns(Strings) { "String" } body(Strings) { // TODO: Replace with StringBuilder(this) when JS can handle it @@ -31,7 +31,7 @@ fun ordering(): List { templates add f("sort()") { doc { """ - Returns a sorted list of all elements + Returns a sorted list of all elements. """ } returns("List") @@ -53,7 +53,7 @@ fun ordering(): List { templates add f("toSortedList()") { doc { """ - Returns a sorted list of all elements + Returns a sorted list of all elements. """ } returns("List") @@ -72,7 +72,7 @@ fun ordering(): List { templates add f("sortDescending()") { doc { """ - Returns a sorted list of all elements, in descending order + Returns a sorted list of all elements, in descending order. """ } returns("List") @@ -96,7 +96,7 @@ fun ordering(): List { doc { """ - Returns a sorted list of all elements, ordered by results of specified *order* function. + Returns a sorted list of all elements, ordered by results of specified [order] function. """ } returns("List") @@ -118,7 +118,7 @@ fun ordering(): List { templates add f("toSortedListBy(order: (T) -> V)") { doc { """ - Returns a sorted list of all elements, ordered by results of specified *order* function. + Returns a sorted list of all elements, ordered by results of specified [order] function. """ } returns("List") @@ -141,7 +141,7 @@ fun ordering(): List { doc { """ - Returns a sorted list of all elements, in descending order by results of specified *order* function. + Returns a sorted list of all elements, in descending order by results of specified [order] function. """ } returns("List") @@ -163,7 +163,7 @@ fun ordering(): List { templates add f("sortBy(comparator: Comparator)") { doc { """ - Returns a list of all elements, sorted by the specified *comparator* + Returns a list of all elements, sorted by the specified [comparator]. """ } returns("List") diff --git a/libraries/tools/kotlin-stdlib-gen/src/templates/Ranges.kt b/libraries/tools/kotlin-stdlib-gen/src/templates/Ranges.kt index e33eae56d05..4fd0b7f48d3 100644 --- a/libraries/tools/kotlin-stdlib-gen/src/templates/Ranges.kt +++ b/libraries/tools/kotlin-stdlib-gen/src/templates/Ranges.kt @@ -8,8 +8,8 @@ fun ranges(): List { templates add f("reversed()") { only(RangesOfPrimitives, ProgressionsOfPrimitives) exclude(PrimitiveType.Boolean) - doc(ProgressionsOfPrimitives) { "Returns a progression that goes over the same range in the opposite direction with the same step" } - doc(RangesOfPrimitives) { "Returns a progression that goes over this range in reverse direction" } + doc(ProgressionsOfPrimitives) { "Returns a progression that goes over the same range in the opposite direction with the same step." } + doc(RangesOfPrimitives) { "Returns a progression that goes over this range in reverse direction." } returns("TProgression") body(RangesOfPrimitives) { "return TProgression(end, start, -ONE)" @@ -22,8 +22,8 @@ fun ranges(): List { templates add f("step(step: SUM)") { only(RangesOfPrimitives, ProgressionsOfPrimitives) exclude(PrimitiveType.Boolean) - doc(ProgressionsOfPrimitives) { "Returns a progression that goes over the same range with the given step" } - doc(RangesOfPrimitives) { "Returns a progression that goes over this range with given step" } + doc(ProgressionsOfPrimitives) { "Returns a progression that goes over the same range with the given step." } + doc(RangesOfPrimitives) { "Returns a progression that goes over this range with given step." } returns("TProgression") body(RangesOfPrimitives) { """ @@ -33,7 +33,7 @@ fun ranges(): List { } bodyForTypes(RangesOfPrimitives, PrimitiveType.Float, PrimitiveType.Double) { """ - if (step.isNaN()) throw IllegalArgumentException("Step must not be NaN") + if (step.isNaN()) throw IllegalArgumentException("Step must not be NaN.") checkStepIsPositive(step > 0, step) return TProgression(start, end, step) """ diff --git a/libraries/tools/kotlin-stdlib-gen/src/templates/Sequence.kt b/libraries/tools/kotlin-stdlib-gen/src/templates/Sequence.kt index 3e912c28a9a..480175ea5f3 100644 --- a/libraries/tools/kotlin-stdlib-gen/src/templates/Sequence.kt +++ b/libraries/tools/kotlin-stdlib-gen/src/templates/Sequence.kt @@ -45,7 +45,7 @@ fun sequences(): List { templates add f("asSequence()") { include(Maps) exclude(Sequences) - doc { "Returns a sequence from the given collection" } + doc { "Returns a sequence from the given collection." } returns("Sequence") body { """ diff --git a/libraries/tools/kotlin-stdlib-gen/src/templates/Snapshots.kt b/libraries/tools/kotlin-stdlib-gen/src/templates/Snapshots.kt index 207054efff3..ccf9a879d05 100644 --- a/libraries/tools/kotlin-stdlib-gen/src/templates/Snapshots.kt +++ b/libraries/tools/kotlin-stdlib-gen/src/templates/Snapshots.kt @@ -7,7 +7,7 @@ fun snapshots(): List { val templates = arrayListOf() templates add f("toCollection(collection: C)") { - doc { "Appends all elements to the given *collection*" } + doc { "Appends all elements to the given [collection]." } returns("C") typeParam("C : MutableCollection") body { @@ -21,7 +21,7 @@ fun snapshots(): List { } templates add f("toSet()") { - doc { "Returns a Set of all elements" } + doc { "Returns a [Set] of all elements." } returns("Set") body { "return toCollection(LinkedHashSet(mapCapacity(collectionSizeOrDefault(12))))" } body(Sequences) { "return toCollection(LinkedHashSet())" } @@ -30,7 +30,7 @@ fun snapshots(): List { } templates add f("toHashSet()") { - doc { "Returns a HashSet of all elements" } + doc { "Returns a [HashSet] of all elements." } returns("HashSet") body { "return toCollection(HashSet(mapCapacity(collectionSizeOrDefault(12))))" } body(Sequences) { "return toCollection(HashSet())" } @@ -39,13 +39,13 @@ fun snapshots(): List { } templates add f("toSortedSet()") { - doc { "Returns a SortedSet of all elements" } + doc { "Returns a [SortedSet] of all elements." } returns("SortedSet") body { "return toCollection(TreeSet())" } } templates add f("toArrayList()") { - doc { "Returns an ArrayList of all elements" } + doc { "Returns an [ArrayList] of all elements." } returns("ArrayList") body { "return toCollection(ArrayList())" } body(Iterables) { @@ -69,7 +69,7 @@ fun snapshots(): List { templates add f("toList()") { only(Maps) - doc { "Returns a List containing all key-value pairs" } + doc { "Returns a [List] containing all key-value pairs." } returns("List>") body { """ @@ -82,13 +82,13 @@ fun snapshots(): List { } templates add f("toList()") { - doc { "Returns a List containing all elements" } + doc { "Returns a [List] containing all elements." } returns("List") body { "return this.toArrayList()" } } templates add f("toLinkedList()") { - doc { "Returns a LinkedList containing all elements" } + doc { "Returns a [LinkedList] containing all elements." } returns("LinkedList") body { "return toCollection(LinkedList())" } } @@ -98,7 +98,7 @@ fun snapshots(): List { typeParam("K") doc { """ - Returns Map containing all the values from the given collection indexed by *selector* + Returns Map containing all the values from the given collection indexed by [selector]. """ } returns("Map") @@ -155,7 +155,7 @@ fun snapshots(): List { typeParam("V") doc { """ - Returns Map containing all the values provided by *transform* and indexed by *selector* from the given collection + Returns Map containing all the values provided by [transform] and indexed by [selector] from the given collection. """ } returns("Map") diff --git a/libraries/tools/kotlin-stdlib-gen/src/templates/SpecialJS.kt b/libraries/tools/kotlin-stdlib-gen/src/templates/SpecialJS.kt index bfbe158be1f..7caf0eae313 100644 --- a/libraries/tools/kotlin-stdlib-gen/src/templates/SpecialJS.kt +++ b/libraries/tools/kotlin-stdlib-gen/src/templates/SpecialJS.kt @@ -7,7 +7,7 @@ fun specialJS(): List { templates add f("asList()") { only(ArraysOfObjects, ArraysOfPrimitives) - doc { "Returns a list that wraps the original array" } + doc { "Returns a [List] that wraps the original array." } returns("List") body(ArraysOfObjects) { """ diff --git a/libraries/tools/kotlin-stdlib-gen/src/templates/SpecialJVM.kt b/libraries/tools/kotlin-stdlib-gen/src/templates/SpecialJVM.kt index 78ccbef2dc5..4af239daa08 100644 --- a/libraries/tools/kotlin-stdlib-gen/src/templates/SpecialJVM.kt +++ b/libraries/tools/kotlin-stdlib-gen/src/templates/SpecialJVM.kt @@ -7,7 +7,7 @@ fun specialJVM(): List { templates add f("copyOfRange(from: Int, to: Int)") { only(ArraysOfObjects, ArraysOfPrimitives) - doc { "Returns new array which is a copy of range of original array" } + doc { "Returns new array which is a copy of range of original array." } returns("SELF") returns(ArraysOfObjects) { "Array" } body { @@ -17,7 +17,7 @@ fun specialJVM(): List { templates add f("copyOf()") { only(ArraysOfObjects, ArraysOfPrimitives) - doc { "Returns new array which is a copy of the original array" } + doc { "Returns new array which is a copy of the original array." } returns("SELF") returns(ArraysOfObjects) { "Array" } body { @@ -31,7 +31,7 @@ fun specialJVM(): List { // This overload can cause nulls if array size is expanding, hence different return overload templates add f("copyOf(newSize: Int)") { only(ArraysOfObjects, ArraysOfPrimitives) - doc { "Returns new array which is a copy of the original array" } + doc { "Returns new array which is a copy of the original array." } returns("SELF") body { "return Arrays.copyOf(this, newSize)" @@ -44,7 +44,7 @@ fun specialJVM(): List { templates add f("fill(element: T)") { only(ArraysOfObjects, ArraysOfPrimitives) - doc { "Fills original array with the provided value" } + doc { "Fills original array with the provided value." } returns { "SELF" } returns(ArraysOfObjects) { "Array" } body { @@ -68,7 +68,7 @@ fun specialJVM(): List { templates add f("sort(fromIndex: Int = 0, toIndex: Int = size())") { only(ArraysOfObjects, ArraysOfPrimitives) exclude(PrimitiveType.Boolean) - doc { "Sorts array or range in array inplace" } + doc { "Sorts array or range in array inplace." } returns("Unit") body { "Arrays.sort(this, fromIndex, toIndex)" @@ -76,7 +76,7 @@ fun specialJVM(): List { } templates add f("filterIsInstanceTo(destination: C, klass: Class)") { - doc { "Appends all elements that are instances of specified class to the given *destination*" } + doc { "Appends all elements that are instances of specified class to the given [destination]." } receiverAsterisk(true) typeParam("C : MutableCollection") typeParam("R") @@ -91,7 +91,7 @@ fun specialJVM(): List { } templates add f("filterIsInstance(klass: Class)") { - doc { "Returns a list containing all elements that are instances of specified class" } + doc { "Returns a list containing all elements that are instances of specified class." } receiverAsterisk(true) typeParam("R") returns("List") @@ -102,7 +102,7 @@ fun specialJVM(): List { } exclude(ArraysOfPrimitives, Strings) - doc(Sequences) { "Returns a sequence containing all elements that are instances of specified class" } + doc(Sequences) { "Returns a sequence containing all elements that are instances of specified class." } returns(Sequences) { "Sequence" } body(Sequences) { """ @@ -112,7 +112,7 @@ fun specialJVM(): List { } templates add f("filterIsInstanceTo(destination: C)") { - doc { "Appends all elements that are instances of specified type parameter R to the given *destination*" } + doc { "Appends all elements that are instances of specified type parameter R to the given [destination]." } typeParam("reified R") typeParam("C : MutableCollection") inline(true) @@ -128,7 +128,7 @@ fun specialJVM(): List { } templates add f("filterIsInstance()") { - doc { "Returns a list containing all elements that are instances of specified type parameter R" } + doc { "Returns a list containing all elements that are instances of specified type parameter R." } typeParam("reified R") returns("List") inline(true) @@ -140,7 +140,7 @@ fun specialJVM(): List { } exclude(ArraysOfPrimitives, Strings) - doc(Sequences) { "Returns a sequence containing all elements that are instances of specified type parameter R" } + doc(Sequences) { "Returns a sequence containing all elements that are instances of specified type parameter R." } returns(Sequences) { "Sequence" } inline(true) receiverAsterisk(true) @@ -153,7 +153,7 @@ fun specialJVM(): List { templates add f("asList()") { only(ArraysOfObjects, ArraysOfPrimitives) - doc { "Returns a list that wraps the original array" } + doc { "Returns a [List] that wraps the original array." } returns("List") body(ArraysOfObjects) { """