W3cubDocs

/Kotlin

flatMapTo

inline fun <T, R, C : MutableCollection<in R>> Iterable<T>.flatMapTo(
    destination: C, 
    transform: (T) -> Iterable<R>
): C

Appends all elements yielded from results of transform function being invoked on each element of original collection, to the given destination.

inline fun <K, V, R, C : MutableCollection<in R>> Map<out K, V>.flatMapTo(
    destination: C, 
    transform: (Entry<K, V>) -> Iterable<R>
): C

Appends all elements yielded from results of transform function being invoked on each entry of original map, to the given destination.

inline fun <T, R, C : MutableCollection<in R>> Array<out T>.flatMapTo(
    destination: C, 
    transform: (T) -> Iterable<R>
): C
inline fun <R, C : MutableCollection<in R>> ByteArray.flatMapTo(
    destination: C, 
    transform: (Byte) -> Iterable<R>
): C
inline fun <R, C : MutableCollection<in R>> ShortArray.flatMapTo(
    destination: C, 
    transform: (Short) -> Iterable<R>
): C
inline fun <R, C : MutableCollection<in R>> IntArray.flatMapTo(
    destination: C, 
    transform: (Int) -> Iterable<R>
): C
inline fun <R, C : MutableCollection<in R>> LongArray.flatMapTo(
    destination: C, 
    transform: (Long) -> Iterable<R>
): C
inline fun <R, C : MutableCollection<in R>> FloatArray.flatMapTo(
    destination: C, 
    transform: (Float) -> Iterable<R>
): C
inline fun <R, C : MutableCollection<in R>> DoubleArray.flatMapTo(
    destination: C, 
    transform: (Double) -> Iterable<R>
): C
inline fun <R, C : MutableCollection<in R>> BooleanArray.flatMapTo(
    destination: C, 
    transform: (Boolean) -> Iterable<R>
): C
inline fun <R, C : MutableCollection<in R>> CharArray.flatMapTo(
    destination: C, 
    transform: (Char) -> Iterable<R>
): C

Appends all elements yielded from results of transform function being invoked on each element of original array, to the given destination.

© 2010–2017 JetBrains s.r.o.
Licensed under the Apache License, Version 2.0.
https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/flat-map-to.html