reduce Right Indexed
inline fun ByteBuffer.reduceRightIndexed(operation: (index: Int, Byte, acc: Byte) -> Byte): Byte
Content copied to clipboard
inline fun ShortBuffer.reduceRightIndexed(operation: (index: Int, Short, acc: Short) -> Short): Short
Content copied to clipboard
inline fun IntBuffer.reduceRightIndexed(operation: (index: Int, Int, acc: Int) -> Int): Int
Content copied to clipboard
inline fun LongBuffer.reduceRightIndexed(operation: (index: Int, Long, acc: Long) -> Long): Long
Content copied to clipboard
inline fun FloatBuffer.reduceRightIndexed(operation: (index: Int, Float, acc: Float) -> Float): Float
Content copied to clipboard
inline fun DoubleBuffer.reduceRightIndexed(operation: (index: Int, Double, acc: Double) -> Double): Double
Content copied to clipboard
inline fun CharBuffer.reduceRightIndexed(operation: (index: Int, Char, acc: Char) -> Char): Char
Content copied to clipboard
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.
Throws an exception if this array is empty. If the array can be empty in an expected way, please use reduceRightIndexedOrNull instead. It returns null
when its receiver is empty.
Samples
kool.buffers.Collections.Aggregates.reduceRight
Parameters
operation
function that takes the index of an element, the element itself and current accumulator value, and calculates the next accumulator value.