|
|
|
@@ -10960,6 +10960,8 @@ public fun CharArray.max(): Char? {
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Returns the first element yielding the largest value of the given function or `null` if there are no elements.
|
|
|
|
|
*
|
|
|
|
|
* @sample samples.collections.Collections.Aggregates.maxBy
|
|
|
|
|
*/
|
|
|
|
|
public inline fun <T, R : Comparable<R>> Array<out T>.maxBy(selector: (T) -> R): T? {
|
|
|
|
|
if (isEmpty()) return null
|
|
|
|
@@ -10978,6 +10980,8 @@ public inline fun <T, R : Comparable<R>> Array<out T>.maxBy(selector: (T) -> R):
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Returns the first element yielding the largest value of the given function or `null` if there are no elements.
|
|
|
|
|
*
|
|
|
|
|
* @sample samples.collections.Collections.Aggregates.maxBy
|
|
|
|
|
*/
|
|
|
|
|
public inline fun <R : Comparable<R>> ByteArray.maxBy(selector: (Byte) -> R): Byte? {
|
|
|
|
|
if (isEmpty()) return null
|
|
|
|
@@ -10996,6 +11000,8 @@ public inline fun <R : Comparable<R>> ByteArray.maxBy(selector: (Byte) -> R): By
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Returns the first element yielding the largest value of the given function or `null` if there are no elements.
|
|
|
|
|
*
|
|
|
|
|
* @sample samples.collections.Collections.Aggregates.maxBy
|
|
|
|
|
*/
|
|
|
|
|
public inline fun <R : Comparable<R>> ShortArray.maxBy(selector: (Short) -> R): Short? {
|
|
|
|
|
if (isEmpty()) return null
|
|
|
|
@@ -11014,6 +11020,8 @@ public inline fun <R : Comparable<R>> ShortArray.maxBy(selector: (Short) -> R):
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Returns the first element yielding the largest value of the given function or `null` if there are no elements.
|
|
|
|
|
*
|
|
|
|
|
* @sample samples.collections.Collections.Aggregates.maxBy
|
|
|
|
|
*/
|
|
|
|
|
public inline fun <R : Comparable<R>> IntArray.maxBy(selector: (Int) -> R): Int? {
|
|
|
|
|
if (isEmpty()) return null
|
|
|
|
@@ -11032,6 +11040,8 @@ public inline fun <R : Comparable<R>> IntArray.maxBy(selector: (Int) -> R): Int?
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Returns the first element yielding the largest value of the given function or `null` if there are no elements.
|
|
|
|
|
*
|
|
|
|
|
* @sample samples.collections.Collections.Aggregates.maxBy
|
|
|
|
|
*/
|
|
|
|
|
public inline fun <R : Comparable<R>> LongArray.maxBy(selector: (Long) -> R): Long? {
|
|
|
|
|
if (isEmpty()) return null
|
|
|
|
@@ -11050,6 +11060,8 @@ public inline fun <R : Comparable<R>> LongArray.maxBy(selector: (Long) -> R): Lo
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Returns the first element yielding the largest value of the given function or `null` if there are no elements.
|
|
|
|
|
*
|
|
|
|
|
* @sample samples.collections.Collections.Aggregates.maxBy
|
|
|
|
|
*/
|
|
|
|
|
public inline fun <R : Comparable<R>> FloatArray.maxBy(selector: (Float) -> R): Float? {
|
|
|
|
|
if (isEmpty()) return null
|
|
|
|
@@ -11068,6 +11080,8 @@ public inline fun <R : Comparable<R>> FloatArray.maxBy(selector: (Float) -> R):
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Returns the first element yielding the largest value of the given function or `null` if there are no elements.
|
|
|
|
|
*
|
|
|
|
|
* @sample samples.collections.Collections.Aggregates.maxBy
|
|
|
|
|
*/
|
|
|
|
|
public inline fun <R : Comparable<R>> DoubleArray.maxBy(selector: (Double) -> R): Double? {
|
|
|
|
|
if (isEmpty()) return null
|
|
|
|
@@ -11086,6 +11100,8 @@ public inline fun <R : Comparable<R>> DoubleArray.maxBy(selector: (Double) -> R)
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Returns the first element yielding the largest value of the given function or `null` if there are no elements.
|
|
|
|
|
*
|
|
|
|
|
* @sample samples.collections.Collections.Aggregates.maxBy
|
|
|
|
|
*/
|
|
|
|
|
public inline fun <R : Comparable<R>> BooleanArray.maxBy(selector: (Boolean) -> R): Boolean? {
|
|
|
|
|
if (isEmpty()) return null
|
|
|
|
@@ -11104,6 +11120,8 @@ public inline fun <R : Comparable<R>> BooleanArray.maxBy(selector: (Boolean) ->
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Returns the first element yielding the largest value of the given function or `null` if there are no elements.
|
|
|
|
|
*
|
|
|
|
|
* @sample samples.collections.Collections.Aggregates.maxBy
|
|
|
|
|
*/
|
|
|
|
|
public inline fun <R : Comparable<R>> CharArray.maxBy(selector: (Char) -> R): Char? {
|
|
|
|
|
if (isEmpty()) return null
|
|
|
|
@@ -11387,6 +11405,8 @@ public fun CharArray.min(): Char? {
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Returns the first element yielding the smallest value of the given function or `null` if there are no elements.
|
|
|
|
|
*
|
|
|
|
|
* @sample samples.collections.Collections.Aggregates.minBy
|
|
|
|
|
*/
|
|
|
|
|
public inline fun <T, R : Comparable<R>> Array<out T>.minBy(selector: (T) -> R): T? {
|
|
|
|
|
if (isEmpty()) return null
|
|
|
|
@@ -11405,6 +11425,8 @@ public inline fun <T, R : Comparable<R>> Array<out T>.minBy(selector: (T) -> R):
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Returns the first element yielding the smallest value of the given function or `null` if there are no elements.
|
|
|
|
|
*
|
|
|
|
|
* @sample samples.collections.Collections.Aggregates.minBy
|
|
|
|
|
*/
|
|
|
|
|
public inline fun <R : Comparable<R>> ByteArray.minBy(selector: (Byte) -> R): Byte? {
|
|
|
|
|
if (isEmpty()) return null
|
|
|
|
@@ -11423,6 +11445,8 @@ public inline fun <R : Comparable<R>> ByteArray.minBy(selector: (Byte) -> R): By
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Returns the first element yielding the smallest value of the given function or `null` if there are no elements.
|
|
|
|
|
*
|
|
|
|
|
* @sample samples.collections.Collections.Aggregates.minBy
|
|
|
|
|
*/
|
|
|
|
|
public inline fun <R : Comparable<R>> ShortArray.minBy(selector: (Short) -> R): Short? {
|
|
|
|
|
if (isEmpty()) return null
|
|
|
|
@@ -11441,6 +11465,8 @@ public inline fun <R : Comparable<R>> ShortArray.minBy(selector: (Short) -> R):
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Returns the first element yielding the smallest value of the given function or `null` if there are no elements.
|
|
|
|
|
*
|
|
|
|
|
* @sample samples.collections.Collections.Aggregates.minBy
|
|
|
|
|
*/
|
|
|
|
|
public inline fun <R : Comparable<R>> IntArray.minBy(selector: (Int) -> R): Int? {
|
|
|
|
|
if (isEmpty()) return null
|
|
|
|
@@ -11459,6 +11485,8 @@ public inline fun <R : Comparable<R>> IntArray.minBy(selector: (Int) -> R): Int?
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Returns the first element yielding the smallest value of the given function or `null` if there are no elements.
|
|
|
|
|
*
|
|
|
|
|
* @sample samples.collections.Collections.Aggregates.minBy
|
|
|
|
|
*/
|
|
|
|
|
public inline fun <R : Comparable<R>> LongArray.minBy(selector: (Long) -> R): Long? {
|
|
|
|
|
if (isEmpty()) return null
|
|
|
|
@@ -11477,6 +11505,8 @@ public inline fun <R : Comparable<R>> LongArray.minBy(selector: (Long) -> R): Lo
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Returns the first element yielding the smallest value of the given function or `null` if there are no elements.
|
|
|
|
|
*
|
|
|
|
|
* @sample samples.collections.Collections.Aggregates.minBy
|
|
|
|
|
*/
|
|
|
|
|
public inline fun <R : Comparable<R>> FloatArray.minBy(selector: (Float) -> R): Float? {
|
|
|
|
|
if (isEmpty()) return null
|
|
|
|
@@ -11495,6 +11525,8 @@ public inline fun <R : Comparable<R>> FloatArray.minBy(selector: (Float) -> R):
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Returns the first element yielding the smallest value of the given function or `null` if there are no elements.
|
|
|
|
|
*
|
|
|
|
|
* @sample samples.collections.Collections.Aggregates.minBy
|
|
|
|
|
*/
|
|
|
|
|
public inline fun <R : Comparable<R>> DoubleArray.minBy(selector: (Double) -> R): Double? {
|
|
|
|
|
if (isEmpty()) return null
|
|
|
|
@@ -11513,6 +11545,8 @@ public inline fun <R : Comparable<R>> DoubleArray.minBy(selector: (Double) -> R)
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Returns the first element yielding the smallest value of the given function or `null` if there are no elements.
|
|
|
|
|
*
|
|
|
|
|
* @sample samples.collections.Collections.Aggregates.minBy
|
|
|
|
|
*/
|
|
|
|
|
public inline fun <R : Comparable<R>> BooleanArray.minBy(selector: (Boolean) -> R): Boolean? {
|
|
|
|
|
if (isEmpty()) return null
|
|
|
|
@@ -11531,6 +11565,8 @@ public inline fun <R : Comparable<R>> BooleanArray.minBy(selector: (Boolean) ->
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Returns the first element yielding the smallest value of the given function or `null` if there are no elements.
|
|
|
|
|
*
|
|
|
|
|
* @sample samples.collections.Collections.Aggregates.minBy
|
|
|
|
|
*/
|
|
|
|
|
public inline fun <R : Comparable<R>> CharArray.minBy(selector: (Char) -> R): Char? {
|
|
|
|
|
if (isEmpty()) return null
|
|
|
|
|