W3cubDocs

/Kotlin

minWith

Platform and version requirements: JVM (1.0), JS (1.0), Native (1.0)
fun <T> Array<out T>.minWith(
    comparator: Comparator<in T>
): T?
fun ByteArray.minWith(comparator: Comparator<in Byte>): Byte?
fun ShortArray.minWith(
    comparator: Comparator<in Short>
): Short?
fun IntArray.minWith(comparator: Comparator<in Int>): Int?
fun LongArray.minWith(comparator: Comparator<in Long>): Long?
fun FloatArray.minWith(
    comparator: Comparator<in Float>
): Float?
fun DoubleArray.minWith(
    comparator: Comparator<in Double>
): Double?
fun BooleanArray.minWith(
    comparator: Comparator<in Boolean>
): Boolean?
fun CharArray.minWith(comparator: Comparator<in Char>): Char?
fun <T> Iterable<T>.minWith(comparator: Comparator<in T>): T?
@ExperimentalUnsignedTypes fun UIntArray.minWith(
    comparator: Comparator<in UInt>
): UInt?
@ExperimentalUnsignedTypes fun ULongArray.minWith(
    comparator: Comparator<in ULong>
): ULong?
@ExperimentalUnsignedTypes fun UByteArray.minWith(
    comparator: Comparator<in UByte>
): UByte?
@ExperimentalUnsignedTypes fun UShortArray.minWith(
    comparator: Comparator<in UShort>
): UShort?

Returns the first element having the smallest value according to the provided comparator or null if there are no elements.

Platform and version requirements: JVM (1.0), JS (1.0), Native (1.0)
fun <K, V> Map<out K, V>.minWith(
    comparator: Comparator<in Entry<K, V>>
): Entry<K, V>?

Returns the first entry having the smallest value according to the provided comparator or null if there are no entries.

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