Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
package kotlin
//
// NOTE THIS FILE IS AUTO-GENERATED by the GenerateStandardLib.kt
// See: https://github.com/JetBrains/kotlin/tree/master/libraries/stdlib
//
import kotlin.platform.*
import java.util.*
import java.util.Collections // TODO: it's temporary while we have java.util.Collections in js
/**
* Returns a single list of all elements yielded from results of [transform] function being invoked on each element of original collection.
*/
public inline fun Array.flatMap(transform: (T) -> Iterable): List {
return flatMapTo(ArrayList(), transform)
}
/**
* Returns a single list of all elements yielded from results of [transform] function being invoked on each element of original collection.
*/
public inline fun BooleanArray.flatMap(transform: (Boolean) -> Iterable): List {
return flatMapTo(ArrayList(), transform)
}
/**
* Returns a single list of all elements yielded from results of [transform] function being invoked on each element of original collection.
*/
public inline fun ByteArray.flatMap(transform: (Byte) -> Iterable): List {
return flatMapTo(ArrayList(), transform)
}
/**
* Returns a single list of all elements yielded from results of [transform] function being invoked on each element of original collection.
*/
public inline fun CharArray.flatMap(transform: (Char) -> Iterable): List {
return flatMapTo(ArrayList(), transform)
}
/**
* Returns a single list of all elements yielded from results of [transform] function being invoked on each element of original collection.
*/
public inline fun DoubleArray.flatMap(transform: (Double) -> Iterable): List {
return flatMapTo(ArrayList(), transform)
}
/**
* Returns a single list of all elements yielded from results of [transform] function being invoked on each element of original collection.
*/
public inline fun FloatArray.flatMap(transform: (Float) -> Iterable): List {
return flatMapTo(ArrayList(), transform)
}
/**
* Returns a single list of all elements yielded from results of [transform] function being invoked on each element of original collection.
*/
public inline fun IntArray.flatMap(transform: (Int) -> Iterable): List {
return flatMapTo(ArrayList(), transform)
}
/**
* Returns a single list of all elements yielded from results of [transform] function being invoked on each element of original collection.
*/
public inline fun LongArray.flatMap(transform: (Long) -> Iterable): List {
return flatMapTo(ArrayList(), transform)
}
/**
* Returns a single list of all elements yielded from results of [transform] function being invoked on each element of original collection.
*/
public inline fun ShortArray.flatMap(transform: (Short) -> Iterable): List {
return flatMapTo(ArrayList(), transform)
}
/**
* Returns a single list of all elements yielded from results of [transform] function being invoked on each element of original collection.
*/
public inline fun Iterable.flatMap(transform: (T) -> Iterable): List {
return flatMapTo(ArrayList(), transform)
}
/**
* Returns a single list of all elements yielded from results of [transform] function being invoked on each element of original collection.
*/
public inline fun Map.flatMap(transform: (Map.Entry) -> Iterable): List {
return flatMapTo(ArrayList(), transform)
}
/**
* Returns a single list of all elements yielded from results of [transform] function being invoked on each element of original collection.
*/
public inline fun String.flatMap(transform: (Char) -> Iterable): List {
return flatMapTo(ArrayList(), transform)
}
/**
* Returns a single sequence of all elements from results of [transform] function being invoked on each element of original sequence.
*/
public fun Sequence.flatMap(transform: (T) -> Sequence): Sequence {
return FlatteningSequence(this, transform)
}
/**
* Appends all elements yielded from results of [transform] function being invoked on each element of original collection, to the given [destination].
*/
public inline fun > Array.flatMapTo(destination: C, transform: (T) -> Iterable): C {
for (element in this) {
val list = transform(element)
destination.addAll(list)
}
return destination
}
/**
* Appends all elements yielded from results of [transform] function being invoked on each element of original collection, to the given [destination].
*/
public inline fun > BooleanArray.flatMapTo(destination: C, transform: (Boolean) -> Iterable): C {
for (element in this) {
val list = transform(element)
destination.addAll(list)
}
return destination
}
/**
* Appends all elements yielded from results of [transform] function being invoked on each element of original collection, to the given [destination].
*/
public inline fun > ByteArray.flatMapTo(destination: C, transform: (Byte) -> Iterable): C {
for (element in this) {
val list = transform(element)
destination.addAll(list)
}
return destination
}
/**
* Appends all elements yielded from results of [transform] function being invoked on each element of original collection, to the given [destination].
*/
public inline fun > CharArray.flatMapTo(destination: C, transform: (Char) -> Iterable): C {
for (element in this) {
val list = transform(element)
destination.addAll(list)
}
return destination
}
/**
* Appends all elements yielded from results of [transform] function being invoked on each element of original collection, to the given [destination].
*/
public inline fun > DoubleArray.flatMapTo(destination: C, transform: (Double) -> Iterable): C {
for (element in this) {
val list = transform(element)
destination.addAll(list)
}
return destination
}
/**
* Appends all elements yielded from results of [transform] function being invoked on each element of original collection, to the given [destination].
*/
public inline fun > FloatArray.flatMapTo(destination: C, transform: (Float) -> Iterable): C {
for (element in this) {
val list = transform(element)
destination.addAll(list)
}
return destination
}
/**
* Appends all elements yielded from results of [transform] function being invoked on each element of original collection, to the given [destination].
*/
public inline fun > IntArray.flatMapTo(destination: C, transform: (Int) -> Iterable): C {
for (element in this) {
val list = transform(element)
destination.addAll(list)
}
return destination
}
/**
* Appends all elements yielded from results of [transform] function being invoked on each element of original collection, to the given [destination].
*/
public inline fun > LongArray.flatMapTo(destination: C, transform: (Long) -> Iterable): C {
for (element in this) {
val list = transform(element)
destination.addAll(list)
}
return destination
}
/**
* Appends all elements yielded from results of [transform] function being invoked on each element of original collection, to the given [destination].
*/
public inline fun > ShortArray.flatMapTo(destination: C, transform: (Short) -> Iterable): C {
for (element in this) {
val list = transform(element)
destination.addAll(list)
}
return destination
}
/**
* Appends all elements yielded from results of [transform] function being invoked on each element of original collection, to the given [destination].
*/
public inline fun > Iterable.flatMapTo(destination: C, transform: (T) -> Iterable): C {
for (element in this) {
val list = transform(element)
destination.addAll(list)
}
return destination
}
/**
* Appends all elements yielded from results of [transform] function being invoked on each element of original collection, to the given [destination].
*/
public inline fun > Map.flatMapTo(destination: C, transform: (Map.Entry) -> Iterable): C {
for (element in this) {
val list = transform(element)
destination.addAll(list)
}
return destination
}
/**
* Appends all elements yielded from results of [transform] function being invoked on each element of original collection, to the given [destination].
*/
public inline fun > String.flatMapTo(destination: C, transform: (Char) -> Iterable): C {
for (element in this) {
val list = transform(element)
destination.addAll(list)
}
return destination
}
/**
* Appends all elements yielded from results of [transform] function being invoked on each element of original sequence, to the given [destination].
*/
public inline fun > Sequence.flatMapTo(destination: C, transform: (T) -> Sequence): C {
for (element in this) {
val list = transform(element)
destination.addAll(list)
}
return destination
}
/**
* Returns a map of the elements in original collection grouped by the result of given [toKey] function.
*/
public inline fun Array.groupBy(toKey: (T) -> K): Map> {
return groupByTo(LinkedHashMap>(), toKey)
}
/**
* Returns a map of the elements in original collection grouped by the result of given [toKey] function.
*/
public inline fun BooleanArray.groupBy(toKey: (Boolean) -> K): Map> {
return groupByTo(LinkedHashMap>(), toKey)
}
/**
* Returns a map of the elements in original collection grouped by the result of given [toKey] function.
*/
public inline fun ByteArray.groupBy(toKey: (Byte) -> K): Map> {
return groupByTo(LinkedHashMap>(), toKey)
}
/**
* Returns a map of the elements in original collection grouped by the result of given [toKey] function.
*/
public inline fun CharArray.groupBy(toKey: (Char) -> K): Map> {
return groupByTo(LinkedHashMap>(), toKey)
}
/**
* Returns a map of the elements in original collection grouped by the result of given [toKey] function.
*/
public inline fun DoubleArray.groupBy(toKey: (Double) -> K): Map> {
return groupByTo(LinkedHashMap>(), toKey)
}
/**
* Returns a map of the elements in original collection grouped by the result of given [toKey] function.
*/
public inline fun FloatArray.groupBy(toKey: (Float) -> K): Map> {
return groupByTo(LinkedHashMap>(), toKey)
}
/**
* Returns a map of the elements in original collection grouped by the result of given [toKey] function.
*/
public inline fun IntArray.groupBy(toKey: (Int) -> K): Map> {
return groupByTo(LinkedHashMap>(), toKey)
}
/**
* Returns a map of the elements in original collection grouped by the result of given [toKey] function.
*/
public inline fun LongArray.groupBy(toKey: (Long) -> K): Map> {
return groupByTo(LinkedHashMap>(), toKey)
}
/**
* Returns a map of the elements in original collection grouped by the result of given [toKey] function.
*/
public inline fun ShortArray.groupBy(toKey: (Short) -> K): Map> {
return groupByTo(LinkedHashMap>(), toKey)
}
/**
* Returns a map of the elements in original collection grouped by the result of given [toKey] function.
*/
public inline fun Iterable.groupBy(toKey: (T) -> K): Map> {
return groupByTo(LinkedHashMap>(), toKey)
}
/**
* Returns a map of the elements in original collection grouped by the result of given [toKey] function.
*/
public inline fun Sequence.groupBy(toKey: (T) -> K): Map> {
return groupByTo(LinkedHashMap>(), toKey)
}
/**
* Returns a map of the elements in original collection grouped by the result of given [toKey] function.
*/
public inline fun String.groupBy(toKey: (Char) -> K): Map> {
return groupByTo(LinkedHashMap>(), toKey)
}
/**
* Appends elements from original collection grouped by the result of given [toKey] function to the given [map].
*/
public inline fun Array.groupByTo(map: MutableMap>, toKey: (T) -> K): Map> {
for (element in this) {
val key = toKey(element)
val list = map.getOrPut(key) { ArrayList() }
list.add(element)
}
return map
}
/**
* Appends elements from original collection grouped by the result of given [toKey] function to the given [map].
*/
public inline fun BooleanArray.groupByTo(map: MutableMap>, toKey: (Boolean) -> K): Map> {
for (element in this) {
val key = toKey(element)
val list = map.getOrPut(key) { ArrayList() }
list.add(element)
}
return map
}
/**
* Appends elements from original collection grouped by the result of given [toKey] function to the given [map].
*/
public inline fun ByteArray.groupByTo(map: MutableMap>, toKey: (Byte) -> K): Map> {
for (element in this) {
val key = toKey(element)
val list = map.getOrPut(key) { ArrayList() }
list.add(element)
}
return map
}
/**
* Appends elements from original collection grouped by the result of given [toKey] function to the given [map].
*/
public inline fun CharArray.groupByTo(map: MutableMap>, toKey: (Char) -> K): Map> {
for (element in this) {
val key = toKey(element)
val list = map.getOrPut(key) { ArrayList() }
list.add(element)
}
return map
}
/**
* Appends elements from original collection grouped by the result of given [toKey] function to the given [map].
*/
public inline fun DoubleArray.groupByTo(map: MutableMap>, toKey: (Double) -> K): Map> {
for (element in this) {
val key = toKey(element)
val list = map.getOrPut(key) { ArrayList() }
list.add(element)
}
return map
}
/**
* Appends elements from original collection grouped by the result of given [toKey] function to the given [map].
*/
public inline fun FloatArray.groupByTo(map: MutableMap>, toKey: (Float) -> K): Map> {
for (element in this) {
val key = toKey(element)
val list = map.getOrPut(key) { ArrayList() }
list.add(element)
}
return map
}
/**
* Appends elements from original collection grouped by the result of given [toKey] function to the given [map].
*/
public inline fun IntArray.groupByTo(map: MutableMap>, toKey: (Int) -> K): Map> {
for (element in this) {
val key = toKey(element)
val list = map.getOrPut(key) { ArrayList() }
list.add(element)
}
return map
}
/**
* Appends elements from original collection grouped by the result of given [toKey] function to the given [map].
*/
public inline fun LongArray.groupByTo(map: MutableMap>, toKey: (Long) -> K): Map> {
for (element in this) {
val key = toKey(element)
val list = map.getOrPut(key) { ArrayList() }
list.add(element)
}
return map
}
/**
* Appends elements from original collection grouped by the result of given [toKey] function to the given [map].
*/
public inline fun ShortArray.groupByTo(map: MutableMap>, toKey: (Short) -> K): Map> {
for (element in this) {
val key = toKey(element)
val list = map.getOrPut(key) { ArrayList() }
list.add(element)
}
return map
}
/**
* Appends elements from original collection grouped by the result of given [toKey] function to the given [map].
*/
public inline fun Iterable.groupByTo(map: MutableMap>, toKey: (T) -> K): Map> {
for (element in this) {
val key = toKey(element)
val list = map.getOrPut(key) { ArrayList() }
list.add(element)
}
return map
}
/**
* Appends elements from original collection grouped by the result of given [toKey] function to the given [map].
*/
public inline fun Sequence.groupByTo(map: MutableMap>, toKey: (T) -> K): Map> {
for (element in this) {
val key = toKey(element)
val list = map.getOrPut(key) { ArrayList() }
list.add(element)
}
return map
}
/**
* Appends elements from original collection grouped by the result of given [toKey] function to the given [map].
*/
public inline fun String.groupByTo(map: MutableMap>, toKey: (Char) -> K): Map> {
for (element in this) {
val key = toKey(element)
val list = map.getOrPut(key) { ArrayList() }
list.add(element)
}
return map
}
/**
* Returns a list containing the results of applying the given [transform] function to each element of the original collection.
*/
public inline fun Array.map(transform: (T) -> R): List {
return mapTo(ArrayList(size()), transform)
}
/**
* Returns a list containing the results of applying the given [transform] function to each element of the original collection.
*/
public inline fun BooleanArray.map(transform: (Boolean) -> R): List {
return mapTo(ArrayList(size()), transform)
}
/**
* Returns a list containing the results of applying the given [transform] function to each element of the original collection.
*/
public inline fun ByteArray.map(transform: (Byte) -> R): List {
return mapTo(ArrayList(size()), transform)
}
/**
* Returns a list containing the results of applying the given [transform] function to each element of the original collection.
*/
public inline fun CharArray.map(transform: (Char) -> R): List {
return mapTo(ArrayList(size()), transform)
}
/**
* Returns a list containing the results of applying the given [transform] function to each element of the original collection.
*/
public inline fun DoubleArray.map(transform: (Double) -> R): List {
return mapTo(ArrayList(size()), transform)
}
/**
* Returns a list containing the results of applying the given [transform] function to each element of the original collection.
*/
public inline fun FloatArray.map(transform: (Float) -> R): List {
return mapTo(ArrayList(size()), transform)
}
/**
* Returns a list containing the results of applying the given [transform] function to each element of the original collection.
*/
public inline fun IntArray.map(transform: (Int) -> R): List {
return mapTo(ArrayList(size()), transform)
}
/**
* Returns a list containing the results of applying the given [transform] function to each element of the original collection.
*/
public inline fun LongArray.map(transform: (Long) -> R): List {
return mapTo(ArrayList(size()), transform)
}
/**
* Returns a list containing the results of applying the given [transform] function to each element of the original collection.
*/
public inline fun ShortArray.map(transform: (Short) -> R): List {
return mapTo(ArrayList(size()), transform)
}
/**
* Returns a list containing the results of applying the given [transform] function to each element of the original collection.
*/
public inline fun Iterable.map(transform: (T) -> R): List {
return mapTo(ArrayList(collectionSizeOrDefault(10)), transform)
}
/**
* Returns a list containing the results of applying the given [transform] function to each element of the original collection.
*/
public inline fun Map.map(transform: (Map.Entry) -> R): List {
return mapTo(ArrayList(size()), transform)
}
/**
* Returns a sequence containing the results of applying the given [transform] function to each element of the original sequence.
*/
public fun Sequence.map(transform: (T) -> R): Sequence {
return TransformingSequence(this, transform)
}
/**
* Returns a list containing the results of applying the given [transform] function to each element of the original collection.
*/
public inline fun String.map(transform: (Char) -> R): List {
return mapTo(ArrayList(length()), transform)
}
/**
* Returns a list containing the results of applying the given [transform] function to each element and its index of the original collection.
*/
public inline fun Array.mapIndexed(transform: (Int, T) -> R): List {
return mapIndexedTo(ArrayList(size()), transform)
}
/**
* Returns a list containing the results of applying the given [transform] function to each element and its index of the original collection.
*/
public inline fun BooleanArray.mapIndexed(transform: (Int, Boolean) -> R): List {
return mapIndexedTo(ArrayList(size()), transform)
}
/**
* Returns a list containing the results of applying the given [transform] function to each element and its index of the original collection.
*/
public inline fun ByteArray.mapIndexed(transform: (Int, Byte) -> R): List {
return mapIndexedTo(ArrayList(size()), transform)
}
/**
* Returns a list containing the results of applying the given [transform] function to each element and its index of the original collection.
*/
public inline fun CharArray.mapIndexed(transform: (Int, Char) -> R): List {
return mapIndexedTo(ArrayList(size()), transform)
}
/**
* Returns a list containing the results of applying the given [transform] function to each element and its index of the original collection.
*/
public inline fun DoubleArray.mapIndexed(transform: (Int, Double) -> R): List {
return mapIndexedTo(ArrayList(size()), transform)
}
/**
* Returns a list containing the results of applying the given [transform] function to each element and its index of the original collection.
*/
public inline fun FloatArray.mapIndexed(transform: (Int, Float) -> R): List {
return mapIndexedTo(ArrayList(size()), transform)
}
/**
* Returns a list containing the results of applying the given [transform] function to each element and its index of the original collection.
*/
public inline fun IntArray.mapIndexed(transform: (Int, Int) -> R): List {
return mapIndexedTo(ArrayList(size()), transform)
}
/**
* Returns a list containing the results of applying the given [transform] function to each element and its index of the original collection.
*/
public inline fun LongArray.mapIndexed(transform: (Int, Long) -> R): List {
return mapIndexedTo(ArrayList(size()), transform)
}
/**
* Returns a list containing the results of applying the given [transform] function to each element and its index of the original collection.
*/
public inline fun ShortArray.mapIndexed(transform: (Int, Short) -> R): List {
return mapIndexedTo(ArrayList(size()), transform)
}
/**
* Returns a list containing the results of applying the given [transform] function to each element and its index of the original collection.
*/
public inline fun Iterable.mapIndexed(transform: (Int, T) -> R): List