reduce Or Null
inline fun ByteBuffer.reduceOrNull(operation: (acc: Byte, Byte) -> Byte): Byte?
Content copied to clipboard
inline fun ShortBuffer.reduceOrNull(operation: (acc: Short, Short) -> Short): Short?
Content copied to clipboard
inline fun IntBuffer.reduceOrNull(operation: (acc: Int, Int) -> Int): Int?
Content copied to clipboard
inline fun LongBuffer.reduceOrNull(operation: (acc: Long, Long) -> Long): Long?
Content copied to clipboard
inline fun FloatBuffer.reduceOrNull(operation: (acc: Float, Float) -> Float): Float?
Content copied to clipboard
inline fun DoubleBuffer.reduceOrNull(operation: (acc: Double, Double) -> Double): Double?
Content copied to clipboard
inline fun CharBuffer.reduceOrNull(operation: (acc: Char, Char) -> Char): Char?
Content copied to clipboard
Accumulates value starting with the first element and applying operation from left to right to current accumulator value and each element.
Returns null
if the array is empty.
Samples
kool.buffers.Collections.Aggregates.reduceOrNull
Parameters
operation
function that takes current accumulator value and an element, and calculates the next accumulator value.