W3cubDocs

/Kotlin

flatMapTo

Platform and version requirements: JVM (1.0), JS (1.0), Native (1.0)
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
@JvmName("flatMapSequenceTo") inline fun <T, R, C : MutableCollection<in R>> Array<out T>.flatMapTo(
    destination: C, 
    transform: (T) -> Sequence<R>
): C
@ExperimentalUnsignedTypes inline fun <R, C : MutableCollection<in R>> UIntArray.flatMapTo(
    destination: C, 
    transform: (UInt) -> Iterable<R>
): C
@ExperimentalUnsignedTypes inline fun <R, C : MutableCollection<in R>> ULongArray.flatMapTo(
    destination: C, 
    transform: (ULong) -> Iterable<R>
): C
@ExperimentalUnsignedTypes inline fun <R, C : MutableCollection<in R>> UByteArray.flatMapTo(
    destination: C, 
    transform: (UByte) -> Iterable<R>
): C
@ExperimentalUnsignedTypes inline fun <R, C : MutableCollection<in R>> UShortArray.flatMapTo(
    destination: C, 
    transform: (UShort) -> Iterable<R>
): C

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

Platform and version requirements: JVM (1.0), JS (1.0), Native (1.0)
inline fun <T, R, C : MutableCollection<in R>> Iterable<T>.flatMapTo(
    destination: C, 
    transform: (T) -> Iterable<R>
): C
@JvmName("flatMapSequenceTo") inline fun <T, R, C : MutableCollection<in R>> Iterable<T>.flatMapTo(
    destination: C, 
    transform: (T) -> Sequence<R>
): C

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

Platform and version requirements: JVM (1.0), JS (1.0), Native (1.0)
inline fun <K, V, R, C : MutableCollection<in R>> Map<out K, V>.flatMapTo(
    destination: C, 
    transform: (Entry<K, V>) -> Iterable<R>
): C
@JvmName("flatMapSequenceTo") inline fun <K, V, R, C : MutableCollection<in R>> Map<out K, V>.flatMapTo(
    destination: C, 
    transform: (Entry<K, V>) -> Sequence<R>
): C

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

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