flat Map Indexed To
abstract fun <R, C : MutableCollectionWrapper<in R>> flatMapIndexedTo(destination: C, transform: (index: Int, T) -> Iterable<R>): C
将序列中的每个元素应用到指定的转换函数,并将结果展平并添加到指定的 MutableCollectionWrapper 中,并提供元素的索引。
此函数类似于 Kotlin 标准库中的 flatMapIndexedTo
函数,但它使用 MutableCollectionWrapper
而不是原始的 MutableCollection
。
参考 kotlin.sequences.flatMapIndexedTo
Return
指定的 MutableCollectionWrapper,其中包含展平后的结果。
Parameters
destination
用于存储结果的 MutableCollectionWrapper。
transform
一个函数,它接收序列的每个元素的索引和元素本身作为参数,并返回一个可迭代对象。