filterIndexed

inline fun ByteBuffer.filterIndexed(predicate: (index: Int, Byte) -> Boolean): List<Byte>
inline fun ShortBuffer.filterIndexed(predicate: (index: Int, Short) -> Boolean): List<Short>
inline fun IntBuffer.filterIndexed(predicate: (index: Int, Int) -> Boolean): List<Int>
inline fun LongBuffer.filterIndexed(predicate: (index: Int, Long) -> Boolean): List<Long>
inline fun FloatBuffer.filterIndexed(predicate: (index: Int, Float) -> Boolean): List<Float>
inline fun DoubleBuffer.filterIndexed(predicate: (index: Int, Double) -> Boolean): List<Double>
inline fun CharBuffer.filterIndexed(predicate: (index: Int, Char) -> Boolean): List<Char>

Returns a list containing only elements matching the given predicate.

Samples

kool.buffers.Collections.Filtering.filterIndexed

Parameters

predicate

function that takes the index of an element and the element itself and returns the result of predicate evaluation on the element.