reduceRightIndexedOrNull

inline fun ByteBuffer.reduceRightIndexedOrNull(operation: (index: Int, Byte, acc: Byte) -> Byte): Byte?
inline fun ShortBuffer.reduceRightIndexedOrNull(operation: (index: Int, Short, acc: Short) -> Short): Short?
inline fun IntBuffer.reduceRightIndexedOrNull(operation: (index: Int, Int, acc: Int) -> Int): Int?
inline fun LongBuffer.reduceRightIndexedOrNull(operation: (index: Int, Long, acc: Long) -> Long): Long?
inline fun FloatBuffer.reduceRightIndexedOrNull(operation: (index: Int, Float, acc: Float) -> Float): Float?
inline fun DoubleBuffer.reduceRightIndexedOrNull(operation: (index: Int, Double, acc: Double) -> Double): Double?
inline fun CharBuffer.reduceRightIndexedOrNull(operation: (index: Int, Char, acc: Char) -> Char): Char?

Accumulates value starting with the last element and applying operation from right to left to each element with its index in the original array and current accumulator value.

Returns null if the array is empty.

Samples

kool.buffers.Collections.Aggregates.reduceRightOrNull

Parameters

operation

function that takes the index of an element, the element itself and current accumulator value, and calculates the next accumulator value.