W3cubDocs

/Kotlin

sumOf

Platform and version requirements: JVM (1.4), JS (1.4), Native (1.4)
@JvmName("sumOfDouble") inline fun <T> Array<out T>.sumOf(
    selector: (T) -> Double
): Double
Platform and version requirements: JVM (1.4), JS (1.4), Native (1.4)
@JvmName("sumOfDouble") inline fun ByteArray.sumOf(
    selector: (Byte) -> Double
): Double
Platform and version requirements: JVM (1.4), JS (1.4), Native (1.4)
@JvmName("sumOfDouble") inline fun ShortArray.sumOf(
    selector: (Short) -> Double
): Double
Platform and version requirements: JVM (1.4), JS (1.4), Native (1.4)
@JvmName("sumOfDouble") inline fun IntArray.sumOf(
    selector: (Int) -> Double
): Double
Platform and version requirements: JVM (1.4), JS (1.4), Native (1.4)
@JvmName("sumOfDouble") inline fun LongArray.sumOf(
    selector: (Long) -> Double
): Double
Platform and version requirements: JVM (1.4), JS (1.4), Native (1.4)
@JvmName("sumOfDouble") inline fun FloatArray.sumOf(
    selector: (Float) -> Double
): Double
Platform and version requirements: JVM (1.4), JS (1.4), Native (1.4)
@JvmName("sumOfDouble") inline fun DoubleArray.sumOf(
    selector: (Double) -> Double
): Double
Platform and version requirements: JVM (1.4), JS (1.4), Native (1.4)
@JvmName("sumOfDouble") inline fun BooleanArray.sumOf(
    selector: (Boolean) -> Double
): Double
Platform and version requirements: JVM (1.4), JS (1.4), Native (1.4)
@JvmName("sumOfDouble") inline fun CharArray.sumOf(
    selector: (Char) -> Double
): Double
Platform and version requirements: JVM (1.4), JS (1.4), Native (1.4)
@JvmName("sumOfInt") inline fun <T> Array<out T>.sumOf(
    selector: (T) -> Int
): Int
Platform and version requirements: JVM (1.4), JS (1.4), Native (1.4)
@JvmName("sumOfInt") inline fun ByteArray.sumOf(
    selector: (Byte) -> Int
): Int
Platform and version requirements: JVM (1.4), JS (1.4), Native (1.4)
@JvmName("sumOfInt") inline fun ShortArray.sumOf(
    selector: (Short) -> Int
): Int
Platform and version requirements: JVM (1.4), JS (1.4), Native (1.4)
@JvmName("sumOfInt") inline fun IntArray.sumOf(
    selector: (Int) -> Int
): Int
Platform and version requirements: JVM (1.4), JS (1.4), Native (1.4)
@JvmName("sumOfInt") inline fun LongArray.sumOf(
    selector: (Long) -> Int
): Int
Platform and version requirements: JVM (1.4), JS (1.4), Native (1.4)
@JvmName("sumOfInt") inline fun FloatArray.sumOf(
    selector: (Float) -> Int
): Int
Platform and version requirements: JVM (1.4), JS (1.4), Native (1.4)
@JvmName("sumOfInt") inline fun DoubleArray.sumOf(
    selector: (Double) -> Int
): Int
Platform and version requirements: JVM (1.4), JS (1.4), Native (1.4)
@JvmName("sumOfInt") inline fun BooleanArray.sumOf(
    selector: (Boolean) -> Int
): Int
Platform and version requirements: JVM (1.4), JS (1.4), Native (1.4)
@JvmName("sumOfInt") inline fun CharArray.sumOf(
    selector: (Char) -> Int
): Int
Platform and version requirements: JVM (1.4), JS (1.4), Native (1.4)
@JvmName("sumOfLong") inline fun <T> Array<out T>.sumOf(
    selector: (T) -> Long
): Long
Platform and version requirements: JVM (1.4), JS (1.4), Native (1.4)
@JvmName("sumOfLong") inline fun ByteArray.sumOf(
    selector: (Byte) -> Long
): Long
Platform and version requirements: JVM (1.4), JS (1.4), Native (1.4)
@JvmName("sumOfLong") inline fun ShortArray.sumOf(
    selector: (Short) -> Long
): Long
Platform and version requirements: JVM (1.4), JS (1.4), Native (1.4)
@JvmName("sumOfLong") inline fun IntArray.sumOf(
    selector: (Int) -> Long
): Long
Platform and version requirements: JVM (1.4), JS (1.4), Native (1.4)
@JvmName("sumOfLong") inline fun LongArray.sumOf(
    selector: (Long) -> Long
): Long
Platform and version requirements: JVM (1.4), JS (1.4), Native (1.4)
@JvmName("sumOfLong") inline fun FloatArray.sumOf(
    selector: (Float) -> Long
): Long
Platform and version requirements: JVM (1.4), JS (1.4), Native (1.4)
@JvmName("sumOfLong") inline fun DoubleArray.sumOf(
    selector: (Double) -> Long
): Long
Platform and version requirements: JVM (1.4), JS (1.4), Native (1.4)
@JvmName("sumOfLong") inline fun BooleanArray.sumOf(
    selector: (Boolean) -> Long
): Long
Platform and version requirements: JVM (1.4), JS (1.4), Native (1.4)
@JvmName("sumOfLong") inline fun CharArray.sumOf(
    selector: (Char) -> Long
): Long
Platform and version requirements: JVM (1.4), JS (1.4), Native (1.4)
@JvmName("sumOfUInt") @ExperimentalUnsignedTypes inline fun <T> Array<out T>.sumOf(
    selector: (T) -> UInt
): UInt
Platform and version requirements: JVM (1.4), JS (1.4), Native (1.4)
@JvmName("sumOfUInt") @ExperimentalUnsignedTypes inline fun ByteArray.sumOf(
    selector: (Byte) -> UInt
): UInt
Platform and version requirements: JVM (1.4), JS (1.4), Native (1.4)
@JvmName("sumOfUInt") @ExperimentalUnsignedTypes inline fun ShortArray.sumOf(
    selector: (Short) -> UInt
): UInt
Platform and version requirements: JVM (1.4), JS (1.4), Native (1.4)
@JvmName("sumOfUInt") @ExperimentalUnsignedTypes inline fun IntArray.sumOf(
    selector: (Int) -> UInt
): UInt
Platform and version requirements: JVM (1.4), JS (1.4), Native (1.4)
@JvmName("sumOfUInt") @ExperimentalUnsignedTypes inline fun LongArray.sumOf(
    selector: (Long) -> UInt
): UInt
Platform and version requirements: JVM (1.4), JS (1.4), Native (1.4)
@JvmName("sumOfUInt") @ExperimentalUnsignedTypes inline fun FloatArray.sumOf(
    selector: (Float) -> UInt
): UInt
Platform and version requirements: JVM (1.4), JS (1.4), Native (1.4)
@JvmName("sumOfUInt") @ExperimentalUnsignedTypes inline fun DoubleArray.sumOf(
    selector: (Double) -> UInt
): UInt
Platform and version requirements: JVM (1.4), JS (1.4), Native (1.4)
@JvmName("sumOfUInt") @ExperimentalUnsignedTypes inline fun BooleanArray.sumOf(
    selector: (Boolean) -> UInt
): UInt
Platform and version requirements: JVM (1.4), JS (1.4), Native (1.4)
@JvmName("sumOfUInt") @ExperimentalUnsignedTypes inline fun CharArray.sumOf(
    selector: (Char) -> UInt
): UInt
Platform and version requirements: JVM (1.4), JS (1.4), Native (1.4)
@JvmName("sumOfULong") @ExperimentalUnsignedTypes inline fun <T> Array<out T>.sumOf(
    selector: (T) -> ULong
): ULong
Platform and version requirements: JVM (1.4), JS (1.4), Native (1.4)
@JvmName("sumOfULong") @ExperimentalUnsignedTypes inline fun ByteArray.sumOf(
    selector: (Byte) -> ULong
): ULong
Platform and version requirements: JVM (1.4), JS (1.4), Native (1.4)
@JvmName("sumOfULong") @ExperimentalUnsignedTypes inline fun ShortArray.sumOf(
    selector: (Short) -> ULong
): ULong
Platform and version requirements: JVM (1.4), JS (1.4), Native (1.4)
@JvmName("sumOfULong") @ExperimentalUnsignedTypes inline fun IntArray.sumOf(
    selector: (Int) -> ULong
): ULong
Platform and version requirements: JVM (1.4), JS (1.4), Native (1.4)
@JvmName("sumOfULong") @ExperimentalUnsignedTypes inline fun LongArray.sumOf(
    selector: (Long) -> ULong
): ULong
Platform and version requirements: JVM (1.4), JS (1.4), Native (1.4)
@JvmName("sumOfULong") @ExperimentalUnsignedTypes inline fun FloatArray.sumOf(
    selector: (Float) -> ULong
): ULong
Platform and version requirements: JVM (1.4), JS (1.4), Native (1.4)
@JvmName("sumOfULong") @ExperimentalUnsignedTypes inline fun DoubleArray.sumOf(
    selector: (Double) -> ULong
): ULong
Platform and version requirements: JVM (1.4), JS (1.4), Native (1.4)
@JvmName("sumOfULong") @ExperimentalUnsignedTypes inline fun BooleanArray.sumOf(
    selector: (Boolean) -> ULong
): ULong
Platform and version requirements: JVM (1.4), JS (1.4), Native (1.4)
@JvmName("sumOfULong") @ExperimentalUnsignedTypes inline fun CharArray.sumOf(
    selector: (Char) -> ULong
): ULong
Platform and version requirements: JVM (1.4), JS (1.4), Native (1.4)
@JvmName("sumOfDouble") @ExperimentalUnsignedTypes inline fun UIntArray.sumOf(
    selector: (UInt) -> Double
): Double
Platform and version requirements: JVM (1.4), JS (1.4), Native (1.4)
@JvmName("sumOfDouble") @ExperimentalUnsignedTypes inline fun ULongArray.sumOf(
    selector: (ULong) -> Double
): Double
Platform and version requirements: JVM (1.4), JS (1.4), Native (1.4)
@JvmName("sumOfDouble") @ExperimentalUnsignedTypes inline fun UByteArray.sumOf(
    selector: (UByte) -> Double
): Double
Platform and version requirements: JVM (1.4), JS (1.4), Native (1.4)
@JvmName("sumOfDouble") @ExperimentalUnsignedTypes inline fun UShortArray.sumOf(
    selector: (UShort) -> Double
): Double
Platform and version requirements: JVM (1.4), JS (1.4), Native (1.4)
@JvmName("sumOfInt") @ExperimentalUnsignedTypes inline fun UIntArray.sumOf(
    selector: (UInt) -> Int
): Int
Platform and version requirements: JVM (1.4), JS (1.4), Native (1.4)
@JvmName("sumOfInt") @ExperimentalUnsignedTypes inline fun ULongArray.sumOf(
    selector: (ULong) -> Int
): Int
Platform and version requirements: JVM (1.4), JS (1.4), Native (1.4)
@JvmName("sumOfInt") @ExperimentalUnsignedTypes inline fun UByteArray.sumOf(
    selector: (UByte) -> Int
): Int
Platform and version requirements: JVM (1.4), JS (1.4), Native (1.4)
@JvmName("sumOfInt") @ExperimentalUnsignedTypes inline fun UShortArray.sumOf(
    selector: (UShort) -> Int
): Int
Platform and version requirements: JVM (1.4), JS (1.4), Native (1.4)
@JvmName("sumOfLong") @ExperimentalUnsignedTypes inline fun UIntArray.sumOf(
    selector: (UInt) -> Long
): Long
Platform and version requirements: JVM (1.4), JS (1.4), Native (1.4)
@JvmName("sumOfLong") @ExperimentalUnsignedTypes inline fun ULongArray.sumOf(
    selector: (ULong) -> Long
): Long
Platform and version requirements: JVM (1.4), JS (1.4), Native (1.4)
@JvmName("sumOfLong") @ExperimentalUnsignedTypes inline fun UByteArray.sumOf(
    selector: (UByte) -> Long
): Long
Platform and version requirements: JVM (1.4), JS (1.4), Native (1.4)
@JvmName("sumOfLong") @ExperimentalUnsignedTypes inline fun UShortArray.sumOf(
    selector: (UShort) -> Long
): Long
Platform and version requirements: JVM (1.4), JS (1.4), Native (1.4)
@JvmName("sumOfUInt") @ExperimentalUnsignedTypes inline fun UIntArray.sumOf(
    selector: (UInt) -> UInt
): UInt
Platform and version requirements: JVM (1.4), JS (1.4), Native (1.4)
@JvmName("sumOfUInt") @ExperimentalUnsignedTypes inline fun ULongArray.sumOf(
    selector: (ULong) -> UInt
): UInt
Platform and version requirements: JVM (1.4), JS (1.4), Native (1.4)
@JvmName("sumOfUInt") @ExperimentalUnsignedTypes inline fun UByteArray.sumOf(
    selector: (UByte) -> UInt
): UInt
Platform and version requirements: JVM (1.4), JS (1.4), Native (1.4)
@JvmName("sumOfUInt") @ExperimentalUnsignedTypes inline fun UShortArray.sumOf(
    selector: (UShort) -> UInt
): UInt
Platform and version requirements: JVM (1.4), JS (1.4), Native (1.4)
@JvmName("sumOfULong") @ExperimentalUnsignedTypes inline fun UIntArray.sumOf(
    selector: (UInt) -> ULong
): ULong
Platform and version requirements: JVM (1.4), JS (1.4), Native (1.4)
@JvmName("sumOfULong") @ExperimentalUnsignedTypes inline fun ULongArray.sumOf(
    selector: (ULong) -> ULong
): ULong
Platform and version requirements: JVM (1.4), JS (1.4), Native (1.4)
@JvmName("sumOfULong") @ExperimentalUnsignedTypes inline fun UByteArray.sumOf(
    selector: (UByte) -> ULong
): ULong
Platform and version requirements: JVM (1.4), JS (1.4), Native (1.4)
@JvmName("sumOfULong") @ExperimentalUnsignedTypes inline fun UShortArray.sumOf(
    selector: (UShort) -> ULong
): ULong
Platform and version requirements: JVM (1.4)
@JvmName("sumOfBigDecimal") inline fun <T> Array<out T>.sumOf(
    selector: (T) -> BigDecimal
): BigDecimal
Platform and version requirements: JVM (1.4)
@JvmName("sumOfBigDecimal") inline fun ByteArray.sumOf(
    selector: (Byte) -> BigDecimal
): BigDecimal
Platform and version requirements: JVM (1.4)
@JvmName("sumOfBigDecimal") inline fun ShortArray.sumOf(
    selector: (Short) -> BigDecimal
): BigDecimal
Platform and version requirements: JVM (1.4)
@JvmName("sumOfBigDecimal") inline fun IntArray.sumOf(
    selector: (Int) -> BigDecimal
): BigDecimal
Platform and version requirements: JVM (1.4)
@JvmName("sumOfBigDecimal") inline fun LongArray.sumOf(
    selector: (Long) -> BigDecimal
): BigDecimal
Platform and version requirements: JVM (1.4)
@JvmName("sumOfBigDecimal") inline fun FloatArray.sumOf(
    selector: (Float) -> BigDecimal
): BigDecimal
Platform and version requirements: JVM (1.4)
@JvmName("sumOfBigDecimal") inline fun DoubleArray.sumOf(
    selector: (Double) -> BigDecimal
): BigDecimal
Platform and version requirements: JVM (1.4)
@JvmName("sumOfBigDecimal") inline fun BooleanArray.sumOf(
    selector: (Boolean) -> BigDecimal
): BigDecimal
Platform and version requirements: JVM (1.4)
@JvmName("sumOfBigDecimal") inline fun CharArray.sumOf(
    selector: (Char) -> BigDecimal
): BigDecimal
Platform and version requirements: JVM (1.4)
@JvmName("sumOfBigInteger") inline fun <T> Array<out T>.sumOf(
    selector: (T) -> BigInteger
): BigInteger
Platform and version requirements: JVM (1.4)
@JvmName("sumOfBigInteger") inline fun ByteArray.sumOf(
    selector: (Byte) -> BigInteger
): BigInteger
Platform and version requirements: JVM (1.4)
@JvmName("sumOfBigInteger") inline fun ShortArray.sumOf(
    selector: (Short) -> BigInteger
): BigInteger
Platform and version requirements: JVM (1.4)
@JvmName("sumOfBigInteger") inline fun IntArray.sumOf(
    selector: (Int) -> BigInteger
): BigInteger
Platform and version requirements: JVM (1.4)
@JvmName("sumOfBigInteger") inline fun LongArray.sumOf(
    selector: (Long) -> BigInteger
): BigInteger
Platform and version requirements: JVM (1.4)
@JvmName("sumOfBigInteger") inline fun FloatArray.sumOf(
    selector: (Float) -> BigInteger
): BigInteger
Platform and version requirements: JVM (1.4)
@JvmName("sumOfBigInteger") inline fun DoubleArray.sumOf(
    selector: (Double) -> BigInteger
): BigInteger
Platform and version requirements: JVM (1.4)
@JvmName("sumOfBigInteger") inline fun BooleanArray.sumOf(
    selector: (Boolean) -> BigInteger
): BigInteger
Platform and version requirements: JVM (1.4)
@JvmName("sumOfBigInteger") inline fun CharArray.sumOf(
    selector: (Char) -> BigInteger
): BigInteger
Platform and version requirements: JVM (1.4)
@JvmName("sumOfBigDecimal") @ExperimentalUnsignedTypes inline fun UIntArray.sumOf(
    selector: (UInt) -> BigDecimal
): BigDecimal
Platform and version requirements: JVM (1.4)
@JvmName("sumOfBigDecimal") @ExperimentalUnsignedTypes inline fun ULongArray.sumOf(
    selector: (ULong) -> BigDecimal
): BigDecimal
Platform and version requirements: JVM (1.4)
@JvmName("sumOfBigDecimal") @ExperimentalUnsignedTypes inline fun UByteArray.sumOf(
    selector: (UByte) -> BigDecimal
): BigDecimal
Platform and version requirements: JVM (1.4)
@JvmName("sumOfBigDecimal") @ExperimentalUnsignedTypes inline fun UShortArray.sumOf(
    selector: (UShort) -> BigDecimal
): BigDecimal
Platform and version requirements: JVM (1.4)
@JvmName("sumOfBigInteger") @ExperimentalUnsignedTypes inline fun UIntArray.sumOf(
    selector: (UInt) -> BigInteger
): BigInteger
Platform and version requirements: JVM (1.4)
@JvmName("sumOfBigInteger") @ExperimentalUnsignedTypes inline fun ULongArray.sumOf(
    selector: (ULong) -> BigInteger
): BigInteger
Platform and version requirements: JVM (1.4)
@JvmName("sumOfBigInteger") @ExperimentalUnsignedTypes inline fun UByteArray.sumOf(
    selector: (UByte) -> BigInteger
): BigInteger
Platform and version requirements: JVM (1.4)
@JvmName("sumOfBigInteger") @ExperimentalUnsignedTypes inline fun UShortArray.sumOf(
    selector: (UShort) -> BigInteger
): BigInteger

Returns the sum of all values produced by selector function applied to each element in the array.

Platform and version requirements: JVM (1.4), JS (1.4), Native (1.4)
@JvmName("sumOfDouble") inline fun <T> Iterable<T>.sumOf(
    selector: (T) -> Double
): Double
Platform and version requirements: JVM (1.4), JS (1.4), Native (1.4)
@JvmName("sumOfInt") inline fun <T> Iterable<T>.sumOf(
    selector: (T) -> Int
): Int
Platform and version requirements: JVM (1.4), JS (1.4), Native (1.4)
@JvmName("sumOfLong") inline fun <T> Iterable<T>.sumOf(
    selector: (T) -> Long
): Long
Platform and version requirements: JVM (1.4), JS (1.4), Native (1.4)
@JvmName("sumOfUInt") @ExperimentalUnsignedTypes inline fun <T> Iterable<T>.sumOf(
    selector: (T) -> UInt
): UInt
Platform and version requirements: JVM (1.4), JS (1.4), Native (1.4)
@JvmName("sumOfULong") @ExperimentalUnsignedTypes inline fun <T> Iterable<T>.sumOf(
    selector: (T) -> ULong
): ULong
Platform and version requirements: JVM (1.4)
@JvmName("sumOfBigDecimal") inline fun <T> Iterable<T>.sumOf(
    selector: (T) -> BigDecimal
): BigDecimal
Platform and version requirements: JVM (1.4)
@JvmName("sumOfBigInteger") inline fun <T> Iterable<T>.sumOf(
    selector: (T) -> BigInteger
): BigInteger

Returns the sum of all values produced by selector function applied to each element in the collection.

© 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/sum-of.html