maxWith

Common
JVM
JS
Native
1.7
@JvmName("maxWithOrThrow") fun <T> Array<out T>.maxWith(
    comparator: Comparator<in T>
): T

(source)
@JvmName("maxWithOrThrow") fun ByteArray.maxWith(
    comparator: Comparator<in Byte>
): Byte

(source)
@JvmName("maxWithOrThrow") fun ShortArray.maxWith(
    comparator: Comparator<in Short>
): Short

(source)
@JvmName("maxWithOrThrow") fun IntArray.maxWith(
    comparator: Comparator<in Int>
): Int

(source)
@JvmName("maxWithOrThrow") fun LongArray.maxWith(
    comparator: Comparator<in Long>
): Long

(source)
@JvmName("maxWithOrThrow") fun FloatArray.maxWith(
    comparator: Comparator<in Float>
): Float

(source)
@JvmName("maxWithOrThrow") fun DoubleArray.maxWith(
    comparator: Comparator<in Double>
): Double

(source)
@JvmName("maxWithOrThrow") fun BooleanArray.maxWith(
    comparator: Comparator<in Boolean>
): Boolean

(source)
@JvmName("maxWithOrThrow") fun CharArray.maxWith(
    comparator: Comparator<in Char>
): Char

(source)
@JvmName("maxWithOrThrow-U") @ExperimentalUnsignedTypes fun UIntArray.maxWith(
    comparator: Comparator<in UInt>
): UInt

(source)
@JvmName("maxWithOrThrow-U") @ExperimentalUnsignedTypes fun ULongArray.maxWith(
    comparator: Comparator<in ULong>
): ULong

(source)
@JvmName("maxWithOrThrow-U") @ExperimentalUnsignedTypes fun UByteArray.maxWith(
    comparator: Comparator<in UByte>
): UByte

(source)
@JvmName("maxWithOrThrow-U") @ExperimentalUnsignedTypes fun UShortArray.maxWith(
    comparator: Comparator<in UShort>
): UShort

(source)

Returns the first element having the largest value according to the provided comparator.

Exceptions

NoSuchElementException - if the array is empty.

Common
JVM
JS
Native
1.7
@JvmName("maxWithOrThrow") fun <T> Iterable<T>.maxWith(
    comparator: Comparator<in T>
): T

(source)

Returns the first element having the largest value according to the provided comparator.

Exceptions

NoSuchElementException - if the collection is empty.

Common
JVM
JS
Native
1.7
@JvmName("maxWithOrThrow") fun <K, V> Map<out K, V>.maxWith(
    comparator: Comparator<in Entry<K, V>>
): Entry<K, V>

(source)

Returns the first entry having the largest value according to the provided comparator.

Exceptions

NoSuchElementException - if the map is empty.

JVM
1.0
@DeprecatedSinceKotlin("1.4", "1.5", "1.6") fun <T> Array<out T>.maxWith(
    comparator: Comparator<in T>
): T?

(source)
Deprecated: Use maxWithOrNull instead.
@DeprecatedSinceKotlin("1.4", "1.5", "1.6") fun ByteArray.maxWith(
    comparator: Comparator<in Byte>
): Byte?

(source)
Deprecated: Use maxWithOrNull instead.
@DeprecatedSinceKotlin("1.4", "1.5", "1.6") fun ShortArray.maxWith(
    comparator: Comparator<in Short>
): Short?

(source)
Deprecated: Use maxWithOrNull instead.
@DeprecatedSinceKotlin("1.4", "1.5", "1.6") fun IntArray.maxWith(
    comparator: Comparator<in Int>
): Int?

(source)
Deprecated: Use maxWithOrNull instead.
@DeprecatedSinceKotlin("1.4", "1.5", "1.6") fun LongArray.maxWith(
    comparator: Comparator<in Long>
): Long?

(source)
Deprecated: Use maxWithOrNull instead.
@DeprecatedSinceKotlin("1.4", "1.5", "1.6") fun FloatArray.maxWith(
    comparator: Comparator<in Float>
): Float?

(source)
Deprecated: Use maxWithOrNull instead.
@DeprecatedSinceKotlin("1.4", "1.5", "1.6") fun DoubleArray.maxWith(
    comparator: Comparator<in Double>
): Double?

(source)
Deprecated: Use maxWithOrNull instead.
@DeprecatedSinceKotlin("1.4", "1.5", "1.6") fun BooleanArray.maxWith(
    comparator: Comparator<in Boolean>
): Boolean?

(source)
Deprecated: Use maxWithOrNull instead.
@DeprecatedSinceKotlin("1.4", "1.5", "1.6") fun CharArray.maxWith(
    comparator: Comparator<in Char>
): Char?

(source)
Deprecated: Use maxWithOrNull instead.
@DeprecatedSinceKotlin("1.4", "1.5", "1.6") fun <T> Iterable<T>.maxWith(
    comparator: Comparator<in T>
): T?

(source)
Deprecated: Use maxWithOrNull instead.
@DeprecatedSinceKotlin("1.4", "1.5", "1.6") fun <K, V> Map<out K, V>.maxWith(
    comparator: Comparator<in Entry<K, V>>
): Entry<K, V>?

(source)
Deprecated: Use maxWithOrNull instead.
@DeprecatedSinceKotlin("1.4", "1.5", "1.6") @ExperimentalUnsignedTypes fun UIntArray.maxWith(
    comparator: Comparator<in UInt>
): UInt?

(source)
Deprecated: Use maxWithOrNull instead.
@DeprecatedSinceKotlin("1.4", "1.5", "1.6") @ExperimentalUnsignedTypes fun ULongArray.maxWith(
    comparator: Comparator<in ULong>
): ULong?

(source)
Deprecated: Use maxWithOrNull instead.
@DeprecatedSinceKotlin("1.4", "1.5", "1.6") @ExperimentalUnsignedTypes fun UByteArray.maxWith(
    comparator: Comparator<in UByte>
): UByte?

(source)
Deprecated: Use maxWithOrNull instead.
@DeprecatedSinceKotlin("1.4", "1.5", "1.6") @ExperimentalUnsignedTypes fun UShortArray.maxWith(
    comparator: Comparator<in UShort>
): UShort?

(source)
Deprecated: Use maxWithOrNull instead.