W3cubDocs

/Kotlin

maxOf

Platform and version requirements: JVM (1.4), JS (1.4), Native (1.4)
inline fun <T> Array<out T>.maxOf(
    selector: (T) -> Double
): Double
inline fun ByteArray.maxOf(
    selector: (Byte) -> Double
): Double
inline fun ShortArray.maxOf(
    selector: (Short) -> Double
): Double
inline fun IntArray.maxOf(selector: (Int) -> Double): Double
inline fun LongArray.maxOf(
    selector: (Long) -> Double
): Double
inline fun FloatArray.maxOf(
    selector: (Float) -> Double
): Double
inline fun DoubleArray.maxOf(
    selector: (Double) -> Double
): Double
inline fun BooleanArray.maxOf(
    selector: (Boolean) -> Double
): Double
inline fun CharArray.maxOf(
    selector: (Char) -> Double
): Double
inline fun <T> Array<out T>.maxOf(
    selector: (T) -> Float
): Float
inline fun ByteArray.maxOf(selector: (Byte) -> Float): Float
inline fun ShortArray.maxOf(
    selector: (Short) -> Float
): Float
inline fun IntArray.maxOf(selector: (Int) -> Float): Float
inline fun LongArray.maxOf(selector: (Long) -> Float): Float
inline fun FloatArray.maxOf(
    selector: (Float) -> Float
): Float
inline fun DoubleArray.maxOf(
    selector: (Double) -> Float
): Float
inline fun BooleanArray.maxOf(
    selector: (Boolean) -> Float
): Float
inline fun CharArray.maxOf(selector: (Char) -> Float): Float
@ExperimentalUnsignedTypes inline fun UIntArray.maxOf(
    selector: (UInt) -> Double
): Double
@ExperimentalUnsignedTypes inline fun ULongArray.maxOf(
    selector: (ULong) -> Double
): Double
@ExperimentalUnsignedTypes inline fun UByteArray.maxOf(
    selector: (UByte) -> Double
): Double
@ExperimentalUnsignedTypes inline fun UShortArray.maxOf(
    selector: (UShort) -> Double
): Double
@ExperimentalUnsignedTypes inline fun UIntArray.maxOf(
    selector: (UInt) -> Float
): Float
@ExperimentalUnsignedTypes inline fun ULongArray.maxOf(
    selector: (ULong) -> Float
): Float
@ExperimentalUnsignedTypes inline fun UByteArray.maxOf(
    selector: (UByte) -> Float
): Float
@ExperimentalUnsignedTypes inline fun UShortArray.maxOf(
    selector: (UShort) -> Float
): Float

Returns the largest value among all values produced by selector function applied to each element in the array.

If any of values produced by selector function is NaN, the returned result is NaN.

Exceptions

NoSuchElementException - if the array is empty.

Platform and version requirements: JVM (1.4), JS (1.4), Native (1.4)
inline fun <T, R : Comparable<R>> Array<out T>.maxOf(
    selector: (T) -> R
): R
inline fun <R : Comparable<R>> ByteArray.maxOf(
    selector: (Byte) -> R
): R
inline fun <R : Comparable<R>> ShortArray.maxOf(
    selector: (Short) -> R
): R
inline fun <R : Comparable<R>> IntArray.maxOf(
    selector: (Int) -> R
): R
inline fun <R : Comparable<R>> LongArray.maxOf(
    selector: (Long) -> R
): R
inline fun <R : Comparable<R>> FloatArray.maxOf(
    selector: (Float) -> R
): R
inline fun <R : Comparable<R>> DoubleArray.maxOf(
    selector: (Double) -> R
): R
inline fun <R : Comparable<R>> BooleanArray.maxOf(
    selector: (Boolean) -> R
): R
inline fun <R : Comparable<R>> CharArray.maxOf(
    selector: (Char) -> R
): R
@ExperimentalUnsignedTypes inline fun <R : Comparable<R>> UIntArray.maxOf(
    selector: (UInt) -> R
): R
@ExperimentalUnsignedTypes inline fun <R : Comparable<R>> ULongArray.maxOf(
    selector: (ULong) -> R
): R
@ExperimentalUnsignedTypes inline fun <R : Comparable<R>> UByteArray.maxOf(
    selector: (UByte) -> R
): R
@ExperimentalUnsignedTypes inline fun <R : Comparable<R>> UShortArray.maxOf(
    selector: (UShort) -> R
): R

Returns the largest value among all values produced by selector function applied to each element in the array.

Exceptions

NoSuchElementException - if the array is empty.

Platform and version requirements: JVM (1.4), JS (1.4), Native (1.4)
inline fun <T> Iterable<T>.maxOf(
    selector: (T) -> Double
): Double
inline fun <T> Iterable<T>.maxOf(
    selector: (T) -> Float
): Float

Returns the largest value among all values produced by selector function applied to each element in the collection.

If any of values produced by selector function is NaN, the returned result is NaN.

Exceptions

NoSuchElementException - if the collection is empty.

Platform and version requirements: JVM (1.4), JS (1.4), Native (1.4)
inline fun <T, R : Comparable<R>> Iterable<T>.maxOf(
    selector: (T) -> R
): R

Returns the largest value among all values produced by selector function applied to each element in the collection.

Exceptions

NoSuchElementException - if the collection is empty.

Platform and version requirements: JVM (1.4), JS (1.4), Native (1.4)
inline fun <K, V> Map<out K, V>.maxOf(
    selector: (Entry<K, V>) -> Double
): Double
inline fun <K, V> Map<out K, V>.maxOf(
    selector: (Entry<K, V>) -> Float
): Float

Returns the largest value among all values produced by selector function applied to each entry in the map.

If any of values produced by selector function is NaN, the returned result is NaN.

Exceptions

NoSuchElementException - if the map is empty.

Platform and version requirements: JVM (1.4), JS (1.4), Native (1.4)
inline fun <K, V, R : Comparable<R>> Map<out K, V>.maxOf(
    selector: (Entry<K, V>) -> R
): R

Returns the largest value among all values produced by selector function applied to each entry in the map.

Exceptions

NoSuchElementException - if the map is empty.

© 2010–2020 JetBrains s.r.o. and Kotlin Programming Language contributors
Licensed under the Apache License, Version 2.0.
https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/max-of.html