diff --git a/libraries/stdlib/src/generated/_Arrays.kt b/libraries/stdlib/src/generated/_Arrays.kt index 647d6c8c24e..59dae607550 100644 --- a/libraries/stdlib/src/generated/_Arrays.kt +++ b/libraries/stdlib/src/generated/_Arrays.kt @@ -5485,7 +5485,9 @@ public fun Array.toShortArray(): ShortArray { /** * Returns a [Map] containing key-value pairs provided by [transform] function * applied to elements of the given array. + * * If any of two pairs would have the same key the last one gets added to the map. + * * The returned map preserves the entry iteration order of the original array. */ public inline fun Array.associate(transform: (T) -> Pair): Map { @@ -5497,7 +5499,9 @@ public inline fun Array.associate(transform: (T) -> Pair) /** * Returns a [Map] containing key-value pairs provided by [transform] function * applied to elements of the given array. + * * If any of two pairs would have the same key the last one gets added to the map. + * * The returned map preserves the entry iteration order of the original array. */ public inline fun ByteArray.associate(transform: (Byte) -> Pair): Map { @@ -5509,7 +5513,9 @@ public inline fun ByteArray.associate(transform: (Byte) -> Pair): M /** * Returns a [Map] containing key-value pairs provided by [transform] function * applied to elements of the given array. + * * If any of two pairs would have the same key the last one gets added to the map. + * * The returned map preserves the entry iteration order of the original array. */ public inline fun ShortArray.associate(transform: (Short) -> Pair): Map { @@ -5521,7 +5527,9 @@ public inline fun ShortArray.associate(transform: (Short) -> Pair): /** * Returns a [Map] containing key-value pairs provided by [transform] function * applied to elements of the given array. + * * If any of two pairs would have the same key the last one gets added to the map. + * * The returned map preserves the entry iteration order of the original array. */ public inline fun IntArray.associate(transform: (Int) -> Pair): Map { @@ -5533,7 +5541,9 @@ public inline fun IntArray.associate(transform: (Int) -> Pair): Map /** * Returns a [Map] containing key-value pairs provided by [transform] function * applied to elements of the given array. + * * If any of two pairs would have the same key the last one gets added to the map. + * * The returned map preserves the entry iteration order of the original array. */ public inline fun LongArray.associate(transform: (Long) -> Pair): Map { @@ -5545,7 +5555,9 @@ public inline fun LongArray.associate(transform: (Long) -> Pair): M /** * Returns a [Map] containing key-value pairs provided by [transform] function * applied to elements of the given array. + * * If any of two pairs would have the same key the last one gets added to the map. + * * The returned map preserves the entry iteration order of the original array. */ public inline fun FloatArray.associate(transform: (Float) -> Pair): Map { @@ -5557,7 +5569,9 @@ public inline fun FloatArray.associate(transform: (Float) -> Pair): /** * Returns a [Map] containing key-value pairs provided by [transform] function * applied to elements of the given array. + * * If any of two pairs would have the same key the last one gets added to the map. + * * The returned map preserves the entry iteration order of the original array. */ public inline fun DoubleArray.associate(transform: (Double) -> Pair): Map { @@ -5569,7 +5583,9 @@ public inline fun DoubleArray.associate(transform: (Double) -> Pair /** * Returns a [Map] containing key-value pairs provided by [transform] function * applied to elements of the given array. + * * If any of two pairs would have the same key the last one gets added to the map. + * * The returned map preserves the entry iteration order of the original array. */ public inline fun BooleanArray.associate(transform: (Boolean) -> Pair): Map { @@ -5581,7 +5597,9 @@ public inline fun BooleanArray.associate(transform: (Boolean) -> Pair CharArray.associate(transform: (Char) -> Pair): Map { @@ -5593,7 +5611,9 @@ public inline fun CharArray.associate(transform: (Char) -> Pair): M /** * Returns a [Map] containing the elements from the given array indexed by the key * returned from [keySelector] function applied to each element. + * * If any two elements would have the same key returned by [keySelector] the last one gets added to the map. + * * The returned map preserves the entry iteration order of the original array. */ public inline fun Array.associateBy(keySelector: (T) -> K): Map { @@ -5605,7 +5625,9 @@ public inline fun Array.associateBy(keySelector: (T) -> K): Map ByteArray.associateBy(keySelector: (Byte) -> K): Map { @@ -5617,7 +5639,9 @@ public inline fun ByteArray.associateBy(keySelector: (Byte) -> K): Map ShortArray.associateBy(keySelector: (Short) -> K): Map { @@ -5629,7 +5653,9 @@ public inline fun ShortArray.associateBy(keySelector: (Short) -> K): Map IntArray.associateBy(keySelector: (Int) -> K): Map { @@ -5641,7 +5667,9 @@ public inline fun IntArray.associateBy(keySelector: (Int) -> K): Map /** * Returns a [Map] containing the elements from the given array indexed by the key * returned from [keySelector] function applied to each element. + * * If any two elements would have the same key returned by [keySelector] the last one gets added to the map. + * * The returned map preserves the entry iteration order of the original array. */ public inline fun LongArray.associateBy(keySelector: (Long) -> K): Map { @@ -5653,7 +5681,9 @@ public inline fun LongArray.associateBy(keySelector: (Long) -> K): Map FloatArray.associateBy(keySelector: (Float) -> K): Map { @@ -5665,7 +5695,9 @@ public inline fun FloatArray.associateBy(keySelector: (Float) -> K): Map DoubleArray.associateBy(keySelector: (Double) -> K): Map { @@ -5677,7 +5709,9 @@ public inline fun DoubleArray.associateBy(keySelector: (Double) -> K): Map BooleanArray.associateBy(keySelector: (Boolean) -> K): Map { @@ -5689,7 +5723,9 @@ public inline fun BooleanArray.associateBy(keySelector: (Boolean) -> K): Map /** * Returns a [Map] containing the elements from the given array indexed by the key * returned from [keySelector] function applied to each element. + * * If any two elements would have the same key returned by [keySelector] the last one gets added to the map. + * * The returned map preserves the entry iteration order of the original array. */ public inline fun CharArray.associateBy(keySelector: (Char) -> K): Map { @@ -5700,7 +5736,9 @@ public inline fun CharArray.associateBy(keySelector: (Char) -> K): Map Array.associateBy(keySelector: (T) -> K, valueTransform: (T) -> V): Map { @@ -5711,7 +5749,9 @@ public inline fun Array.associateBy(keySelector: (T) -> K, valu /** * Returns a [Map] containing the values provided by [valueTransform] and indexed by [keySelector] functions applied to elements of the given array. + * * If any two elements would have the same key returned by [keySelector] the last one gets added to the map. + * * The returned map preserves the entry iteration order of the original array. */ public inline fun ByteArray.associateBy(keySelector: (Byte) -> K, valueTransform: (Byte) -> V): Map { @@ -5722,7 +5762,9 @@ public inline fun ByteArray.associateBy(keySelector: (Byte) -> K, valueTr /** * Returns a [Map] containing the values provided by [valueTransform] and indexed by [keySelector] functions applied to elements of the given array. + * * If any two elements would have the same key returned by [keySelector] the last one gets added to the map. + * * The returned map preserves the entry iteration order of the original array. */ public inline fun ShortArray.associateBy(keySelector: (Short) -> K, valueTransform: (Short) -> V): Map { @@ -5733,7 +5775,9 @@ public inline fun ShortArray.associateBy(keySelector: (Short) -> K, value /** * Returns a [Map] containing the values provided by [valueTransform] and indexed by [keySelector] functions applied to elements of the given array. + * * If any two elements would have the same key returned by [keySelector] the last one gets added to the map. + * * The returned map preserves the entry iteration order of the original array. */ public inline fun IntArray.associateBy(keySelector: (Int) -> K, valueTransform: (Int) -> V): Map { @@ -5744,7 +5788,9 @@ public inline fun IntArray.associateBy(keySelector: (Int) -> K, valueTran /** * Returns a [Map] containing the values provided by [valueTransform] and indexed by [keySelector] functions applied to elements of the given array. + * * If any two elements would have the same key returned by [keySelector] the last one gets added to the map. + * * The returned map preserves the entry iteration order of the original array. */ public inline fun LongArray.associateBy(keySelector: (Long) -> K, valueTransform: (Long) -> V): Map { @@ -5755,7 +5801,9 @@ public inline fun LongArray.associateBy(keySelector: (Long) -> K, valueTr /** * Returns a [Map] containing the values provided by [valueTransform] and indexed by [keySelector] functions applied to elements of the given array. + * * If any two elements would have the same key returned by [keySelector] the last one gets added to the map. + * * The returned map preserves the entry iteration order of the original array. */ public inline fun FloatArray.associateBy(keySelector: (Float) -> K, valueTransform: (Float) -> V): Map { @@ -5766,7 +5814,9 @@ public inline fun FloatArray.associateBy(keySelector: (Float) -> K, value /** * Returns a [Map] containing the values provided by [valueTransform] and indexed by [keySelector] functions applied to elements of the given array. + * * If any two elements would have the same key returned by [keySelector] the last one gets added to the map. + * * The returned map preserves the entry iteration order of the original array. */ public inline fun DoubleArray.associateBy(keySelector: (Double) -> K, valueTransform: (Double) -> V): Map { @@ -5777,7 +5827,9 @@ public inline fun DoubleArray.associateBy(keySelector: (Double) -> K, val /** * Returns a [Map] containing the values provided by [valueTransform] and indexed by [keySelector] functions applied to elements of the given array. + * * If any two elements would have the same key returned by [keySelector] the last one gets added to the map. + * * The returned map preserves the entry iteration order of the original array. */ public inline fun BooleanArray.associateBy(keySelector: (Boolean) -> K, valueTransform: (Boolean) -> V): Map { @@ -5788,7 +5840,9 @@ public inline fun BooleanArray.associateBy(keySelector: (Boolean) -> K, v /** * Returns a [Map] containing the values provided by [valueTransform] and indexed by [keySelector] functions applied to elements of the given array. + * * If any two elements would have the same key returned by [keySelector] the last one gets added to the map. + * * The returned map preserves the entry iteration order of the original array. */ public inline fun CharArray.associateBy(keySelector: (Char) -> K, valueTransform: (Char) -> V): Map { @@ -5801,6 +5855,7 @@ public inline fun CharArray.associateBy(keySelector: (Char) -> K, valueTr * Populates and returns the [destination] mutable map with key-value pairs, * where key is provided by the [keySelector] function applied to each element of the given array * and value is the element itself. + * * If any two elements would have the same key returned by [keySelector] the last one gets added to the map. */ public inline fun > Array.associateByTo(destination: M, keySelector: (T) -> K): M { @@ -5814,6 +5869,7 @@ public inline fun > Array.associateByTo( * Populates and returns the [destination] mutable map with key-value pairs, * where key is provided by the [keySelector] function applied to each element of the given array * and value is the element itself. + * * If any two elements would have the same key returned by [keySelector] the last one gets added to the map. */ public inline fun > ByteArray.associateByTo(destination: M, keySelector: (Byte) -> K): M { @@ -5827,6 +5883,7 @@ public inline fun > ByteArray.associateByTo(des * Populates and returns the [destination] mutable map with key-value pairs, * where key is provided by the [keySelector] function applied to each element of the given array * and value is the element itself. + * * If any two elements would have the same key returned by [keySelector] the last one gets added to the map. */ public inline fun > ShortArray.associateByTo(destination: M, keySelector: (Short) -> K): M { @@ -5840,6 +5897,7 @@ public inline fun > ShortArray.associateByTo(d * Populates and returns the [destination] mutable map with key-value pairs, * where key is provided by the [keySelector] function applied to each element of the given array * and value is the element itself. + * * If any two elements would have the same key returned by [keySelector] the last one gets added to the map. */ public inline fun > IntArray.associateByTo(destination: M, keySelector: (Int) -> K): M { @@ -5853,6 +5911,7 @@ public inline fun > IntArray.associateByTo(desti * Populates and returns the [destination] mutable map with key-value pairs, * where key is provided by the [keySelector] function applied to each element of the given array * and value is the element itself. + * * If any two elements would have the same key returned by [keySelector] the last one gets added to the map. */ public inline fun > LongArray.associateByTo(destination: M, keySelector: (Long) -> K): M { @@ -5866,6 +5925,7 @@ public inline fun > LongArray.associateByTo(des * Populates and returns the [destination] mutable map with key-value pairs, * where key is provided by the [keySelector] function applied to each element of the given array * and value is the element itself. + * * If any two elements would have the same key returned by [keySelector] the last one gets added to the map. */ public inline fun > FloatArray.associateByTo(destination: M, keySelector: (Float) -> K): M { @@ -5879,6 +5939,7 @@ public inline fun > FloatArray.associateByTo(d * Populates and returns the [destination] mutable map with key-value pairs, * where key is provided by the [keySelector] function applied to each element of the given array * and value is the element itself. + * * If any two elements would have the same key returned by [keySelector] the last one gets added to the map. */ public inline fun > DoubleArray.associateByTo(destination: M, keySelector: (Double) -> K): M { @@ -5892,6 +5953,7 @@ public inline fun > DoubleArray.associateByTo * Populates and returns the [destination] mutable map with key-value pairs, * where key is provided by the [keySelector] function applied to each element of the given array * and value is the element itself. + * * If any two elements would have the same key returned by [keySelector] the last one gets added to the map. */ public inline fun > BooleanArray.associateByTo(destination: M, keySelector: (Boolean) -> K): M { @@ -5905,6 +5967,7 @@ public inline fun > BooleanArray.associateBy * Populates and returns the [destination] mutable map with key-value pairs, * where key is provided by the [keySelector] function applied to each element of the given array * and value is the element itself. + * * If any two elements would have the same key returned by [keySelector] the last one gets added to the map. */ public inline fun > CharArray.associateByTo(destination: M, keySelector: (Char) -> K): M { @@ -5918,6 +5981,7 @@ public inline fun > CharArray.associateByTo(des * Populates and returns the [destination] mutable map with key-value pairs, * where key is provided by the [keySelector] function and * and value is provided by the [valueTransform] function applied to elements of the given array. + * * If any two elements would have the same key returned by [keySelector] the last one gets added to the map. */ public inline fun > Array.associateByTo(destination: M, keySelector: (T) -> K, valueTransform: (T) -> V): M { @@ -5931,6 +5995,7 @@ public inline fun > Array.associateBy * Populates and returns the [destination] mutable map with key-value pairs, * where key is provided by the [keySelector] function and * and value is provided by the [valueTransform] function applied to elements of the given array. + * * If any two elements would have the same key returned by [keySelector] the last one gets added to the map. */ public inline fun > ByteArray.associateByTo(destination: M, keySelector: (Byte) -> K, valueTransform: (Byte) -> V): M { @@ -5944,6 +6009,7 @@ public inline fun > ByteArray.associateByTo(des * Populates and returns the [destination] mutable map with key-value pairs, * where key is provided by the [keySelector] function and * and value is provided by the [valueTransform] function applied to elements of the given array. + * * If any two elements would have the same key returned by [keySelector] the last one gets added to the map. */ public inline fun > ShortArray.associateByTo(destination: M, keySelector: (Short) -> K, valueTransform: (Short) -> V): M { @@ -5957,6 +6023,7 @@ public inline fun > ShortArray.associateByTo(de * Populates and returns the [destination] mutable map with key-value pairs, * where key is provided by the [keySelector] function and * and value is provided by the [valueTransform] function applied to elements of the given array. + * * If any two elements would have the same key returned by [keySelector] the last one gets added to the map. */ public inline fun > IntArray.associateByTo(destination: M, keySelector: (Int) -> K, valueTransform: (Int) -> V): M { @@ -5970,6 +6037,7 @@ public inline fun > IntArray.associateByTo(dest * Populates and returns the [destination] mutable map with key-value pairs, * where key is provided by the [keySelector] function and * and value is provided by the [valueTransform] function applied to elements of the given array. + * * If any two elements would have the same key returned by [keySelector] the last one gets added to the map. */ public inline fun > LongArray.associateByTo(destination: M, keySelector: (Long) -> K, valueTransform: (Long) -> V): M { @@ -5983,6 +6051,7 @@ public inline fun > LongArray.associateByTo(des * Populates and returns the [destination] mutable map with key-value pairs, * where key is provided by the [keySelector] function and * and value is provided by the [valueTransform] function applied to elements of the given array. + * * If any two elements would have the same key returned by [keySelector] the last one gets added to the map. */ public inline fun > FloatArray.associateByTo(destination: M, keySelector: (Float) -> K, valueTransform: (Float) -> V): M { @@ -5996,6 +6065,7 @@ public inline fun > FloatArray.associateByTo(de * Populates and returns the [destination] mutable map with key-value pairs, * where key is provided by the [keySelector] function and * and value is provided by the [valueTransform] function applied to elements of the given array. + * * If any two elements would have the same key returned by [keySelector] the last one gets added to the map. */ public inline fun > DoubleArray.associateByTo(destination: M, keySelector: (Double) -> K, valueTransform: (Double) -> V): M { @@ -6009,6 +6079,7 @@ public inline fun > DoubleArray.associateByTo(d * Populates and returns the [destination] mutable map with key-value pairs, * where key is provided by the [keySelector] function and * and value is provided by the [valueTransform] function applied to elements of the given array. + * * If any two elements would have the same key returned by [keySelector] the last one gets added to the map. */ public inline fun > BooleanArray.associateByTo(destination: M, keySelector: (Boolean) -> K, valueTransform: (Boolean) -> V): M { @@ -6022,6 +6093,7 @@ public inline fun > BooleanArray.associateByTo( * Populates and returns the [destination] mutable map with key-value pairs, * where key is provided by the [keySelector] function and * and value is provided by the [valueTransform] function applied to elements of the given array. + * * If any two elements would have the same key returned by [keySelector] the last one gets added to the map. */ public inline fun > CharArray.associateByTo(destination: M, keySelector: (Char) -> K, valueTransform: (Char) -> V): M { @@ -6034,6 +6106,7 @@ public inline fun > CharArray.associateByTo(des /** * Populates and returns the [destination] mutable map with key-value pairs * provided by [transform] function applied to each element of the given array. + * * If any of two pairs would have the same key the last one gets added to the map. */ public inline fun > Array.associateTo(destination: M, transform: (T) -> Pair): M { @@ -6046,6 +6119,7 @@ public inline fun > Array.associateTo /** * Populates and returns the [destination] mutable map with key-value pairs * provided by [transform] function applied to each element of the given array. + * * If any of two pairs would have the same key the last one gets added to the map. */ public inline fun > ByteArray.associateTo(destination: M, transform: (Byte) -> Pair): M { @@ -6058,6 +6132,7 @@ public inline fun > ByteArray.associateTo(desti /** * Populates and returns the [destination] mutable map with key-value pairs * provided by [transform] function applied to each element of the given array. + * * If any of two pairs would have the same key the last one gets added to the map. */ public inline fun > ShortArray.associateTo(destination: M, transform: (Short) -> Pair): M { @@ -6070,6 +6145,7 @@ public inline fun > ShortArray.associateTo(dest /** * Populates and returns the [destination] mutable map with key-value pairs * provided by [transform] function applied to each element of the given array. + * * If any of two pairs would have the same key the last one gets added to the map. */ public inline fun > IntArray.associateTo(destination: M, transform: (Int) -> Pair): M { @@ -6082,6 +6158,7 @@ public inline fun > IntArray.associateTo(destin /** * Populates and returns the [destination] mutable map with key-value pairs * provided by [transform] function applied to each element of the given array. + * * If any of two pairs would have the same key the last one gets added to the map. */ public inline fun > LongArray.associateTo(destination: M, transform: (Long) -> Pair): M { @@ -6094,6 +6171,7 @@ public inline fun > LongArray.associateTo(desti /** * Populates and returns the [destination] mutable map with key-value pairs * provided by [transform] function applied to each element of the given array. + * * If any of two pairs would have the same key the last one gets added to the map. */ public inline fun > FloatArray.associateTo(destination: M, transform: (Float) -> Pair): M { @@ -6106,6 +6184,7 @@ public inline fun > FloatArray.associateTo(dest /** * Populates and returns the [destination] mutable map with key-value pairs * provided by [transform] function applied to each element of the given array. + * * If any of two pairs would have the same key the last one gets added to the map. */ public inline fun > DoubleArray.associateTo(destination: M, transform: (Double) -> Pair): M { @@ -6118,6 +6197,7 @@ public inline fun > DoubleArray.associateTo(des /** * Populates and returns the [destination] mutable map with key-value pairs * provided by [transform] function applied to each element of the given array. + * * If any of two pairs would have the same key the last one gets added to the map. */ public inline fun > BooleanArray.associateTo(destination: M, transform: (Boolean) -> Pair): M { @@ -6130,6 +6210,7 @@ public inline fun > BooleanArray.associateTo(de /** * Populates and returns the [destination] mutable map with key-value pairs * provided by [transform] function applied to each element of the given array. + * * If any of two pairs would have the same key the last one gets added to the map. */ public inline fun > CharArray.associateTo(destination: M, transform: (Char) -> Pair): M { @@ -6472,6 +6553,7 @@ public fun CharArray.toMutableList(): MutableList { /** * Returns a [Set] of all elements. + * * The returned set preserves the element iteration order of the original array. */ public fun Array.toSet(): Set { @@ -6484,6 +6566,7 @@ public fun Array.toSet(): Set { /** * Returns a [Set] of all elements. + * * The returned set preserves the element iteration order of the original array. */ public fun ByteArray.toSet(): Set { @@ -6496,6 +6579,7 @@ public fun ByteArray.toSet(): Set { /** * Returns a [Set] of all elements. + * * The returned set preserves the element iteration order of the original array. */ public fun ShortArray.toSet(): Set { @@ -6508,6 +6592,7 @@ public fun ShortArray.toSet(): Set { /** * Returns a [Set] of all elements. + * * The returned set preserves the element iteration order of the original array. */ public fun IntArray.toSet(): Set { @@ -6520,6 +6605,7 @@ public fun IntArray.toSet(): Set { /** * Returns a [Set] of all elements. + * * The returned set preserves the element iteration order of the original array. */ public fun LongArray.toSet(): Set { @@ -6532,6 +6618,7 @@ public fun LongArray.toSet(): Set { /** * Returns a [Set] of all elements. + * * The returned set preserves the element iteration order of the original array. */ public fun FloatArray.toSet(): Set { @@ -6544,6 +6631,7 @@ public fun FloatArray.toSet(): Set { /** * Returns a [Set] of all elements. + * * The returned set preserves the element iteration order of the original array. */ public fun DoubleArray.toSet(): Set { @@ -6556,6 +6644,7 @@ public fun DoubleArray.toSet(): Set { /** * Returns a [Set] of all elements. + * * The returned set preserves the element iteration order of the original array. */ public fun BooleanArray.toSet(): Set { @@ -6568,6 +6657,7 @@ public fun BooleanArray.toSet(): Set { /** * Returns a [Set] of all elements. + * * The returned set preserves the element iteration order of the original array. */ public fun CharArray.toSet(): Set { @@ -6652,6 +6742,7 @@ public fun CharArray.toSortedSet(): SortedSet { /** * Returns a [SortedSet] of all elements. + * * Elements in the set returned are sorted according to the given [comparator]. */ @kotlin.jvm.JvmVersion @@ -6824,7 +6915,9 @@ public inline fun > CharArray.flatMapTo(destinati /** * Groups elements of the original array by the key returned by the given [keySelector] function * applied to each element and returns a map where each group key is associated with a list of corresponding elements. + * * The returned map preserves the entry iteration order of the keys produced from the original array. + * * @sample test.collections.CollectionTest.groupBy */ public inline fun Array.groupBy(keySelector: (T) -> K): Map> { @@ -6834,7 +6927,9 @@ public inline fun Array.groupBy(keySelector: (T) -> K): Map ByteArray.groupBy(keySelector: (Byte) -> K): Map> { @@ -6844,7 +6939,9 @@ public inline fun ByteArray.groupBy(keySelector: (Byte) -> K): Map ShortArray.groupBy(keySelector: (Short) -> K): Map> { @@ -6854,7 +6951,9 @@ public inline fun ShortArray.groupBy(keySelector: (Short) -> K): Map IntArray.groupBy(keySelector: (Int) -> K): Map> { @@ -6864,7 +6963,9 @@ public inline fun IntArray.groupBy(keySelector: (Int) -> K): Map LongArray.groupBy(keySelector: (Long) -> K): Map> { @@ -6874,7 +6975,9 @@ public inline fun LongArray.groupBy(keySelector: (Long) -> K): Map FloatArray.groupBy(keySelector: (Float) -> K): Map> { @@ -6884,7 +6987,9 @@ public inline fun FloatArray.groupBy(keySelector: (Float) -> K): Map DoubleArray.groupBy(keySelector: (Double) -> K): Map> { @@ -6894,7 +6999,9 @@ public inline fun DoubleArray.groupBy(keySelector: (Double) -> K): Map BooleanArray.groupBy(keySelector: (Boolean) -> K): Map> { @@ -6904,7 +7011,9 @@ public inline fun BooleanArray.groupBy(keySelector: (Boolean) -> K): Map CharArray.groupBy(keySelector: (Char) -> K): Map> { @@ -6915,7 +7024,9 @@ public inline fun CharArray.groupBy(keySelector: (Char) -> K): Map Array.groupBy(keySelector: (T) -> K, valueTransform: (T) -> V): Map> { @@ -6926,7 +7037,9 @@ public inline fun Array.groupBy(keySelector: (T) -> K, valueTra * Groups values returned by the [valueTransform] function applied to each element of the original array * by the key returned by the given [keySelector] function applied to the element * and returns a map where each group key is associated with a list of corresponding values. + * * The returned map preserves the entry iteration order of the keys produced from the original array. + * * @sample test.collections.CollectionTest.groupByKeysAndValues */ public inline fun ByteArray.groupBy(keySelector: (Byte) -> K, valueTransform: (Byte) -> V): Map> { @@ -6937,7 +7050,9 @@ public inline fun ByteArray.groupBy(keySelector: (Byte) -> K, valueTransf * Groups values returned by the [valueTransform] function applied to each element of the original array * by the key returned by the given [keySelector] function applied to the element * and returns a map where each group key is associated with a list of corresponding values. + * * The returned map preserves the entry iteration order of the keys produced from the original array. + * * @sample test.collections.CollectionTest.groupByKeysAndValues */ public inline fun ShortArray.groupBy(keySelector: (Short) -> K, valueTransform: (Short) -> V): Map> { @@ -6948,7 +7063,9 @@ public inline fun ShortArray.groupBy(keySelector: (Short) -> K, valueTran * Groups values returned by the [valueTransform] function applied to each element of the original array * by the key returned by the given [keySelector] function applied to the element * and returns a map where each group key is associated with a list of corresponding values. + * * The returned map preserves the entry iteration order of the keys produced from the original array. + * * @sample test.collections.CollectionTest.groupByKeysAndValues */ public inline fun IntArray.groupBy(keySelector: (Int) -> K, valueTransform: (Int) -> V): Map> { @@ -6959,7 +7076,9 @@ public inline fun IntArray.groupBy(keySelector: (Int) -> K, valueTransfor * Groups values returned by the [valueTransform] function applied to each element of the original array * by the key returned by the given [keySelector] function applied to the element * and returns a map where each group key is associated with a list of corresponding values. + * * The returned map preserves the entry iteration order of the keys produced from the original array. + * * @sample test.collections.CollectionTest.groupByKeysAndValues */ public inline fun LongArray.groupBy(keySelector: (Long) -> K, valueTransform: (Long) -> V): Map> { @@ -6970,7 +7089,9 @@ public inline fun LongArray.groupBy(keySelector: (Long) -> K, valueTransf * Groups values returned by the [valueTransform] function applied to each element of the original array * by the key returned by the given [keySelector] function applied to the element * and returns a map where each group key is associated with a list of corresponding values. + * * The returned map preserves the entry iteration order of the keys produced from the original array. + * * @sample test.collections.CollectionTest.groupByKeysAndValues */ public inline fun FloatArray.groupBy(keySelector: (Float) -> K, valueTransform: (Float) -> V): Map> { @@ -6981,7 +7102,9 @@ public inline fun FloatArray.groupBy(keySelector: (Float) -> K, valueTran * Groups values returned by the [valueTransform] function applied to each element of the original array * by the key returned by the given [keySelector] function applied to the element * and returns a map where each group key is associated with a list of corresponding values. + * * The returned map preserves the entry iteration order of the keys produced from the original array. + * * @sample test.collections.CollectionTest.groupByKeysAndValues */ public inline fun DoubleArray.groupBy(keySelector: (Double) -> K, valueTransform: (Double) -> V): Map> { @@ -6992,7 +7115,9 @@ public inline fun DoubleArray.groupBy(keySelector: (Double) -> K, valueTr * Groups values returned by the [valueTransform] function applied to each element of the original array * by the key returned by the given [keySelector] function applied to the element * and returns a map where each group key is associated with a list of corresponding values. + * * The returned map preserves the entry iteration order of the keys produced from the original array. + * * @sample test.collections.CollectionTest.groupByKeysAndValues */ public inline fun BooleanArray.groupBy(keySelector: (Boolean) -> K, valueTransform: (Boolean) -> V): Map> { @@ -7003,7 +7128,9 @@ public inline fun BooleanArray.groupBy(keySelector: (Boolean) -> K, value * Groups values returned by the [valueTransform] function applied to each element of the original array * by the key returned by the given [keySelector] function applied to the element * and returns a map where each group key is associated with a list of corresponding values. + * * The returned map preserves the entry iteration order of the keys produced from the original array. + * * @sample test.collections.CollectionTest.groupByKeysAndValues */ public inline fun CharArray.groupBy(keySelector: (Char) -> K, valueTransform: (Char) -> V): Map> { @@ -7013,7 +7140,9 @@ public inline fun CharArray.groupBy(keySelector: (Char) -> K, valueTransf /** * Groups elements of the original array by the key returned by the given [keySelector] function * applied to each element and puts to the [destination] map each group key associated with a list of corresponding elements. + * * @return The [destination] map. + * * @sample test.collections.CollectionTest.groupBy */ public inline fun >> Array.groupByTo(destination: M, keySelector: (T) -> K): M { @@ -7028,7 +7157,9 @@ public inline fun >> Array.grou /** * Groups elements of the original array by the key returned by the given [keySelector] function * applied to each element and puts to the [destination] map each group key associated with a list of corresponding elements. + * * @return The [destination] map. + * * @sample test.collections.CollectionTest.groupBy */ public inline fun >> ByteArray.groupByTo(destination: M, keySelector: (Byte) -> K): M { @@ -7043,7 +7174,9 @@ public inline fun >> ByteArray.groupBy /** * Groups elements of the original array by the key returned by the given [keySelector] function * applied to each element and puts to the [destination] map each group key associated with a list of corresponding elements. + * * @return The [destination] map. + * * @sample test.collections.CollectionTest.groupBy */ public inline fun >> ShortArray.groupByTo(destination: M, keySelector: (Short) -> K): M { @@ -7058,7 +7191,9 @@ public inline fun >> ShortArray.group /** * Groups elements of the original array by the key returned by the given [keySelector] function * applied to each element and puts to the [destination] map each group key associated with a list of corresponding elements. + * * @return The [destination] map. + * * @sample test.collections.CollectionTest.groupBy */ public inline fun >> IntArray.groupByTo(destination: M, keySelector: (Int) -> K): M { @@ -7073,7 +7208,9 @@ public inline fun >> IntArray.groupByTo /** * Groups elements of the original array by the key returned by the given [keySelector] function * applied to each element and puts to the [destination] map each group key associated with a list of corresponding elements. + * * @return The [destination] map. + * * @sample test.collections.CollectionTest.groupBy */ public inline fun >> LongArray.groupByTo(destination: M, keySelector: (Long) -> K): M { @@ -7088,7 +7225,9 @@ public inline fun >> LongArray.groupBy /** * Groups elements of the original array by the key returned by the given [keySelector] function * applied to each element and puts to the [destination] map each group key associated with a list of corresponding elements. + * * @return The [destination] map. + * * @sample test.collections.CollectionTest.groupBy */ public inline fun >> FloatArray.groupByTo(destination: M, keySelector: (Float) -> K): M { @@ -7103,7 +7242,9 @@ public inline fun >> FloatArray.group /** * Groups elements of the original array by the key returned by the given [keySelector] function * applied to each element and puts to the [destination] map each group key associated with a list of corresponding elements. + * * @return The [destination] map. + * * @sample test.collections.CollectionTest.groupBy */ public inline fun >> DoubleArray.groupByTo(destination: M, keySelector: (Double) -> K): M { @@ -7118,7 +7259,9 @@ public inline fun >> DoubleArray.gro /** * Groups elements of the original array by the key returned by the given [keySelector] function * applied to each element and puts to the [destination] map each group key associated with a list of corresponding elements. + * * @return The [destination] map. + * * @sample test.collections.CollectionTest.groupBy */ public inline fun >> BooleanArray.groupByTo(destination: M, keySelector: (Boolean) -> K): M { @@ -7133,7 +7276,9 @@ public inline fun >> BooleanArray.g /** * Groups elements of the original array by the key returned by the given [keySelector] function * applied to each element and puts to the [destination] map each group key associated with a list of corresponding elements. + * * @return The [destination] map. + * * @sample test.collections.CollectionTest.groupBy */ public inline fun >> CharArray.groupByTo(destination: M, keySelector: (Char) -> K): M { @@ -7149,7 +7294,9 @@ public inline fun >> CharArray.groupBy * Groups values returned by the [valueTransform] function applied to each element of the original array * by the key returned by the given [keySelector] function applied to the element * and puts to the [destination] map each group key associated with a list of corresponding values. + * * @return The [destination] map. + * * @sample test.collections.CollectionTest.groupByKeysAndValues */ public inline fun >> Array.groupByTo(destination: M, keySelector: (T) -> K, valueTransform: (T) -> V): M { @@ -7165,7 +7312,9 @@ public inline fun >> Array.g * Groups values returned by the [valueTransform] function applied to each element of the original array * by the key returned by the given [keySelector] function applied to the element * and puts to the [destination] map each group key associated with a list of corresponding values. + * * @return The [destination] map. + * * @sample test.collections.CollectionTest.groupByKeysAndValues */ public inline fun >> ByteArray.groupByTo(destination: M, keySelector: (Byte) -> K, valueTransform: (Byte) -> V): M { @@ -7181,7 +7330,9 @@ public inline fun >> ByteArray.groupBy * Groups values returned by the [valueTransform] function applied to each element of the original array * by the key returned by the given [keySelector] function applied to the element * and puts to the [destination] map each group key associated with a list of corresponding values. + * * @return The [destination] map. + * * @sample test.collections.CollectionTest.groupByKeysAndValues */ public inline fun >> ShortArray.groupByTo(destination: M, keySelector: (Short) -> K, valueTransform: (Short) -> V): M { @@ -7197,7 +7348,9 @@ public inline fun >> ShortArray.groupB * Groups values returned by the [valueTransform] function applied to each element of the original array * by the key returned by the given [keySelector] function applied to the element * and puts to the [destination] map each group key associated with a list of corresponding values. + * * @return The [destination] map. + * * @sample test.collections.CollectionTest.groupByKeysAndValues */ public inline fun >> IntArray.groupByTo(destination: M, keySelector: (Int) -> K, valueTransform: (Int) -> V): M { @@ -7213,7 +7366,9 @@ public inline fun >> IntArray.groupByT * Groups values returned by the [valueTransform] function applied to each element of the original array * by the key returned by the given [keySelector] function applied to the element * and puts to the [destination] map each group key associated with a list of corresponding values. + * * @return The [destination] map. + * * @sample test.collections.CollectionTest.groupByKeysAndValues */ public inline fun >> LongArray.groupByTo(destination: M, keySelector: (Long) -> K, valueTransform: (Long) -> V): M { @@ -7229,7 +7384,9 @@ public inline fun >> LongArray.groupBy * Groups values returned by the [valueTransform] function applied to each element of the original array * by the key returned by the given [keySelector] function applied to the element * and puts to the [destination] map each group key associated with a list of corresponding values. + * * @return The [destination] map. + * * @sample test.collections.CollectionTest.groupByKeysAndValues */ public inline fun >> FloatArray.groupByTo(destination: M, keySelector: (Float) -> K, valueTransform: (Float) -> V): M { @@ -7245,7 +7402,9 @@ public inline fun >> FloatArray.groupB * Groups values returned by the [valueTransform] function applied to each element of the original array * by the key returned by the given [keySelector] function applied to the element * and puts to the [destination] map each group key associated with a list of corresponding values. + * * @return The [destination] map. + * * @sample test.collections.CollectionTest.groupByKeysAndValues */ public inline fun >> DoubleArray.groupByTo(destination: M, keySelector: (Double) -> K, valueTransform: (Double) -> V): M { @@ -7261,7 +7420,9 @@ public inline fun >> DoubleArray.group * Groups values returned by the [valueTransform] function applied to each element of the original array * by the key returned by the given [keySelector] function applied to the element * and puts to the [destination] map each group key associated with a list of corresponding values. + * * @return The [destination] map. + * * @sample test.collections.CollectionTest.groupByKeysAndValues */ public inline fun >> BooleanArray.groupByTo(destination: M, keySelector: (Boolean) -> K, valueTransform: (Boolean) -> V): M { @@ -7277,7 +7438,9 @@ public inline fun >> BooleanArray.grou * Groups values returned by the [valueTransform] function applied to each element of the original array * by the key returned by the given [keySelector] function applied to the element * and puts to the [destination] map each group key associated with a list of corresponding values. + * * @return The [destination] map. + * * @sample test.collections.CollectionTest.groupByKeysAndValues */ public inline fun >> CharArray.groupByTo(destination: M, keySelector: (Char) -> K, valueTransform: (Char) -> V): M { @@ -7761,6 +7924,7 @@ public fun CharArray.withIndex(): Iterable> { /** * Returns a list containing only distinct elements from the given array. + * * The elements in the resulting list are in the same order as they were in the source array. */ public fun Array.distinct(): List { @@ -7769,6 +7933,7 @@ public fun Array.distinct(): List { /** * Returns a list containing only distinct elements from the given array. + * * The elements in the resulting list are in the same order as they were in the source array. */ public fun ByteArray.distinct(): List { @@ -7777,6 +7942,7 @@ public fun ByteArray.distinct(): List { /** * Returns a list containing only distinct elements from the given array. + * * The elements in the resulting list are in the same order as they were in the source array. */ public fun ShortArray.distinct(): List { @@ -7785,6 +7951,7 @@ public fun ShortArray.distinct(): List { /** * Returns a list containing only distinct elements from the given array. + * * The elements in the resulting list are in the same order as they were in the source array. */ public fun IntArray.distinct(): List { @@ -7793,6 +7960,7 @@ public fun IntArray.distinct(): List { /** * Returns a list containing only distinct elements from the given array. + * * The elements in the resulting list are in the same order as they were in the source array. */ public fun LongArray.distinct(): List { @@ -7801,6 +7969,7 @@ public fun LongArray.distinct(): List { /** * Returns a list containing only distinct elements from the given array. + * * The elements in the resulting list are in the same order as they were in the source array. */ public fun FloatArray.distinct(): List { @@ -7809,6 +7978,7 @@ public fun FloatArray.distinct(): List { /** * Returns a list containing only distinct elements from the given array. + * * The elements in the resulting list are in the same order as they were in the source array. */ public fun DoubleArray.distinct(): List { @@ -7817,6 +7987,7 @@ public fun DoubleArray.distinct(): List { /** * Returns a list containing only distinct elements from the given array. + * * The elements in the resulting list are in the same order as they were in the source array. */ public fun BooleanArray.distinct(): List { @@ -7825,6 +7996,7 @@ public fun BooleanArray.distinct(): List { /** * Returns a list containing only distinct elements from the given array. + * * The elements in the resulting list are in the same order as they were in the source array. */ public fun CharArray.distinct(): List { @@ -7834,6 +8006,7 @@ public fun CharArray.distinct(): List { /** * Returns a list containing only elements from the given array * having distinct keys returned by the given [selector] function. + * * The elements in the resulting list are in the same order as they were in the source array. */ public inline fun Array.distinctBy(selector: (T) -> K): List { @@ -7850,6 +8023,7 @@ public inline fun Array.distinctBy(selector: (T) -> K): List { /** * Returns a list containing only elements from the given array * having distinct keys returned by the given [selector] function. + * * The elements in the resulting list are in the same order as they were in the source array. */ public inline fun ByteArray.distinctBy(selector: (Byte) -> K): List { @@ -7866,6 +8040,7 @@ public inline fun ByteArray.distinctBy(selector: (Byte) -> K): List { /** * Returns a list containing only elements from the given array * having distinct keys returned by the given [selector] function. + * * The elements in the resulting list are in the same order as they were in the source array. */ public inline fun ShortArray.distinctBy(selector: (Short) -> K): List { @@ -7882,6 +8057,7 @@ public inline fun ShortArray.distinctBy(selector: (Short) -> K): List /** * Returns a list containing only elements from the given array * having distinct keys returned by the given [selector] function. + * * The elements in the resulting list are in the same order as they were in the source array. */ public inline fun IntArray.distinctBy(selector: (Int) -> K): List { @@ -7898,6 +8074,7 @@ public inline fun IntArray.distinctBy(selector: (Int) -> K): List { /** * Returns a list containing only elements from the given array * having distinct keys returned by the given [selector] function. + * * The elements in the resulting list are in the same order as they were in the source array. */ public inline fun LongArray.distinctBy(selector: (Long) -> K): List { @@ -7914,6 +8091,7 @@ public inline fun LongArray.distinctBy(selector: (Long) -> K): List { /** * Returns a list containing only elements from the given array * having distinct keys returned by the given [selector] function. + * * The elements in the resulting list are in the same order as they were in the source array. */ public inline fun FloatArray.distinctBy(selector: (Float) -> K): List { @@ -7930,6 +8108,7 @@ public inline fun FloatArray.distinctBy(selector: (Float) -> K): List /** * Returns a list containing only elements from the given array * having distinct keys returned by the given [selector] function. + * * The elements in the resulting list are in the same order as they were in the source array. */ public inline fun DoubleArray.distinctBy(selector: (Double) -> K): List { @@ -7946,6 +8125,7 @@ public inline fun DoubleArray.distinctBy(selector: (Double) -> K): List BooleanArray.distinctBy(selector: (Boolean) -> K): List { @@ -7962,6 +8142,7 @@ public inline fun BooleanArray.distinctBy(selector: (Boolean) -> K): List CharArray.distinctBy(selector: (Char) -> K): List { @@ -7977,6 +8158,7 @@ public inline fun CharArray.distinctBy(selector: (Char) -> K): List { /** * Returns a set containing all elements that are contained by both this set and the specified collection. + * * The returned set preserves the element iteration order of the original array. */ public infix fun Array.intersect(other: Iterable): Set { @@ -7987,6 +8169,7 @@ public infix fun Array.intersect(other: Iterable): Set { /** * Returns a set containing all elements that are contained by both this set and the specified collection. + * * The returned set preserves the element iteration order of the original array. */ public infix fun ByteArray.intersect(other: Iterable): Set { @@ -7997,6 +8180,7 @@ public infix fun ByteArray.intersect(other: Iterable): Set { /** * Returns a set containing all elements that are contained by both this set and the specified collection. + * * The returned set preserves the element iteration order of the original array. */ public infix fun ShortArray.intersect(other: Iterable): Set { @@ -8007,6 +8191,7 @@ public infix fun ShortArray.intersect(other: Iterable): Set { /** * Returns a set containing all elements that are contained by both this set and the specified collection. + * * The returned set preserves the element iteration order of the original array. */ public infix fun IntArray.intersect(other: Iterable): Set { @@ -8017,6 +8202,7 @@ public infix fun IntArray.intersect(other: Iterable): Set { /** * Returns a set containing all elements that are contained by both this set and the specified collection. + * * The returned set preserves the element iteration order of the original array. */ public infix fun LongArray.intersect(other: Iterable): Set { @@ -8027,6 +8213,7 @@ public infix fun LongArray.intersect(other: Iterable): Set { /** * Returns a set containing all elements that are contained by both this set and the specified collection. + * * The returned set preserves the element iteration order of the original array. */ public infix fun FloatArray.intersect(other: Iterable): Set { @@ -8037,6 +8224,7 @@ public infix fun FloatArray.intersect(other: Iterable): Set { /** * Returns a set containing all elements that are contained by both this set and the specified collection. + * * The returned set preserves the element iteration order of the original array. */ public infix fun DoubleArray.intersect(other: Iterable): Set { @@ -8047,6 +8235,7 @@ public infix fun DoubleArray.intersect(other: Iterable): Set { /** * Returns a set containing all elements that are contained by both this set and the specified collection. + * * The returned set preserves the element iteration order of the original array. */ public infix fun BooleanArray.intersect(other: Iterable): Set { @@ -8057,6 +8246,7 @@ public infix fun BooleanArray.intersect(other: Iterable): Set /** * Returns a set containing all elements that are contained by both this set and the specified collection. + * * The returned set preserves the element iteration order of the original array. */ public infix fun CharArray.intersect(other: Iterable): Set { @@ -8067,6 +8257,7 @@ public infix fun CharArray.intersect(other: Iterable): Set { /** * Returns a set containing all elements that are contained by this array and not contained by the specified collection. + * * The returned set preserves the element iteration order of the original array. */ public infix fun Array.subtract(other: Iterable): Set { @@ -8077,6 +8268,7 @@ public infix fun Array.subtract(other: Iterable): Set { /** * Returns a set containing all elements that are contained by this array and not contained by the specified collection. + * * The returned set preserves the element iteration order of the original array. */ public infix fun ByteArray.subtract(other: Iterable): Set { @@ -8087,6 +8279,7 @@ public infix fun ByteArray.subtract(other: Iterable): Set { /** * Returns a set containing all elements that are contained by this array and not contained by the specified collection. + * * The returned set preserves the element iteration order of the original array. */ public infix fun ShortArray.subtract(other: Iterable): Set { @@ -8097,6 +8290,7 @@ public infix fun ShortArray.subtract(other: Iterable): Set { /** * Returns a set containing all elements that are contained by this array and not contained by the specified collection. + * * The returned set preserves the element iteration order of the original array. */ public infix fun IntArray.subtract(other: Iterable): Set { @@ -8107,6 +8301,7 @@ public infix fun IntArray.subtract(other: Iterable): Set { /** * Returns a set containing all elements that are contained by this array and not contained by the specified collection. + * * The returned set preserves the element iteration order of the original array. */ public infix fun LongArray.subtract(other: Iterable): Set { @@ -8117,6 +8312,7 @@ public infix fun LongArray.subtract(other: Iterable): Set { /** * Returns a set containing all elements that are contained by this array and not contained by the specified collection. + * * The returned set preserves the element iteration order of the original array. */ public infix fun FloatArray.subtract(other: Iterable): Set { @@ -8127,6 +8323,7 @@ public infix fun FloatArray.subtract(other: Iterable): Set { /** * Returns a set containing all elements that are contained by this array and not contained by the specified collection. + * * The returned set preserves the element iteration order of the original array. */ public infix fun DoubleArray.subtract(other: Iterable): Set { @@ -8137,6 +8334,7 @@ public infix fun DoubleArray.subtract(other: Iterable): Set { /** * Returns a set containing all elements that are contained by this array and not contained by the specified collection. + * * The returned set preserves the element iteration order of the original array. */ public infix fun BooleanArray.subtract(other: Iterable): Set { @@ -8147,6 +8345,7 @@ public infix fun BooleanArray.subtract(other: Iterable): Set { /** * Returns a set containing all elements that are contained by this array and not contained by the specified collection. + * * The returned set preserves the element iteration order of the original array. */ public infix fun CharArray.subtract(other: Iterable): Set { @@ -8157,6 +8356,7 @@ public infix fun CharArray.subtract(other: Iterable): Set { /** * Returns a mutable set containing all distinct elements from the given array. + * * The returned set preserves the element iteration order of the original array. */ public fun Array.toMutableSet(): MutableSet { @@ -8167,6 +8367,7 @@ public fun Array.toMutableSet(): MutableSet { /** * Returns a mutable set containing all distinct elements from the given array. + * * The returned set preserves the element iteration order of the original array. */ public fun ByteArray.toMutableSet(): MutableSet { @@ -8177,6 +8378,7 @@ public fun ByteArray.toMutableSet(): MutableSet { /** * Returns a mutable set containing all distinct elements from the given array. + * * The returned set preserves the element iteration order of the original array. */ public fun ShortArray.toMutableSet(): MutableSet { @@ -8187,6 +8389,7 @@ public fun ShortArray.toMutableSet(): MutableSet { /** * Returns a mutable set containing all distinct elements from the given array. + * * The returned set preserves the element iteration order of the original array. */ public fun IntArray.toMutableSet(): MutableSet { @@ -8197,6 +8400,7 @@ public fun IntArray.toMutableSet(): MutableSet { /** * Returns a mutable set containing all distinct elements from the given array. + * * The returned set preserves the element iteration order of the original array. */ public fun LongArray.toMutableSet(): MutableSet { @@ -8207,6 +8411,7 @@ public fun LongArray.toMutableSet(): MutableSet { /** * Returns a mutable set containing all distinct elements from the given array. + * * The returned set preserves the element iteration order of the original array. */ public fun FloatArray.toMutableSet(): MutableSet { @@ -8217,6 +8422,7 @@ public fun FloatArray.toMutableSet(): MutableSet { /** * Returns a mutable set containing all distinct elements from the given array. + * * The returned set preserves the element iteration order of the original array. */ public fun DoubleArray.toMutableSet(): MutableSet { @@ -8227,6 +8433,7 @@ public fun DoubleArray.toMutableSet(): MutableSet { /** * Returns a mutable set containing all distinct elements from the given array. + * * The returned set preserves the element iteration order of the original array. */ public fun BooleanArray.toMutableSet(): MutableSet { @@ -8237,6 +8444,7 @@ public fun BooleanArray.toMutableSet(): MutableSet { /** * Returns a mutable set containing all distinct elements from the given array. + * * The returned set preserves the element iteration order of the original array. */ public fun CharArray.toMutableSet(): MutableSet { @@ -8247,6 +8455,7 @@ public fun CharArray.toMutableSet(): MutableSet { /** * Returns a set containing all distinct elements from both collections. + * * The returned set preserves the element iteration order of the original array. * Those elements of the [other] collection that are unique are iterated in the end * in the order of the [other] collection. @@ -8259,6 +8468,7 @@ public infix fun Array.union(other: Iterable): Set { /** * Returns a set containing all distinct elements from both collections. + * * The returned set preserves the element iteration order of the original array. * Those elements of the [other] collection that are unique are iterated in the end * in the order of the [other] collection. @@ -8271,6 +8481,7 @@ public infix fun ByteArray.union(other: Iterable): Set { /** * Returns a set containing all distinct elements from both collections. + * * The returned set preserves the element iteration order of the original array. * Those elements of the [other] collection that are unique are iterated in the end * in the order of the [other] collection. @@ -8283,6 +8494,7 @@ public infix fun ShortArray.union(other: Iterable): Set { /** * Returns a set containing all distinct elements from both collections. + * * The returned set preserves the element iteration order of the original array. * Those elements of the [other] collection that are unique are iterated in the end * in the order of the [other] collection. @@ -8295,6 +8507,7 @@ public infix fun IntArray.union(other: Iterable): Set { /** * Returns a set containing all distinct elements from both collections. + * * The returned set preserves the element iteration order of the original array. * Those elements of the [other] collection that are unique are iterated in the end * in the order of the [other] collection. @@ -8307,6 +8520,7 @@ public infix fun LongArray.union(other: Iterable): Set { /** * Returns a set containing all distinct elements from both collections. + * * The returned set preserves the element iteration order of the original array. * Those elements of the [other] collection that are unique are iterated in the end * in the order of the [other] collection. @@ -8319,6 +8533,7 @@ public infix fun FloatArray.union(other: Iterable): Set { /** * Returns a set containing all distinct elements from both collections. + * * The returned set preserves the element iteration order of the original array. * Those elements of the [other] collection that are unique are iterated in the end * in the order of the [other] collection. @@ -8331,6 +8546,7 @@ public infix fun DoubleArray.union(other: Iterable): Set { /** * Returns a set containing all distinct elements from both collections. + * * The returned set preserves the element iteration order of the original array. * Those elements of the [other] collection that are unique are iterated in the end * in the order of the [other] collection. @@ -8343,6 +8559,7 @@ public infix fun BooleanArray.union(other: Iterable): Set { /** * Returns a set containing all distinct elements from both collections. + * * The returned set preserves the element iteration order of the original array. * Those elements of the [other] collection that are unique are iterated in the end * in the order of the [other] collection. @@ -11662,6 +11879,7 @@ public inline fun CharArray.zip(other: CharArray, transform: (Char, Char) -> /** * Appends the string from all the elements separated using [separator] and using the given [prefix] and [postfix] if supplied. + * * If the collection could be huge, you can specify a non-negative value of [limit], in which case only the first [limit] * elements will be appended, followed by the [truncated] string (which defaults to "..."). */ @@ -11684,6 +11902,7 @@ public fun Array.joinTo(buffer: A, separator: CharSeq /** * Appends the string from all the elements separated using [separator] and using the given [prefix] and [postfix] if supplied. + * * If the collection could be huge, you can specify a non-negative value of [limit], in which case only the first [limit] * elements will be appended, followed by the [truncated] string (which defaults to "..."). */ @@ -11706,6 +11925,7 @@ public fun ByteArray.joinTo(buffer: A, separator: CharSequence /** * Appends the string from all the elements separated using [separator] and using the given [prefix] and [postfix] if supplied. + * * If the collection could be huge, you can specify a non-negative value of [limit], in which case only the first [limit] * elements will be appended, followed by the [truncated] string (which defaults to "..."). */ @@ -11728,6 +11948,7 @@ public fun ShortArray.joinTo(buffer: A, separator: CharSequence /** * Appends the string from all the elements separated using [separator] and using the given [prefix] and [postfix] if supplied. + * * If the collection could be huge, you can specify a non-negative value of [limit], in which case only the first [limit] * elements will be appended, followed by the [truncated] string (which defaults to "..."). */ @@ -11750,6 +11971,7 @@ public fun IntArray.joinTo(buffer: A, separator: CharSequence = /** * Appends the string from all the elements separated using [separator] and using the given [prefix] and [postfix] if supplied. + * * If the collection could be huge, you can specify a non-negative value of [limit], in which case only the first [limit] * elements will be appended, followed by the [truncated] string (which defaults to "..."). */ @@ -11772,6 +11994,7 @@ public fun LongArray.joinTo(buffer: A, separator: CharSequence /** * Appends the string from all the elements separated using [separator] and using the given [prefix] and [postfix] if supplied. + * * If the collection could be huge, you can specify a non-negative value of [limit], in which case only the first [limit] * elements will be appended, followed by the [truncated] string (which defaults to "..."). */ @@ -11794,6 +12017,7 @@ public fun FloatArray.joinTo(buffer: A, separator: CharSequence /** * Appends the string from all the elements separated using [separator] and using the given [prefix] and [postfix] if supplied. + * * If the collection could be huge, you can specify a non-negative value of [limit], in which case only the first [limit] * elements will be appended, followed by the [truncated] string (which defaults to "..."). */ @@ -11816,6 +12040,7 @@ public fun DoubleArray.joinTo(buffer: A, separator: CharSequenc /** * Appends the string from all the elements separated using [separator] and using the given [prefix] and [postfix] if supplied. + * * If the collection could be huge, you can specify a non-negative value of [limit], in which case only the first [limit] * elements will be appended, followed by the [truncated] string (which defaults to "..."). */ @@ -11838,6 +12063,7 @@ public fun BooleanArray.joinTo(buffer: A, separator: CharSequen /** * Appends the string from all the elements separated using [separator] and using the given [prefix] and [postfix] if supplied. + * * If the collection could be huge, you can specify a non-negative value of [limit], in which case only the first [limit] * elements will be appended, followed by the [truncated] string (which defaults to "..."). */ @@ -11860,6 +12086,7 @@ public fun CharArray.joinTo(buffer: A, separator: CharSequence /** * Creates a string from all the elements separated using [separator] and using the given [prefix] and [postfix] if supplied. + * * If the collection could be huge, you can specify a non-negative value of [limit], in which case only the first [limit] * elements will be appended, followed by the [truncated] string (which defaults to "..."). */ @@ -11869,6 +12096,7 @@ public fun Array.joinToString(separator: CharSequence = ", ", prefix: /** * Creates a string from all the elements separated using [separator] and using the given [prefix] and [postfix] if supplied. + * * If the collection could be huge, you can specify a non-negative value of [limit], in which case only the first [limit] * elements will be appended, followed by the [truncated] string (which defaults to "..."). */ @@ -11878,6 +12106,7 @@ public fun ByteArray.joinToString(separator: CharSequence = ", ", prefix: CharSe /** * Creates a string from all the elements separated using [separator] and using the given [prefix] and [postfix] if supplied. + * * If the collection could be huge, you can specify a non-negative value of [limit], in which case only the first [limit] * elements will be appended, followed by the [truncated] string (which defaults to "..."). */ @@ -11887,6 +12116,7 @@ public fun ShortArray.joinToString(separator: CharSequence = ", ", prefix: CharS /** * Creates a string from all the elements separated using [separator] and using the given [prefix] and [postfix] if supplied. + * * If the collection could be huge, you can specify a non-negative value of [limit], in which case only the first [limit] * elements will be appended, followed by the [truncated] string (which defaults to "..."). */ @@ -11896,6 +12126,7 @@ public fun IntArray.joinToString(separator: CharSequence = ", ", prefix: CharSeq /** * Creates a string from all the elements separated using [separator] and using the given [prefix] and [postfix] if supplied. + * * If the collection could be huge, you can specify a non-negative value of [limit], in which case only the first [limit] * elements will be appended, followed by the [truncated] string (which defaults to "..."). */ @@ -11905,6 +12136,7 @@ public fun LongArray.joinToString(separator: CharSequence = ", ", prefix: CharSe /** * Creates a string from all the elements separated using [separator] and using the given [prefix] and [postfix] if supplied. + * * If the collection could be huge, you can specify a non-negative value of [limit], in which case only the first [limit] * elements will be appended, followed by the [truncated] string (which defaults to "..."). */ @@ -11914,6 +12146,7 @@ public fun FloatArray.joinToString(separator: CharSequence = ", ", prefix: CharS /** * Creates a string from all the elements separated using [separator] and using the given [prefix] and [postfix] if supplied. + * * If the collection could be huge, you can specify a non-negative value of [limit], in which case only the first [limit] * elements will be appended, followed by the [truncated] string (which defaults to "..."). */ @@ -11923,6 +12156,7 @@ public fun DoubleArray.joinToString(separator: CharSequence = ", ", prefix: Char /** * Creates a string from all the elements separated using [separator] and using the given [prefix] and [postfix] if supplied. + * * If the collection could be huge, you can specify a non-negative value of [limit], in which case only the first [limit] * elements will be appended, followed by the [truncated] string (which defaults to "..."). */ @@ -11932,6 +12166,7 @@ public fun BooleanArray.joinToString(separator: CharSequence = ", ", prefix: Cha /** * Creates a string from all the elements separated using [separator] and using the given [prefix] and [postfix] if supplied. + * * If the collection could be huge, you can specify a non-negative value of [limit], in which case only the first [limit] * elements will be appended, followed by the [truncated] string (which defaults to "..."). */ @@ -12214,7 +12449,9 @@ public fun CharArray.asList(): List { /** * Searches the array or the range of the array for the provided [element] using the binary search algorithm. * The array is expected to be sorted according to the specified [comparator], otherwise the result is undefined. + * * If the array contains multiple elements equal to the specified [element], there is no guarantee which one will be found. + * * @return the index of the element, if it is contained in the array within the specified range; * otherwise, the inverted insertion point `(-insertion point - 1)`. * The insertion point is defined as the index at which the element should be inserted, @@ -12228,7 +12465,9 @@ public fun Array.binarySearch(element: T, comparator: Comparator Array.binarySearch(element: T, fromIndex: Int = 0, toIndex /** * Searches the array or the range of the array for the provided [element] using the binary search algorithm. * The array is expected to be sorted, otherwise the result is undefined. + * * If the array contains multiple elements equal to the specified [element], there is no guarantee which one will be found. + * * @return the index of the element, if it is contained in the array within the specified range; * otherwise, the inverted insertion point `(-insertion point - 1)`. * The insertion point is defined as the index at which the element should be inserted, @@ -12256,7 +12497,9 @@ public fun ByteArray.binarySearch(element: Byte, fromIndex: Int = 0, toIndex: In /** * Searches the array or the range of the array for the provided [element] using the binary search algorithm. * The array is expected to be sorted, otherwise the result is undefined. + * * If the array contains multiple elements equal to the specified [element], there is no guarantee which one will be found. + * * @return the index of the element, if it is contained in the array within the specified range; * otherwise, the inverted insertion point `(-insertion point - 1)`. * The insertion point is defined as the index at which the element should be inserted, @@ -12270,7 +12513,9 @@ public fun ShortArray.binarySearch(element: Short, fromIndex: Int = 0, toIndex: /** * Searches the array or the range of the array for the provided [element] using the binary search algorithm. * The array is expected to be sorted, otherwise the result is undefined. + * * If the array contains multiple elements equal to the specified [element], there is no guarantee which one will be found. + * * @return the index of the element, if it is contained in the array within the specified range; * otherwise, the inverted insertion point `(-insertion point - 1)`. * The insertion point is defined as the index at which the element should be inserted, @@ -12284,7 +12529,9 @@ public fun IntArray.binarySearch(element: Int, fromIndex: Int = 0, toIndex: Int /** * Searches the array or the range of the array for the provided [element] using the binary search algorithm. * The array is expected to be sorted, otherwise the result is undefined. + * * If the array contains multiple elements equal to the specified [element], there is no guarantee which one will be found. + * * @return the index of the element, if it is contained in the array within the specified range; * otherwise, the inverted insertion point `(-insertion point - 1)`. * The insertion point is defined as the index at which the element should be inserted, @@ -12298,7 +12545,9 @@ public fun LongArray.binarySearch(element: Long, fromIndex: Int = 0, toIndex: In /** * Searches the array or the range of the array for the provided [element] using the binary search algorithm. * The array is expected to be sorted, otherwise the result is undefined. + * * If the array contains multiple elements equal to the specified [element], there is no guarantee which one will be found. + * * @return the index of the element, if it is contained in the array within the specified range; * otherwise, the inverted insertion point `(-insertion point - 1)`. * The insertion point is defined as the index at which the element should be inserted, @@ -12312,7 +12561,9 @@ public fun FloatArray.binarySearch(element: Float, fromIndex: Int = 0, toIndex: /** * Searches the array or the range of the array for the provided [element] using the binary search algorithm. * The array is expected to be sorted, otherwise the result is undefined. + * * If the array contains multiple elements equal to the specified [element], there is no guarantee which one will be found. + * * @return the index of the element, if it is contained in the array within the specified range; * otherwise, the inverted insertion point `(-insertion point - 1)`. * The insertion point is defined as the index at which the element should be inserted, @@ -12326,7 +12577,9 @@ public fun DoubleArray.binarySearch(element: Double, fromIndex: Int = 0, toIndex /** * Searches the array or the range of the array for the provided [element] using the binary search algorithm. * The array is expected to be sorted, otherwise the result is undefined. + * * If the array contains multiple elements equal to the specified [element], there is no guarantee which one will be found. + * * @return the index of the element, if it is contained in the array within the specified range; * otherwise, the inverted insertion point `(-insertion point - 1)`. * The insertion point is defined as the index at which the element should be inserted, diff --git a/libraries/stdlib/src/generated/_Collections.kt b/libraries/stdlib/src/generated/_Collections.kt index 5c09c694d1d..0b0e2177bde 100644 --- a/libraries/stdlib/src/generated/_Collections.kt +++ b/libraries/stdlib/src/generated/_Collections.kt @@ -957,7 +957,9 @@ public fun Collection.toShortArray(): ShortArray { /** * Returns a [Map] containing key-value pairs provided by [transform] function * applied to elements of the given collection. + * * If any of two pairs would have the same key the last one gets added to the map. + * * The returned map preserves the entry iteration order of the original collection. */ public inline fun Iterable.associate(transform: (T) -> Pair): Map { @@ -969,7 +971,9 @@ public inline fun Iterable.associate(transform: (T) -> Pair): /** * Returns a [Map] containing the elements from the given collection indexed by the key * returned from [keySelector] function applied to each element. + * * If any two elements would have the same key returned by [keySelector] the last one gets added to the map. + * * The returned map preserves the entry iteration order of the original collection. */ public inline fun Iterable.associateBy(keySelector: (T) -> K): Map { @@ -980,7 +984,9 @@ public inline fun Iterable.associateBy(keySelector: (T) -> K): Map Iterable.associateBy(keySelector: (T) -> K, valueTransform: (T) -> V): Map { @@ -993,6 +999,7 @@ public inline fun Iterable.associateBy(keySelector: (T) -> K, value * Populates and returns the [destination] mutable map with key-value pairs, * where key is provided by the [keySelector] function applied to each element of the given collection * and value is the element itself. + * * If any two elements would have the same key returned by [keySelector] the last one gets added to the map. */ public inline fun > Iterable.associateByTo(destination: M, keySelector: (T) -> K): M { @@ -1006,6 +1013,7 @@ public inline fun > Iterable.associateByTo(d * Populates and returns the [destination] mutable map with key-value pairs, * where key is provided by the [keySelector] function and * and value is provided by the [valueTransform] function applied to elements of the given collection. + * * If any two elements would have the same key returned by [keySelector] the last one gets added to the map. */ public inline fun > Iterable.associateByTo(destination: M, keySelector: (T) -> K, valueTransform: (T) -> V): M { @@ -1018,6 +1026,7 @@ public inline fun > Iterable.associateByT /** * Populates and returns the [destination] mutable map with key-value pairs * provided by [transform] function applied to each element of the given collection. + * * If any of two pairs would have the same key the last one gets added to the map. */ public inline fun > Iterable.associateTo(destination: M, transform: (T) -> Pair): M { @@ -1076,6 +1085,7 @@ public fun Collection.toMutableList(): MutableList { /** * Returns a [Set] of all elements. + * * The returned set preserves the element iteration order of the original collection. */ public fun Iterable.toSet(): Set { @@ -1099,6 +1109,7 @@ public fun > Iterable.toSortedSet(): SortedSet { /** * Returns a [SortedSet] of all elements. + * * Elements in the set returned are sorted according to the given [comparator]. */ @kotlin.jvm.JvmVersion @@ -1127,7 +1138,9 @@ public inline fun > Iterable.flatMapTo(dest /** * Groups elements of the original collection by the key returned by the given [keySelector] function * applied to each element and returns a map where each group key is associated with a list of corresponding elements. + * * The returned map preserves the entry iteration order of the keys produced from the original collection. + * * @sample test.collections.CollectionTest.groupBy */ public inline fun Iterable.groupBy(keySelector: (T) -> K): Map> { @@ -1138,7 +1151,9 @@ public inline fun Iterable.groupBy(keySelector: (T) -> K): Map Iterable.groupBy(keySelector: (T) -> K, valueTransform: (T) -> V): Map> { @@ -1148,7 +1163,9 @@ public inline fun Iterable.groupBy(keySelector: (T) -> K, valueTran /** * Groups elements of the original collection by the key returned by the given [keySelector] function * applied to each element and puts to the [destination] map each group key associated with a list of corresponding elements. + * * @return The [destination] map. + * * @sample test.collections.CollectionTest.groupBy */ public inline fun >> Iterable.groupByTo(destination: M, keySelector: (T) -> K): M { @@ -1164,7 +1181,9 @@ public inline fun >> Iterable.group * Groups values returned by the [valueTransform] function applied to each element of the original collection * by the key returned by the given [keySelector] function applied to the element * and puts to the [destination] map each group key associated with a list of corresponding values. + * * @return The [destination] map. + * * @sample test.collections.CollectionTest.groupByKeysAndValues */ public inline fun >> Iterable.groupByTo(destination: M, keySelector: (T) -> K, valueTransform: (T) -> V): M { @@ -1266,6 +1285,7 @@ public fun Iterable.withIndex(): Iterable> { /** * Returns a list containing only distinct elements from the given collection. + * * The elements in the resulting list are in the same order as they were in the source collection. */ public fun Iterable.distinct(): List { @@ -1275,6 +1295,7 @@ public fun Iterable.distinct(): List { /** * Returns a list containing only elements from the given collection * having distinct keys returned by the given [selector] function. + * * The elements in the resulting list are in the same order as they were in the source collection. */ public inline fun Iterable.distinctBy(selector: (T) -> K): List { @@ -1290,6 +1311,7 @@ public inline fun Iterable.distinctBy(selector: (T) -> K): List { /** * Returns a set containing all elements that are contained by both this set and the specified collection. + * * The returned set preserves the element iteration order of the original collection. */ public infix fun Iterable.intersect(other: Iterable): Set { @@ -1300,6 +1322,7 @@ public infix fun Iterable.intersect(other: Iterable): Set { /** * Returns a set containing all elements that are contained by this collection and not contained by the specified collection. + * * The returned set preserves the element iteration order of the original collection. */ public infix fun Iterable.subtract(other: Iterable): Set { @@ -1310,6 +1333,7 @@ public infix fun Iterable.subtract(other: Iterable): Set { /** * Returns a mutable set containing all distinct elements from the given collection. + * * The returned set preserves the element iteration order of the original collection. */ public fun Iterable.toMutableSet(): MutableSet { @@ -1321,6 +1345,7 @@ public fun Iterable.toMutableSet(): MutableSet { /** * Returns a set containing all distinct elements from both collections. + * * The returned set preserves the element iteration order of the original collection. * Those elements of the [other] collection that are unique are iterated in the end * in the order of the [other] collection. @@ -1887,6 +1912,7 @@ public inline fun Iterable.zip(other: Iterable, transform: (T, R /** * Appends the string from all the elements separated using [separator] and using the given [prefix] and [postfix] if supplied. + * * If the collection could be huge, you can specify a non-negative value of [limit], in which case only the first [limit] * elements will be appended, followed by the [truncated] string (which defaults to "..."). */ @@ -1909,6 +1935,7 @@ public fun Iterable.joinTo(buffer: A, separator: CharSequ /** * Creates a string from all the elements separated using [separator] and using the given [prefix] and [postfix] if supplied. + * * If the collection could be huge, you can specify a non-negative value of [limit], in which case only the first [limit] * elements will be appended, followed by the [truncated] string (which defaults to "..."). */ diff --git a/libraries/stdlib/src/generated/_Ranges.kt b/libraries/stdlib/src/generated/_Ranges.kt index 33caf9b2093..643b561ef59 100644 --- a/libraries/stdlib/src/generated/_Ranges.kt +++ b/libraries/stdlib/src/generated/_Ranges.kt @@ -255,6 +255,7 @@ public operator fun ClosedRange.contains(value: Short): Boolean { /** * Returns a progression from this value down to the specified [to] value with the step -1. + * * The [to] value has to be less than this value. */ public infix fun Int.downTo(to: Byte): IntProgression { @@ -263,6 +264,7 @@ public infix fun Int.downTo(to: Byte): IntProgression { /** * Returns a progression from this value down to the specified [to] value with the step -1. + * * The [to] value has to be less than this value. */ public infix fun Long.downTo(to: Byte): LongProgression { @@ -271,6 +273,7 @@ public infix fun Long.downTo(to: Byte): LongProgression { /** * Returns a progression from this value down to the specified [to] value with the step -1. + * * The [to] value has to be less than this value. */ public infix fun Byte.downTo(to: Byte): IntProgression { @@ -279,6 +282,7 @@ public infix fun Byte.downTo(to: Byte): IntProgression { /** * Returns a progression from this value down to the specified [to] value with the step -1. + * * The [to] value has to be less than this value. */ public infix fun Short.downTo(to: Byte): IntProgression { @@ -287,6 +291,7 @@ public infix fun Short.downTo(to: Byte): IntProgression { /** * Returns a progression from this value down to the specified [to] value with the step -1. + * * The [to] value has to be less than this value. */ public infix fun Char.downTo(to: Char): CharProgression { @@ -295,6 +300,7 @@ public infix fun Char.downTo(to: Char): CharProgression { /** * Returns a progression from this value down to the specified [to] value with the step -1. + * * The [to] value has to be less than this value. */ public infix fun Int.downTo(to: Int): IntProgression { @@ -303,6 +309,7 @@ public infix fun Int.downTo(to: Int): IntProgression { /** * Returns a progression from this value down to the specified [to] value with the step -1. + * * The [to] value has to be less than this value. */ public infix fun Long.downTo(to: Int): LongProgression { @@ -311,6 +318,7 @@ public infix fun Long.downTo(to: Int): LongProgression { /** * Returns a progression from this value down to the specified [to] value with the step -1. + * * The [to] value has to be less than this value. */ public infix fun Byte.downTo(to: Int): IntProgression { @@ -319,6 +327,7 @@ public infix fun Byte.downTo(to: Int): IntProgression { /** * Returns a progression from this value down to the specified [to] value with the step -1. + * * The [to] value has to be less than this value. */ public infix fun Short.downTo(to: Int): IntProgression { @@ -327,6 +336,7 @@ public infix fun Short.downTo(to: Int): IntProgression { /** * Returns a progression from this value down to the specified [to] value with the step -1. + * * The [to] value has to be less than this value. */ public infix fun Int.downTo(to: Long): LongProgression { @@ -335,6 +345,7 @@ public infix fun Int.downTo(to: Long): LongProgression { /** * Returns a progression from this value down to the specified [to] value with the step -1. + * * The [to] value has to be less than this value. */ public infix fun Long.downTo(to: Long): LongProgression { @@ -343,6 +354,7 @@ public infix fun Long.downTo(to: Long): LongProgression { /** * Returns a progression from this value down to the specified [to] value with the step -1. + * * The [to] value has to be less than this value. */ public infix fun Byte.downTo(to: Long): LongProgression { @@ -351,6 +363,7 @@ public infix fun Byte.downTo(to: Long): LongProgression { /** * Returns a progression from this value down to the specified [to] value with the step -1. + * * The [to] value has to be less than this value. */ public infix fun Short.downTo(to: Long): LongProgression { @@ -359,6 +372,7 @@ public infix fun Short.downTo(to: Long): LongProgression { /** * Returns a progression from this value down to the specified [to] value with the step -1. + * * The [to] value has to be less than this value. */ public infix fun Int.downTo(to: Short): IntProgression { @@ -367,6 +381,7 @@ public infix fun Int.downTo(to: Short): IntProgression { /** * Returns a progression from this value down to the specified [to] value with the step -1. + * * The [to] value has to be less than this value. */ public infix fun Long.downTo(to: Short): LongProgression { @@ -375,6 +390,7 @@ public infix fun Long.downTo(to: Short): LongProgression { /** * Returns a progression from this value down to the specified [to] value with the step -1. + * * The [to] value has to be less than this value. */ public infix fun Byte.downTo(to: Short): IntProgression { @@ -383,6 +399,7 @@ public infix fun Byte.downTo(to: Short): IntProgression { /** * Returns a progression from this value down to the specified [to] value with the step -1. + * * The [to] value has to be less than this value. */ public infix fun Short.downTo(to: Short): IntProgression { @@ -464,6 +481,7 @@ public infix fun Short.until(to: Byte): IntRange { /** * Returns a range from this value up to but excluding the specified [to] value. + * * The [to] value must be greater than [Char.MIN_VALUE]. */ public infix fun Char.until(to: Char): CharRange { @@ -474,6 +492,7 @@ public infix fun Char.until(to: Char): CharRange { /** * Returns a range from this value up to but excluding the specified [to] value. + * * The [to] value must be greater than [Int.MIN_VALUE]. */ public infix fun Int.until(to: Int): IntRange { @@ -491,6 +510,7 @@ public infix fun Long.until(to: Int): LongRange { /** * Returns a range from this value up to but excluding the specified [to] value. + * * The [to] value must be greater than [Int.MIN_VALUE]. */ public infix fun Byte.until(to: Int): IntRange { @@ -501,6 +521,7 @@ public infix fun Byte.until(to: Int): IntRange { /** * Returns a range from this value up to but excluding the specified [to] value. + * * The [to] value must be greater than [Int.MIN_VALUE]. */ public infix fun Short.until(to: Int): IntRange { @@ -511,6 +532,7 @@ public infix fun Short.until(to: Int): IntRange { /** * Returns a range from this value up to but excluding the specified [to] value. + * * The [to] value must be greater than [Long.MIN_VALUE]. */ public infix fun Int.until(to: Long): LongRange { @@ -521,6 +543,7 @@ public infix fun Int.until(to: Long): LongRange { /** * Returns a range from this value up to but excluding the specified [to] value. + * * The [to] value must be greater than [Long.MIN_VALUE]. */ public infix fun Long.until(to: Long): LongRange { @@ -531,6 +554,7 @@ public infix fun Long.until(to: Long): LongRange { /** * Returns a range from this value up to but excluding the specified [to] value. + * * The [to] value must be greater than [Long.MIN_VALUE]. */ public infix fun Byte.until(to: Long): LongRange { @@ -541,6 +565,7 @@ public infix fun Byte.until(to: Long): LongRange { /** * Returns a range from this value up to but excluding the specified [to] value. + * * The [to] value must be greater than [Long.MIN_VALUE]. */ public infix fun Short.until(to: Long): LongRange { @@ -579,6 +604,7 @@ public infix fun Short.until(to: Short): IntRange { /** * Ensures that this value is not less than the specified [minimumValue]. + * * @return this value if it's greater than or equal to the [minimumValue] or the [minimumValue] otherwise. */ public fun > T.coerceAtLeast(minimumValue: T): T { @@ -587,6 +613,7 @@ public fun > T.coerceAtLeast(minimumValue: T): T { /** * Ensures that this value is not less than the specified [minimumValue]. + * * @return this value if it's greater than or equal to the [minimumValue] or the [minimumValue] otherwise. */ public fun Byte.coerceAtLeast(minimumValue: Byte): Byte { @@ -595,6 +622,7 @@ public fun Byte.coerceAtLeast(minimumValue: Byte): Byte { /** * Ensures that this value is not less than the specified [minimumValue]. + * * @return this value if it's greater than or equal to the [minimumValue] or the [minimumValue] otherwise. */ public fun Short.coerceAtLeast(minimumValue: Short): Short { @@ -603,6 +631,7 @@ public fun Short.coerceAtLeast(minimumValue: Short): Short { /** * Ensures that this value is not less than the specified [minimumValue]. + * * @return this value if it's greater than or equal to the [minimumValue] or the [minimumValue] otherwise. */ public fun Int.coerceAtLeast(minimumValue: Int): Int { @@ -611,6 +640,7 @@ public fun Int.coerceAtLeast(minimumValue: Int): Int { /** * Ensures that this value is not less than the specified [minimumValue]. + * * @return this value if it's greater than or equal to the [minimumValue] or the [minimumValue] otherwise. */ public fun Long.coerceAtLeast(minimumValue: Long): Long { @@ -619,6 +649,7 @@ public fun Long.coerceAtLeast(minimumValue: Long): Long { /** * Ensures that this value is not less than the specified [minimumValue]. + * * @return this value if it's greater than or equal to the [minimumValue] or the [minimumValue] otherwise. */ public fun Float.coerceAtLeast(minimumValue: Float): Float { @@ -627,6 +658,7 @@ public fun Float.coerceAtLeast(minimumValue: Float): Float { /** * Ensures that this value is not less than the specified [minimumValue]. + * * @return this value if it's greater than or equal to the [minimumValue] or the [minimumValue] otherwise. */ public fun Double.coerceAtLeast(minimumValue: Double): Double { @@ -635,6 +667,7 @@ public fun Double.coerceAtLeast(minimumValue: Double): Double { /** * Ensures that this value is not greater than the specified [maximumValue]. + * * @return this value if it's less than or equal to the [maximumValue] or the [maximumValue] otherwise. */ public fun > T.coerceAtMost(maximumValue: T): T { @@ -643,6 +676,7 @@ public fun > T.coerceAtMost(maximumValue: T): T { /** * Ensures that this value is not greater than the specified [maximumValue]. + * * @return this value if it's less than or equal to the [maximumValue] or the [maximumValue] otherwise. */ public fun Byte.coerceAtMost(maximumValue: Byte): Byte { @@ -651,6 +685,7 @@ public fun Byte.coerceAtMost(maximumValue: Byte): Byte { /** * Ensures that this value is not greater than the specified [maximumValue]. + * * @return this value if it's less than or equal to the [maximumValue] or the [maximumValue] otherwise. */ public fun Short.coerceAtMost(maximumValue: Short): Short { @@ -659,6 +694,7 @@ public fun Short.coerceAtMost(maximumValue: Short): Short { /** * Ensures that this value is not greater than the specified [maximumValue]. + * * @return this value if it's less than or equal to the [maximumValue] or the [maximumValue] otherwise. */ public fun Int.coerceAtMost(maximumValue: Int): Int { @@ -667,6 +703,7 @@ public fun Int.coerceAtMost(maximumValue: Int): Int { /** * Ensures that this value is not greater than the specified [maximumValue]. + * * @return this value if it's less than or equal to the [maximumValue] or the [maximumValue] otherwise. */ public fun Long.coerceAtMost(maximumValue: Long): Long { @@ -675,6 +712,7 @@ public fun Long.coerceAtMost(maximumValue: Long): Long { /** * Ensures that this value is not greater than the specified [maximumValue]. + * * @return this value if it's less than or equal to the [maximumValue] or the [maximumValue] otherwise. */ public fun Float.coerceAtMost(maximumValue: Float): Float { @@ -683,6 +721,7 @@ public fun Float.coerceAtMost(maximumValue: Float): Float { /** * Ensures that this value is not greater than the specified [maximumValue]. + * * @return this value if it's less than or equal to the [maximumValue] or the [maximumValue] otherwise. */ public fun Double.coerceAtMost(maximumValue: Double): Double { @@ -691,6 +730,7 @@ public fun Double.coerceAtMost(maximumValue: Double): Double { /** * Ensures that this value lies in the specified range [minimumValue]..[maximumValue]. + * * @return this value if it's in the range, or [minimumValue] if this value is less than [minimumValue], or [maximumValue] if this value is greater than [maximumValue]. */ public fun > T.coerceIn(minimumValue: T?, maximumValue: T?): T { @@ -708,6 +748,7 @@ public fun > T.coerceIn(minimumValue: T?, maximumValue: T?): T /** * Ensures that this value lies in the specified range [minimumValue]..[maximumValue]. + * * @return this value if it's in the range, or [minimumValue] if this value is less than [minimumValue], or [maximumValue] if this value is greater than [maximumValue]. */ public fun Byte.coerceIn(minimumValue: Byte, maximumValue: Byte): Byte { @@ -719,6 +760,7 @@ public fun Byte.coerceIn(minimumValue: Byte, maximumValue: Byte): Byte { /** * Ensures that this value lies in the specified range [minimumValue]..[maximumValue]. + * * @return this value if it's in the range, or [minimumValue] if this value is less than [minimumValue], or [maximumValue] if this value is greater than [maximumValue]. */ public fun Short.coerceIn(minimumValue: Short, maximumValue: Short): Short { @@ -730,6 +772,7 @@ public fun Short.coerceIn(minimumValue: Short, maximumValue: Short): Short { /** * Ensures that this value lies in the specified range [minimumValue]..[maximumValue]. + * * @return this value if it's in the range, or [minimumValue] if this value is less than [minimumValue], or [maximumValue] if this value is greater than [maximumValue]. */ public fun Int.coerceIn(minimumValue: Int, maximumValue: Int): Int { @@ -741,6 +784,7 @@ public fun Int.coerceIn(minimumValue: Int, maximumValue: Int): Int { /** * Ensures that this value lies in the specified range [minimumValue]..[maximumValue]. + * * @return this value if it's in the range, or [minimumValue] if this value is less than [minimumValue], or [maximumValue] if this value is greater than [maximumValue]. */ public fun Long.coerceIn(minimumValue: Long, maximumValue: Long): Long { @@ -752,6 +796,7 @@ public fun Long.coerceIn(minimumValue: Long, maximumValue: Long): Long { /** * Ensures that this value lies in the specified range [minimumValue]..[maximumValue]. + * * @return this value if it's in the range, or [minimumValue] if this value is less than [minimumValue], or [maximumValue] if this value is greater than [maximumValue]. */ public fun Float.coerceIn(minimumValue: Float, maximumValue: Float): Float { @@ -763,6 +808,7 @@ public fun Float.coerceIn(minimumValue: Float, maximumValue: Float): Float { /** * Ensures that this value lies in the specified range [minimumValue]..[maximumValue]. + * * @return this value if it's in the range, or [minimumValue] if this value is less than [minimumValue], or [maximumValue] if this value is greater than [maximumValue]. */ public fun Double.coerceIn(minimumValue: Double, maximumValue: Double): Double { @@ -774,6 +820,7 @@ public fun Double.coerceIn(minimumValue: Double, maximumValue: Double): Double { /** * Ensures that this value lies in the specified [range]. + * * @return this value if it's in the [range], or range.start if this value is less than range.start, or range.end if this value is greater than range.end. */ public fun > T.coerceIn(range: ClosedRange): T { @@ -783,6 +830,7 @@ public fun > T.coerceIn(range: ClosedRange): T { /** * Ensures that this value lies in the specified [range]. + * * @return this value if it's in the [range], or range.start if this value is less than range.start, or range.end if this value is greater than range.end. */ public fun Int.coerceIn(range: ClosedRange): Int { @@ -792,6 +840,7 @@ public fun Int.coerceIn(range: ClosedRange): Int { /** * Ensures that this value lies in the specified [range]. + * * @return this value if it's in the [range], or range.start if this value is less than range.start, or range.end if this value is greater than range.end. */ public fun Long.coerceIn(range: ClosedRange): Long { diff --git a/libraries/stdlib/src/generated/_Sequences.kt b/libraries/stdlib/src/generated/_Sequences.kt index e965417a029..6cf3805d417 100644 --- a/libraries/stdlib/src/generated/_Sequences.kt +++ b/libraries/stdlib/src/generated/_Sequences.kt @@ -456,7 +456,9 @@ public fun Sequence.sortedWith(comparator: Comparator): Sequence /** * Returns a [Map] containing key-value pairs provided by [transform] function * applied to elements of the given sequence. + * * If any of two pairs would have the same key the last one gets added to the map. + * * The returned map preserves the entry iteration order of the original sequence. */ public inline fun Sequence.associate(transform: (T) -> Pair): Map { @@ -466,7 +468,9 @@ public inline fun Sequence.associate(transform: (T) -> Pair): /** * Returns a [Map] containing the elements from the given sequence indexed by the key * returned from [keySelector] function applied to each element. + * * If any two elements would have the same key returned by [keySelector] the last one gets added to the map. + * * The returned map preserves the entry iteration order of the original sequence. */ public inline fun Sequence.associateBy(keySelector: (T) -> K): Map { @@ -475,7 +479,9 @@ public inline fun Sequence.associateBy(keySelector: (T) -> K): Map Sequence.associateBy(keySelector: (T) -> K, valueTransform: (T) -> V): Map { @@ -486,6 +492,7 @@ public inline fun Sequence.associateBy(keySelector: (T) -> K, value * Populates and returns the [destination] mutable map with key-value pairs, * where key is provided by the [keySelector] function applied to each element of the given sequence * and value is the element itself. + * * If any two elements would have the same key returned by [keySelector] the last one gets added to the map. */ public inline fun > Sequence.associateByTo(destination: M, keySelector: (T) -> K): M { @@ -499,6 +506,7 @@ public inline fun > Sequence.associateByTo(d * Populates and returns the [destination] mutable map with key-value pairs, * where key is provided by the [keySelector] function and * and value is provided by the [valueTransform] function applied to elements of the given sequence. + * * If any two elements would have the same key returned by [keySelector] the last one gets added to the map. */ public inline fun > Sequence.associateByTo(destination: M, keySelector: (T) -> K, valueTransform: (T) -> V): M { @@ -511,6 +519,7 @@ public inline fun > Sequence.associateByT /** * Populates and returns the [destination] mutable map with key-value pairs * provided by [transform] function applied to each element of the given sequence. + * * If any of two pairs would have the same key the last one gets added to the map. */ public inline fun > Sequence.associateTo(destination: M, transform: (T) -> Pair): M { @@ -553,6 +562,7 @@ public fun Sequence.toMutableList(): MutableList { /** * Returns a [Set] of all elements. + * * The returned set preserves the element iteration order of the original sequence. */ public fun Sequence.toSet(): Set { @@ -569,6 +579,7 @@ public fun > Sequence.toSortedSet(): SortedSet { /** * Returns a [SortedSet] of all elements. + * * Elements in the set returned are sorted according to the given [comparator]. */ @kotlin.jvm.JvmVersion @@ -597,7 +608,9 @@ public inline fun > Sequence.flatMapTo(dest /** * Groups elements of the original sequence by the key returned by the given [keySelector] function * applied to each element and returns a map where each group key is associated with a list of corresponding elements. + * * The returned map preserves the entry iteration order of the keys produced from the original sequence. + * * @sample test.collections.CollectionTest.groupBy */ public inline fun Sequence.groupBy(keySelector: (T) -> K): Map> { @@ -608,7 +621,9 @@ public inline fun Sequence.groupBy(keySelector: (T) -> K): Map Sequence.groupBy(keySelector: (T) -> K, valueTransform: (T) -> V): Map> { @@ -618,7 +633,9 @@ public inline fun Sequence.groupBy(keySelector: (T) -> K, valueTran /** * Groups elements of the original sequence by the key returned by the given [keySelector] function * applied to each element and puts to the [destination] map each group key associated with a list of corresponding elements. + * * @return The [destination] map. + * * @sample test.collections.CollectionTest.groupBy */ public inline fun >> Sequence.groupByTo(destination: M, keySelector: (T) -> K): M { @@ -634,7 +651,9 @@ public inline fun >> Sequence.group * Groups values returned by the [valueTransform] function applied to each element of the original sequence * by the key returned by the given [keySelector] function applied to the element * and puts to the [destination] map each group key associated with a list of corresponding values. + * * @return The [destination] map. + * * @sample test.collections.CollectionTest.groupByKeysAndValues */ public inline fun >> Sequence.groupByTo(destination: M, keySelector: (T) -> K, valueTransform: (T) -> V): M { @@ -734,6 +753,7 @@ public fun Sequence.withIndex(): Sequence> { /** * Returns a sequence containing only distinct elements from the given sequence. + * * The elements in the resulting sequence are in the same order as they were in the source sequence. */ public fun Sequence.distinct(): Sequence { @@ -743,6 +763,7 @@ public fun Sequence.distinct(): Sequence { /** * Returns a sequence containing only elements from the given sequence * having distinct keys returned by the given [selector] function. + * * The elements in the resulting sequence are in the same order as they were in the source sequence. */ public fun Sequence.distinctBy(selector: (T) -> K): Sequence { @@ -751,6 +772,7 @@ public fun Sequence.distinctBy(selector: (T) -> K): Sequence { /** * Returns a mutable set containing all distinct elements from the given sequence. + * * The returned set preserves the element iteration order of the original sequence. */ public fun Sequence.toMutableSet(): MutableSet { @@ -1023,6 +1045,7 @@ public operator fun Sequence.minus(element: T): Sequence { /** * Returns a sequence containing all elements of original sequence except the elements contained in the given [elements] array. + * * Note that the source sequence and the array being subtracted are iterated only when an `iterator` is requested from * the resulting sequence. Changing any of them between successive calls to `iterator` may affect the result. */ @@ -1038,6 +1061,7 @@ public operator fun Sequence.minus(elements: Array): Sequence { /** * Returns a sequence containing all elements of original sequence except the elements contained in the given [elements] collection. + * * Note that the source sequence and the collection being subtracted are iterated only when an `iterator` is requested from * the resulting sequence. Changing any of them between successive calls to `iterator` may affect the result. */ @@ -1055,6 +1079,7 @@ public operator fun Sequence.minus(elements: Iterable): Sequence { /** * Returns a sequence containing all elements of original sequence except the elements contained in the given [elements] sequence. + * * Note that the source sequence and the sequence being subtracted are iterated only when an `iterator` is requested from * the resulting sequence. Changing any of them between successive calls to `iterator` may affect the result. */ @@ -1105,6 +1130,7 @@ public operator fun Sequence.plus(element: T): Sequence { /** * Returns a sequence containing all elements of original sequence and then all elements of the given [elements] array. + * * Note that the source sequence and the array being added are iterated only when an `iterator` is requested from * the resulting sequence. Changing any of them between successive calls to `iterator` may affect the result. */ @@ -1114,6 +1140,7 @@ public operator fun Sequence.plus(elements: Array): Sequence { /** * Returns a sequence containing all elements of original sequence and then all elements of the given [elements] collection. + * * Note that the source sequence and the collection being added are iterated only when an `iterator` is requested from * the resulting sequence. Changing any of them between successive calls to `iterator` may affect the result. */ @@ -1123,6 +1150,7 @@ public operator fun Sequence.plus(elements: Iterable): Sequence { /** * Returns a sequence containing all elements of original sequence and then all elements of the given [elements] sequence. + * * Note that the source sequence and the sequence being added are iterated only when an `iterator` is requested from * the resulting sequence. Changing any of them between successive calls to `iterator` may affect the result. */ @@ -1155,6 +1183,7 @@ public fun Sequence.zip(other: Sequence, transform: (T, R) -> V) /** * Appends the string from all the elements separated using [separator] and using the given [prefix] and [postfix] if supplied. + * * If the collection could be huge, you can specify a non-negative value of [limit], in which case only the first [limit] * elements will be appended, followed by the [truncated] string (which defaults to "..."). */ @@ -1177,6 +1206,7 @@ public fun Sequence.joinTo(buffer: A, separator: CharSequ /** * Creates a string from all the elements separated using [separator] and using the given [prefix] and [postfix] if supplied. + * * If the collection could be huge, you can specify a non-negative value of [limit], in which case only the first [limit] * elements will be appended, followed by the [truncated] string (which defaults to "..."). */ diff --git a/libraries/stdlib/src/generated/_Sets.kt b/libraries/stdlib/src/generated/_Sets.kt index 6bc045cc83e..9f06995e17e 100644 --- a/libraries/stdlib/src/generated/_Sets.kt +++ b/libraries/stdlib/src/generated/_Sets.kt @@ -15,6 +15,7 @@ import java.util.Collections // TODO: it's temporary while we have java.util.Col /** * Returns a set containing all elements of the original set except the given [element]. + * * The returned set preserves the element iteration order of the original set. */ public operator fun Set.minus(element: T): Set { @@ -25,6 +26,7 @@ public operator fun Set.minus(element: T): Set { /** * Returns a set containing all elements of the original set except the elements contained in the given [elements] array. + * * The returned set preserves the element iteration order of the original set. */ public operator fun Set.minus(elements: Array): Set { @@ -35,6 +37,7 @@ public operator fun Set.minus(elements: Array): Set { /** * Returns a set containing all elements of the original set except the elements contained in the given [elements] collection. + * * The returned set preserves the element iteration order of the original set. */ public operator fun Set.minus(elements: Iterable): Set { @@ -50,6 +53,7 @@ public operator fun Set.minus(elements: Iterable): Set { /** * Returns a set containing all elements of the original set except the elements contained in the given [elements] sequence. + * * The returned set preserves the element iteration order of the original set. */ public operator fun Set.minus(elements: Sequence): Set { @@ -60,6 +64,7 @@ public operator fun Set.minus(elements: Sequence): Set { /** * Returns a set containing all elements of the original set except the given [element]. + * * The returned set preserves the element iteration order of the original set. */ @kotlin.internal.InlineOnly @@ -69,6 +74,7 @@ public inline fun Set.minusElement(element: T): Set { /** * Returns a set containing all elements of the original set and then the given [element] if it isn't already in this set. + * * The returned set preserves the element iteration order of the original set. */ public operator fun Set.plus(element: T): Set { @@ -81,6 +87,7 @@ public operator fun Set.plus(element: T): Set { /** * Returns a set containing all elements of the original set and the given [elements] array, * which aren't already in this set. + * * The returned set preserves the element iteration order of the original set. */ public operator fun Set.plus(elements: Array): Set { @@ -105,6 +112,7 @@ public operator fun Set.plus(elements: Iterable): Set { /** * Returns a set containing all elements of the original set and the given [elements] sequence, * which aren't already in this set. + * * The returned set preserves the element iteration order of the original set. */ public operator fun Set.plus(elements: Sequence): Set { @@ -116,6 +124,7 @@ public operator fun Set.plus(elements: Sequence): Set { /** * Returns a set containing all elements of the original set and then the given [element] if it isn't already in this set. + * * The returned set preserves the element iteration order of the original set. */ @kotlin.internal.InlineOnly diff --git a/libraries/stdlib/src/generated/_Strings.kt b/libraries/stdlib/src/generated/_Strings.kt index a473e5ebe2a..f71bced02e4 100644 --- a/libraries/stdlib/src/generated/_Strings.kt +++ b/libraries/stdlib/src/generated/_Strings.kt @@ -502,7 +502,9 @@ public inline fun String.reversed(): String { /** * Returns a [Map] containing key-value pairs provided by [transform] function * applied to characters of the given char sequence. + * * If any of two pairs would have the same key the last one gets added to the map. + * * The returned map preserves the entry iteration order of the original char sequence. */ public inline fun CharSequence.associate(transform: (Char) -> Pair): Map { @@ -514,7 +516,9 @@ public inline fun CharSequence.associate(transform: (Char) -> Pair) /** * Returns a [Map] containing the characters from the given char sequence indexed by the key * returned from [keySelector] function applied to each character. + * * If any two characters would have the same key returned by [keySelector] the last one gets added to the map. + * * The returned map preserves the entry iteration order of the original char sequence. */ public inline fun CharSequence.associateBy(keySelector: (Char) -> K): Map { @@ -525,7 +529,9 @@ public inline fun CharSequence.associateBy(keySelector: (Char) -> K): Map CharSequence.associateBy(keySelector: (Char) -> K, valueTransform: (Char) -> V): Map { @@ -538,6 +544,7 @@ public inline fun CharSequence.associateBy(keySelector: (Char) -> K, valu * Populates and returns the [destination] mutable map with key-value pairs, * where key is provided by the [keySelector] function applied to each character of the given char sequence * and value is the character itself. + * * If any two characters would have the same key returned by [keySelector] the last one gets added to the map. */ public inline fun > CharSequence.associateByTo(destination: M, keySelector: (Char) -> K): M { @@ -551,6 +558,7 @@ public inline fun > CharSequence.associateByTo( * Populates and returns the [destination] mutable map with key-value pairs, * where key is provided by the [keySelector] function and * and value is provided by the [valueTransform] function applied to characters of the given char sequence. + * * If any two characters would have the same key returned by [keySelector] the last one gets added to the map. */ public inline fun > CharSequence.associateByTo(destination: M, keySelector: (Char) -> K, valueTransform: (Char) -> V): M { @@ -563,6 +571,7 @@ public inline fun > CharSequence.associateByTo( /** * Populates and returns the [destination] mutable map with key-value pairs * provided by [transform] function applied to each character of the given char sequence. + * * If any of two pairs would have the same key the last one gets added to the map. */ public inline fun > CharSequence.associateTo(destination: M, transform: (Char) -> Pair): M { @@ -609,6 +618,7 @@ public fun CharSequence.toMutableList(): MutableList { /** * Returns a [Set] of all characters. + * * The returned set preserves the element iteration order of the original char sequence. */ public fun CharSequence.toSet(): Set { @@ -648,7 +658,9 @@ public inline fun > CharSequence.flatMapTo(destin /** * Groups characters of the original char sequence by the key returned by the given [keySelector] function * applied to each character and returns a map where each group key is associated with a list of corresponding characters. + * * The returned map preserves the entry iteration order of the keys produced from the original char sequence. + * * @sample test.collections.CollectionTest.groupBy */ public inline fun CharSequence.groupBy(keySelector: (Char) -> K): Map> { @@ -659,7 +671,9 @@ public inline fun CharSequence.groupBy(keySelector: (Char) -> K): Map CharSequence.groupBy(keySelector: (Char) -> K, valueTransform: (Char) -> V): Map> { @@ -669,7 +683,9 @@ public inline fun CharSequence.groupBy(keySelector: (Char) -> K, valueTra /** * Groups characters of the original char sequence by the key returned by the given [keySelector] function * applied to each character and puts to the [destination] map each group key associated with a list of corresponding characters. + * * @return The [destination] map. + * * @sample test.collections.CollectionTest.groupBy */ public inline fun >> CharSequence.groupByTo(destination: M, keySelector: (Char) -> K): M { @@ -685,7 +701,9 @@ public inline fun >> CharSequence.grou * Groups values returned by the [valueTransform] function applied to each character of the original char sequence * by the key returned by the given [keySelector] function applied to the character * and puts to the [destination] map each group key associated with a list of corresponding values. + * * @return The [destination] map. + * * @sample test.collections.CollectionTest.groupByKeysAndValues */ public inline fun >> CharSequence.groupByTo(destination: M, keySelector: (Char) -> K, valueTransform: (Char) -> V): M { diff --git a/libraries/tools/kotlin-stdlib-gen/src/templates/Generators.kt b/libraries/tools/kotlin-stdlib-gen/src/templates/Generators.kt index f4616d96dfc..7335327f911 100644 --- a/libraries/tools/kotlin-stdlib-gen/src/templates/Generators.kt +++ b/libraries/tools/kotlin-stdlib-gen/src/templates/Generators.kt @@ -13,6 +13,7 @@ fun generators(): List { doc(Sets) { """ Returns a set containing all elements of the original set and then the given [element] if it isn't already in this set. + The returned set preserves the element iteration order of the original set. """ } @@ -53,6 +54,7 @@ fun generators(): List { doc(Sets) { """ Returns a set containing all elements of the original set and then the given [element] if it isn't already in this set. + The returned set preserves the element iteration order of the original set. """ } @@ -164,6 +166,7 @@ fun generators(): List { """ Returns a set containing all elements of the original set and the given [elements] array, which aren't already in this set. + The returned set preserves the element iteration order of the original set. """ } @@ -220,6 +223,7 @@ fun generators(): List { """ Returns a set containing all elements of the original set and the given [elements] sequence, which aren't already in this set. + The returned set preserves the element iteration order of the original set. """ } @@ -255,6 +259,7 @@ fun generators(): List { doc(Sets) { """ Returns a set containing all elements of the original set except the given [element]. + The returned set preserves the element iteration order of the original set. """ } @@ -283,6 +288,7 @@ fun generators(): List { doc(Sets) { """ Returns a set containing all elements of the original set except the given [element]. + The returned set preserves the element iteration order of the original set. """ } @@ -329,6 +335,7 @@ fun generators(): List { doc(Sets) { """ Returns a set containing all elements of the original set except the elements contained in the given [elements] collection. + The returned set preserves the element iteration order of the original set. """ } @@ -386,6 +393,7 @@ fun generators(): List { doc(Sets) { """ Returns a set containing all elements of the original set except the elements contained in the given [elements] array. + The returned set preserves the element iteration order of the original set. """ } @@ -437,6 +445,7 @@ fun generators(): List { doc(Sets) { """ Returns a set containing all elements of the original set except the elements contained in the given [elements] sequence. + The returned set preserves the element iteration order of the original set. """ } diff --git a/libraries/tools/kotlin-stdlib-gen/src/templates/Mapping.kt b/libraries/tools/kotlin-stdlib-gen/src/templates/Mapping.kt index 900acb4ff77..e57df6da730 100644 --- a/libraries/tools/kotlin-stdlib-gen/src/templates/Mapping.kt +++ b/libraries/tools/kotlin-stdlib-gen/src/templates/Mapping.kt @@ -294,7 +294,9 @@ fun mapping(): List { """ Groups ${f.element.pluralize()} of the original ${f.collection} by the key returned by the given [keySelector] function applied to each ${f.element} and returns a map where each group key is associated with a list of corresponding ${f.element.pluralize()}. + The returned map preserves the entry iteration order of the keys produced from the original ${f.collection}. + @sample test.collections.CollectionTest.groupBy """ } @@ -315,6 +317,7 @@ fun mapping(): List { applied to each ${f.element} and puts to the [destination] map each group key associated with a list of corresponding ${f.element.pluralize()}. @return The [destination] map. + @sample test.collections.CollectionTest.groupBy """ } @@ -340,7 +343,9 @@ fun mapping(): List { Groups values returned by the [valueTransform] function applied to each ${f.element} of the original ${f.collection} by the key returned by the given [keySelector] function applied to the ${f.element} and returns a map where each group key is associated with a list of corresponding values. + The returned map preserves the entry iteration order of the keys produced from the original ${f.collection}. + @sample test.collections.CollectionTest.groupByKeysAndValues """ } @@ -364,7 +369,9 @@ fun mapping(): List { Groups values returned by the [valueTransform] function applied to each ${f.element} of the original ${f.collection} by the key returned by the given [keySelector] function applied to the ${f.element} and puts to the [destination] map each group key associated with a list of corresponding values. + @return The [destination] map. + @sample test.collections.CollectionTest.groupByKeysAndValues """ } diff --git a/libraries/tools/kotlin-stdlib-gen/src/templates/Ranges.kt b/libraries/tools/kotlin-stdlib-gen/src/templates/Ranges.kt index ee21be0e993..a6757d50d16 100644 --- a/libraries/tools/kotlin-stdlib-gen/src/templates/Ranges.kt +++ b/libraries/tools/kotlin-stdlib-gen/src/templates/Ranges.kt @@ -50,6 +50,7 @@ fun ranges(): List { doc { """ Returns a progression from this value down to the specified [to] value with the step -1. + The [to] value has to be less than this value. """ } @@ -86,6 +87,7 @@ fun ranges(): List { doc { """ Returns a range from this value up to but excluding the specified [to] value. + ${ if (elementType == toType) "The [to] value must be greater than [$elementType.MIN_VALUE]." else "" } """ } diff --git a/libraries/tools/kotlin-stdlib-gen/src/templates/Sets.kt b/libraries/tools/kotlin-stdlib-gen/src/templates/Sets.kt index ebbf49c5410..83818824a5e 100644 --- a/libraries/tools/kotlin-stdlib-gen/src/templates/Sets.kt +++ b/libraries/tools/kotlin-stdlib-gen/src/templates/Sets.kt @@ -10,6 +10,7 @@ fun sets(): List { doc { f -> """ Returns a mutable set containing all distinct ${f.element.pluralize()} from the given ${f.collection}. + The returned set preserves the element iteration order of the original ${f.collection}. """ } @@ -97,6 +98,7 @@ fun sets(): List { doc { f -> """ Returns a set containing all distinct elements from both collections. + The returned set preserves the element iteration order of the original ${f.collection}. Those elements of the [other] collection that are unique are iterated in the end in the order of the [other] collection. @@ -118,6 +120,7 @@ fun sets(): List { doc { f -> """ Returns a set containing all elements that are contained by both this set and the specified collection. + The returned set preserves the element iteration order of the original ${f.collection}. """ } @@ -137,6 +140,7 @@ fun sets(): List { doc { f -> """ Returns a set containing all elements that are contained by this ${f.collection} and not contained by the specified collection. + The returned set preserves the element iteration order of the original ${f.collection}. """ } diff --git a/libraries/tools/kotlin-stdlib-gen/src/templates/Snapshots.kt b/libraries/tools/kotlin-stdlib-gen/src/templates/Snapshots.kt index f7eb5fbf879..6377877b218 100644 --- a/libraries/tools/kotlin-stdlib-gen/src/templates/Snapshots.kt +++ b/libraries/tools/kotlin-stdlib-gen/src/templates/Snapshots.kt @@ -24,6 +24,7 @@ fun snapshots(): List { doc { f -> """ Returns a [Set] of all ${f.element.pluralize()}. + The returned set preserves the element iteration order of the original ${f.collection}. """ } @@ -172,7 +173,9 @@ fun snapshots(): List { """ Returns a [Map] containing key-value pairs provided by [transform] function applied to ${f.element.pluralize()} of the given ${f.collection}. + If any of two pairs would have the same key the last one gets added to the map. + The returned map preserves the entry iteration order of the original ${f.collection}. """ } @@ -215,6 +218,7 @@ fun snapshots(): List { """ Populates and returns the [destination] mutable map with key-value pairs provided by [transform] function applied to each ${f.element} of the given ${f.collection}. + If any of two pairs would have the same key the last one gets added to the map. """ } @@ -236,7 +240,9 @@ fun snapshots(): List { """ Returns a [Map] containing the ${f.element.pluralize()} from the given ${f.collection} indexed by the key returned from [keySelector] function applied to each ${f.element}. + If any two ${f.element.pluralize()} would have the same key returned by [keySelector] the last one gets added to the map. + The returned map preserves the entry iteration order of the original ${f.collection}. """ } @@ -286,6 +292,7 @@ fun snapshots(): List { Populates and returns the [destination] mutable map with key-value pairs, where key is provided by the [keySelector] function applied to each ${f.element} of the given ${f.collection} and value is the ${f.element} itself. + If any two ${f.element.pluralize()} would have the same key returned by [keySelector] the last one gets added to the map. """ } @@ -307,7 +314,9 @@ fun snapshots(): List { doc { f -> """ Returns a [Map] containing the values provided by [valueTransform] and indexed by [keySelector] functions applied to ${f.element.pluralize()} of the given ${f.collection}. + If any two ${f.element.pluralize()} would have the same key returned by [keySelector] the last one gets added to the map. + The returned map preserves the entry iteration order of the original ${f.collection}. """ } @@ -359,6 +368,7 @@ fun snapshots(): List { Populates and returns the [destination] mutable map with key-value pairs, where key is provided by the [keySelector] function and and value is provided by the [valueTransform] function applied to ${f.element.pluralize()} of the given ${f.collection}. + If any two ${f.element.pluralize()} would have the same key returned by [keySelector] the last one gets added to the map. """ } diff --git a/libraries/tools/kotlin-stdlib-gen/src/templates/engine/Engine.kt b/libraries/tools/kotlin-stdlib-gen/src/templates/engine/Engine.kt index bc1fb4c1172..194a1ba200a 100644 --- a/libraries/tools/kotlin-stdlib-gen/src/templates/engine/Engine.kt +++ b/libraries/tools/kotlin-stdlib-gen/src/templates/engine/Engine.kt @@ -371,11 +371,8 @@ class GenericFunction(val signature: String, val keyword: String = "fun") { doc[f]?.let { methodDoc -> builder.append("/**\n") - StringReader(methodDoc).forEachLine { - val line = it.trim() - if (!line.isEmpty()) { - builder.append(" * ").append(line).append("\n") - } + StringReader(methodDoc.trim()).forEachLine { line -> + builder.append(" * ").append(line.trim()).append("\n") } builder.append(" */\n") }