W3cubDocs

/Kotlin

minBy

inline fun <T, R : Comparable<R>> Array<out T>.minBy(
    selector: (T) -> R
): T?
inline fun <R : Comparable<R>> ByteArray.minBy(
    selector: (Byte) -> R
): Byte?
inline fun <R : Comparable<R>> ShortArray.minBy(
    selector: (Short) -> R
): Short?
inline fun <R : Comparable<R>> IntArray.minBy(
    selector: (Int) -> R
): Int?
inline fun <R : Comparable<R>> LongArray.minBy(
    selector: (Long) -> R
): Long?
inline fun <R : Comparable<R>> FloatArray.minBy(
    selector: (Float) -> R
): Float?
inline fun <R : Comparable<R>> DoubleArray.minBy(
    selector: (Double) -> R
): Double?
inline fun <R : Comparable<R>> BooleanArray.minBy(
    selector: (Boolean) -> R
): Boolean?
inline fun <R : Comparable<R>> CharArray.minBy(
    selector: (Char) -> R
): Char?
inline fun <T, R : Comparable<R>> Iterable<T>.minBy(
    selector: (T) -> R
): T?

Returns the first element yielding the smallest value of the given function or null if there are no elements.

inline fun <K, V, R : Comparable<R>> Map<out K, V>.minBy(
    selector: (Entry<K, V>) -> R
): Entry<K, V>?

Returns the first entry yielding the smallest value of the given function or null if there are no entries.

© 2010–2018 JetBrains s.r.o.
Licensed under the Apache License, Version 2.0.
https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/min-by.html