W3cubDocs

/Kotlin

flatMap

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

Returns a single list of all elements yielded from results of transform function being invoked on each element of original array.

inline fun <T, R> Iterable<T>.flatMap(
    transform: (T) -> Iterable<R>
): List<R>

Returns a single list of all elements yielded from results of transform function being invoked on each element of original collection.

inline fun <K, V, R> Map<out K, V>.flatMap(
    transform: (Entry<K, V>) -> Iterable<R>
): List<R>

Returns a single list of all elements yielded from results of transform function being invoked on each entry of original map.

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