library changes after collections mapping

This commit is contained in:
Svetlana Isakova
2012-09-04 16:52:43 +04:00
parent 7c828b9ff7
commit 8b749084b5
75 changed files with 222 additions and 268 deletions
@@ -5,7 +5,7 @@ package kotlin
// NOTE THIS FILE IS AUTO-GENERATED by the GenerateStandardLib.kt
// See: https://github.com/JetBrains/kotlin/tree/master/libraries/stdlib
//
// Generated from input file: src/kotlin/JLangIterables.kt
// Generated from input file: JLangIterables.kt
//
@@ -79,7 +79,7 @@ public inline fun <T> Array<T>.find(predicate: (T) -> Boolean) : T? {
*
* @includeFunctionBody ../../test/CollectionTest.kt filterIntoLinkedList
*/
public inline fun <T, C: Collection<in T>> Array<T>.filterTo(result: C, predicate: (T) -> Boolean) : C {
public inline fun <T, C: MutableCollection<in T>> Array<T>.filterTo(result: C, predicate: (T) -> Boolean) : C {
for (element in this) if (predicate(element)) result.add(element)
return result
}
@@ -89,7 +89,7 @@ public inline fun <T, C: Collection<in T>> Array<T>.filterTo(result: C, predicat
*
* @includeFunctionBody ../../test/CollectionTest.kt filterNotIntoLinkedList
*/
public inline fun <T, C: Collection<in T>> Array<T>.filterNotTo(result: C, predicate: (T) -> Boolean) : C {
public inline fun <T, C: MutableCollection<in T>> Array<T>.filterNotTo(result: C, predicate: (T) -> Boolean) : C {
for (element in this) if (!predicate(element)) result.add(element)
return result
}
@@ -99,7 +99,7 @@ public inline fun <T, C: Collection<in T>> Array<T>.filterNotTo(result: C, predi
*
* @includeFunctionBody ../../test/CollectionTest.kt filterNotNullIntoLinkedList
*/
public inline fun <T, C: Collection<in T>> Array<T?>?.filterNotNullTo(result: C) : C {
public inline fun <T, C: MutableCollection<in T>> Array<T?>?.filterNotNullTo(result: C) : C {
if (this != null) {
for (element in this) if (element != null) result.add(element)
}
@@ -111,7 +111,7 @@ public inline fun <T, C: Collection<in T>> Array<T?>?.filterNotNullTo(result: C)
*
* @includeFunctionBody ../../test/CollectionTest.kt flatMap
*/
public inline fun <T, R> Array<T>.flatMapTo(result: Collection<R>, transform: (T) -> Collection<R>) : Collection<R> {
public inline fun <T, R> Array<T>.flatMapTo(result: MutableCollection<R>, transform: (T) -> Collection<R>) : Collection<R> {
for (element in this) {
val list = transform(element)
if (list != null) {
@@ -181,14 +181,14 @@ public inline fun <T> Array<T>.reduceRight(operation: (T, T) -> T): T = reverse(
*
* @includeFunctionBody ../../test/CollectionTest.kt groupBy
*/
public inline fun <T, K> Array<T>.groupBy(toKey: (T) -> K) : Map<K, List<T>> = groupByTo<T,K>(HashMap<K, List<T>>(), toKey)
public inline fun <T, K> Array<T>.groupBy(toKey: (T) -> K) : Map<K, MutableList<T>> = groupByTo<T,K>(HashMap<K, MutableList<T>>(), toKey)
/**
* Groups the elements in the collection into the given [[Map]] using the supplied *toKey* function to calculate the key to group the elements by
*
* @includeFunctionBody ../../test/CollectionTest.kt groupBy
*/
public inline fun <T, K> Array<T>.groupByTo(result: Map<K, List<T>>, toKey: (T) -> K) : Map<K, List<T>> {
public inline fun <T, K> Array<T>.groupByTo(result: MutableMap<K, MutableList<T>>, toKey: (T) -> K) : Map<K, MutableList<T>> {
for (element in this) {
val key = toKey(element)
val list = result.getOrPut(key) { ArrayList<T>() }
@@ -212,7 +212,7 @@ public inline fun <T> Array<T>.makeString(separator: String = ", ", prefix: Stri
}
/** Returns a list containing the everything but the first elements that satisfy the given *predicate* */
public inline fun <T, L: List<in T>> Array<T>.dropWhileTo(result: L, predicate: (T) -> Boolean) : L {
public inline fun <T, L: MutableList<in T>> Array<T>.dropWhileTo(result: L, predicate: (T) -> Boolean) : L {
var start = true
for (element in this) {
if (start && predicate(element)) {
@@ -226,13 +226,13 @@ public inline fun <T, L: List<in T>> Array<T>.dropWhileTo(result: L, predicate:
}
/** Returns a list containing the first elements that satisfy the given *predicate* */
public inline fun <T, C: Collection<in T>> Array<T>.takeWhileTo(result: C, predicate: (T) -> Boolean) : C {
public inline fun <T, C: MutableCollection<in T>> Array<T>.takeWhileTo(result: C, predicate: (T) -> Boolean) : C {
for (element in this) if (predicate(element)) result.add(element) else break
return result
}
/** Copies all elements into the given collection */
public inline fun <in T, C: Collection<in T>> Array<T>.toCollection(result: C) : C {
public inline fun <in T, C: MutableCollection<in T>> Array<T>.toCollection(result: C) : C {
for (element in this) result.add(element)
return result
}
@@ -5,7 +5,7 @@ package kotlin
// NOTE THIS FILE IS AUTO-GENERATED by the GenerateStandardLib.kt
// See: https://github.com/JetBrains/kotlin/tree/master/libraries/stdlib
//
// Generated from input file: src/kotlin/JLangIterablesJVM.kt
// Generated from input file: JLangIterablesJVM.kt
//
@@ -5,13 +5,11 @@ package kotlin
// NOTE THIS FILE IS AUTO-GENERATED by the GenerateStandardLib.kt
// See: https://github.com/JetBrains/kotlin/tree/master/libraries/stdlib
//
// Generated from input file: src/kotlin/JLangIterablesLazy.kt
// Generated from input file: JLangIterablesLazy.kt
//
import java.util.ArrayList
import java.util.Collection
import java.util.List
//
// This file contains methods which could have a lazy implementation for things like
@@ -4,7 +4,7 @@ package kotlin
// NOTE THIS FILE IS AUTO-GENERATED by the GenerateStandardLib.kt
// See: https://github.com/JetBrains/kotlin/tree/master/libraries/stdlib
//
// Generated from input file: src/kotlin/JUtilCollections.kt
// Generated from input file: JUtilCollections.kt
//
@@ -21,7 +21,7 @@ import java.util.*
* Transforms each element of this collection with the given *transform* function and
* adds each return value to the given *results* collection
*/
public inline fun <T, R, C: Collection<in R>> Array<T>.mapTo(result: C, transform : (T) -> R) : C {
public inline fun <T, R, C: MutableCollection<in R>> Array<T>.mapTo(result: C, transform : (T) -> R) : C {
for (item in this)
result.add(transform(item))
return result
@@ -4,7 +4,7 @@ package kotlin
// NOTE THIS FILE IS AUTO-GENERATED by the GenerateStandardLib.kt
// See: https://github.com/JetBrains/kotlin/tree/master/libraries/stdlib
//
// Generated from input file: src/kotlin/JUtilCollectionsJVM.kt
// Generated from input file: JUtilCollectionsJVM.kt
//
@@ -22,6 +22,6 @@ import java.util.*
*
* @includeFunctionBody ../../test/CollectionTest.kt map
*/
public inline fun <T, R> Array<T>.map(transform : (T) -> R) : java.util.List<R> {
public inline fun <T, R> Array<T>.map(transform : (T) -> R) : List<R> {
return mapTo(java.util.ArrayList<R>(this.size), transform)
}
@@ -5,7 +5,7 @@ package kotlin
// NOTE THIS FILE IS AUTO-GENERATED by the GenerateStandardLib.kt
// See: https://github.com/JetBrains/kotlin/tree/master/libraries/stdlib
//
// Generated from input file: src/kotlin/JLangIterables.kt
// Generated from input file: JLangIterables.kt
//
@@ -79,7 +79,7 @@ public inline fun BooleanArray.find(predicate: (Boolean) -> Boolean) : Boolean?
*
* @includeFunctionBody ../../test/CollectionTest.kt filterIntoLinkedList
*/
public inline fun <C: Collection<Boolean>> BooleanArray.filterTo(result: C, predicate: (Boolean) -> Boolean) : C {
public inline fun <C: MutableCollection<Boolean>> BooleanArray.filterTo(result: C, predicate: (Boolean) -> Boolean) : C {
for (element in this) if (predicate(element)) result.add(element)
return result
}
@@ -89,7 +89,7 @@ public inline fun <C: Collection<Boolean>> BooleanArray.filterTo(result: C, pred
*
* @includeFunctionBody ../../test/CollectionTest.kt filterNotIntoLinkedList
*/
public inline fun <C: Collection<Boolean>> BooleanArray.filterNotTo(result: C, predicate: (Boolean) -> Boolean) : C {
public inline fun <C: MutableCollection<Boolean>> BooleanArray.filterNotTo(result: C, predicate: (Boolean) -> Boolean) : C {
for (element in this) if (!predicate(element)) result.add(element)
return result
}
@@ -99,7 +99,7 @@ public inline fun <C: Collection<Boolean>> BooleanArray.filterNotTo(result: C, p
*
* @includeFunctionBody ../../test/CollectionTest.kt filterNotNullIntoLinkedList
*/
public inline fun <C: Collection<Boolean>> BooleanArray?.filterNotNullTo(result: C) : C {
public inline fun <C: MutableCollection<Boolean>> BooleanArray?.filterNotNullTo(result: C) : C {
if (this != null) {
for (element in this) if (element != null) result.add(element)
}
@@ -111,7 +111,7 @@ public inline fun <C: Collection<Boolean>> BooleanArray?.filterNotNullTo(result:
*
* @includeFunctionBody ../../test/CollectionTest.kt flatMap
*/
public inline fun <R> BooleanArray.flatMapTo(result: Collection<R>, transform: (Boolean) -> Collection<R>) : Collection<R> {
public inline fun <R> BooleanArray.flatMapTo(result: MutableCollection<R>, transform: (Boolean) -> Collection<R>) : Collection<R> {
for (element in this) {
val list = transform(element)
if (list != null) {
@@ -181,14 +181,14 @@ public inline fun BooleanArray.reduceRight(operation: (Boolean, Boolean) -> Bool
*
* @includeFunctionBody ../../test/CollectionTest.kt groupBy
*/
public inline fun <K> BooleanArray.groupBy(toKey: (Boolean) -> K) : Map<K, List<Boolean>> = groupByTo<K>(HashMap<K, List<Boolean>>(), toKey)
public inline fun <K> BooleanArray.groupBy(toKey: (Boolean) -> K) : Map<K, MutableList<Boolean>> = groupByTo<K>(HashMap<K, MutableList<Boolean>>(), toKey)
/**
* Groups the elements in the collection into the given [[Map]] using the supplied *toKey* function to calculate the key to group the elements by
*
* @includeFunctionBody ../../test/CollectionTest.kt groupBy
*/
public inline fun <K> BooleanArray.groupByTo(result: Map<K, List<Boolean>>, toKey: (Boolean) -> K) : Map<K, List<Boolean>> {
public inline fun <K> BooleanArray.groupByTo(result: MutableMap<K, MutableList<Boolean>>, toKey: (Boolean) -> K) : Map<K, MutableList<Boolean>> {
for (element in this) {
val key = toKey(element)
val list = result.getOrPut(key) { ArrayList<Boolean>() }
@@ -212,7 +212,7 @@ public inline fun BooleanArray.makeString(separator: String = ", ", prefix: Stri
}
/** Returns a list containing the everything but the first elements that satisfy the given *predicate* */
public inline fun <L: List<Boolean>> BooleanArray.dropWhileTo(result: L, predicate: (Boolean) -> Boolean) : L {
public inline fun <L: MutableList<Boolean>> BooleanArray.dropWhileTo(result: L, predicate: (Boolean) -> Boolean) : L {
var start = true
for (element in this) {
if (start && predicate(element)) {
@@ -226,13 +226,13 @@ public inline fun <L: List<Boolean>> BooleanArray.dropWhileTo(result: L, predica
}
/** Returns a list containing the first elements that satisfy the given *predicate* */
public inline fun <C: Collection<Boolean>> BooleanArray.takeWhileTo(result: C, predicate: (Boolean) -> Boolean) : C {
public inline fun <C: MutableCollection<Boolean>> BooleanArray.takeWhileTo(result: C, predicate: (Boolean) -> Boolean) : C {
for (element in this) if (predicate(element)) result.add(element) else break
return result
}
/** Copies all elements into the given collection */
public inline fun <C: Collection<Boolean>> BooleanArray.toCollection(result: C) : C {
public inline fun <C: MutableCollection<Boolean>> BooleanArray.toCollection(result: C) : C {
for (element in this) result.add(element)
return result
}
@@ -5,7 +5,7 @@ package kotlin
// NOTE THIS FILE IS AUTO-GENERATED by the GenerateStandardLib.kt
// See: https://github.com/JetBrains/kotlin/tree/master/libraries/stdlib
//
// Generated from input file: src/kotlin/JLangIterablesJVM.kt
// Generated from input file: JLangIterablesJVM.kt
//
@@ -5,13 +5,11 @@ package kotlin
// NOTE THIS FILE IS AUTO-GENERATED by the GenerateStandardLib.kt
// See: https://github.com/JetBrains/kotlin/tree/master/libraries/stdlib
//
// Generated from input file: src/kotlin/JLangIterablesLazy.kt
// Generated from input file: JLangIterablesLazy.kt
//
import java.util.ArrayList
import java.util.Collection
import java.util.List
//
// This file contains methods which could have a lazy implementation for things like
@@ -4,7 +4,7 @@ package kotlin
// NOTE THIS FILE IS AUTO-GENERATED by the GenerateStandardLib.kt
// See: https://github.com/JetBrains/kotlin/tree/master/libraries/stdlib
//
// Generated from input file: src/kotlin/JUtilCollections.kt
// Generated from input file: JUtilCollections.kt
//
@@ -21,7 +21,7 @@ import java.util.*
* Transforms each element of this collection with the given *transform* function and
* adds each return value to the given *results* collection
*/
public inline fun <R, C: Collection<in R>> BooleanArray.mapTo(result: C, transform : (Boolean) -> R) : C {
public inline fun <R, C: MutableCollection<in R>> BooleanArray.mapTo(result: C, transform : (Boolean) -> R) : C {
for (item in this)
result.add(transform(item))
return result
@@ -4,7 +4,7 @@ package kotlin
// NOTE THIS FILE IS AUTO-GENERATED by the GenerateStandardLib.kt
// See: https://github.com/JetBrains/kotlin/tree/master/libraries/stdlib
//
// Generated from input file: src/kotlin/JUtilCollectionsJVM.kt
// Generated from input file: JUtilCollectionsJVM.kt
//
@@ -22,6 +22,6 @@ import java.util.*
*
* @includeFunctionBody ../../test/CollectionTest.kt map
*/
public inline fun <R> BooleanArray.map(transform : (Boolean) -> R) : java.util.List<R> {
public inline fun <R> BooleanArray.map(transform : (Boolean) -> R) : List<R> {
return mapTo(java.util.ArrayList<R>(this.size), transform)
}
@@ -5,7 +5,7 @@ package kotlin
// NOTE THIS FILE IS AUTO-GENERATED by the GenerateStandardLib.kt
// See: https://github.com/JetBrains/kotlin/tree/master/libraries/stdlib
//
// Generated from input file: src/kotlin/JLangIterables.kt
// Generated from input file: JLangIterables.kt
//
@@ -79,7 +79,7 @@ public inline fun ByteArray.find(predicate: (Byte) -> Boolean) : Byte? {
*
* @includeFunctionBody ../../test/CollectionTest.kt filterIntoLinkedList
*/
public inline fun <C: Collection<Byte>> ByteArray.filterTo(result: C, predicate: (Byte) -> Boolean) : C {
public inline fun <C: MutableCollection<Byte>> ByteArray.filterTo(result: C, predicate: (Byte) -> Boolean) : C {
for (element in this) if (predicate(element)) result.add(element)
return result
}
@@ -89,7 +89,7 @@ public inline fun <C: Collection<Byte>> ByteArray.filterTo(result: C, predicate:
*
* @includeFunctionBody ../../test/CollectionTest.kt filterNotIntoLinkedList
*/
public inline fun <C: Collection<Byte>> ByteArray.filterNotTo(result: C, predicate: (Byte) -> Boolean) : C {
public inline fun <C: MutableCollection<Byte>> ByteArray.filterNotTo(result: C, predicate: (Byte) -> Boolean) : C {
for (element in this) if (!predicate(element)) result.add(element)
return result
}
@@ -99,7 +99,7 @@ public inline fun <C: Collection<Byte>> ByteArray.filterNotTo(result: C, predica
*
* @includeFunctionBody ../../test/CollectionTest.kt filterNotNullIntoLinkedList
*/
public inline fun <C: Collection<Byte>> ByteArray?.filterNotNullTo(result: C) : C {
public inline fun <C: MutableCollection<Byte>> ByteArray?.filterNotNullTo(result: C) : C {
if (this != null) {
for (element in this) if (element != null) result.add(element)
}
@@ -111,7 +111,7 @@ public inline fun <C: Collection<Byte>> ByteArray?.filterNotNullTo(result: C) :
*
* @includeFunctionBody ../../test/CollectionTest.kt flatMap
*/
public inline fun <R> ByteArray.flatMapTo(result: Collection<R>, transform: (Byte) -> Collection<R>) : Collection<R> {
public inline fun <R> ByteArray.flatMapTo(result: MutableCollection<R>, transform: (Byte) -> Collection<R>) : Collection<R> {
for (element in this) {
val list = transform(element)
if (list != null) {
@@ -181,14 +181,14 @@ public inline fun ByteArray.reduceRight(operation: (Byte, Byte) -> Byte): Byte =
*
* @includeFunctionBody ../../test/CollectionTest.kt groupBy
*/
public inline fun <K> ByteArray.groupBy(toKey: (Byte) -> K) : Map<K, List<Byte>> = groupByTo<K>(HashMap<K, List<Byte>>(), toKey)
public inline fun <K> ByteArray.groupBy(toKey: (Byte) -> K) : Map<K, MutableList<Byte>> = groupByTo<K>(HashMap<K, MutableList<Byte>>(), toKey)
/**
* Groups the elements in the collection into the given [[Map]] using the supplied *toKey* function to calculate the key to group the elements by
*
* @includeFunctionBody ../../test/CollectionTest.kt groupBy
*/
public inline fun <K> ByteArray.groupByTo(result: Map<K, List<Byte>>, toKey: (Byte) -> K) : Map<K, List<Byte>> {
public inline fun <K> ByteArray.groupByTo(result: MutableMap<K, MutableList<Byte>>, toKey: (Byte) -> K) : Map<K, MutableList<Byte>> {
for (element in this) {
val key = toKey(element)
val list = result.getOrPut(key) { ArrayList<Byte>() }
@@ -212,7 +212,7 @@ public inline fun ByteArray.makeString(separator: String = ", ", prefix: String
}
/** Returns a list containing the everything but the first elements that satisfy the given *predicate* */
public inline fun <L: List<Byte>> ByteArray.dropWhileTo(result: L, predicate: (Byte) -> Boolean) : L {
public inline fun <L: MutableList<Byte>> ByteArray.dropWhileTo(result: L, predicate: (Byte) -> Boolean) : L {
var start = true
for (element in this) {
if (start && predicate(element)) {
@@ -226,13 +226,13 @@ public inline fun <L: List<Byte>> ByteArray.dropWhileTo(result: L, predicate: (B
}
/** Returns a list containing the first elements that satisfy the given *predicate* */
public inline fun <C: Collection<Byte>> ByteArray.takeWhileTo(result: C, predicate: (Byte) -> Boolean) : C {
public inline fun <C: MutableCollection<Byte>> ByteArray.takeWhileTo(result: C, predicate: (Byte) -> Boolean) : C {
for (element in this) if (predicate(element)) result.add(element) else break
return result
}
/** Copies all elements into the given collection */
public inline fun <C: Collection<Byte>> ByteArray.toCollection(result: C) : C {
public inline fun <C: MutableCollection<Byte>> ByteArray.toCollection(result: C) : C {
for (element in this) result.add(element)
return result
}
@@ -5,7 +5,7 @@ package kotlin
// NOTE THIS FILE IS AUTO-GENERATED by the GenerateStandardLib.kt
// See: https://github.com/JetBrains/kotlin/tree/master/libraries/stdlib
//
// Generated from input file: src/kotlin/JLangIterablesJVM.kt
// Generated from input file: JLangIterablesJVM.kt
//
@@ -5,13 +5,11 @@ package kotlin
// NOTE THIS FILE IS AUTO-GENERATED by the GenerateStandardLib.kt
// See: https://github.com/JetBrains/kotlin/tree/master/libraries/stdlib
//
// Generated from input file: src/kotlin/JLangIterablesLazy.kt
// Generated from input file: JLangIterablesLazy.kt
//
import java.util.ArrayList
import java.util.Collection
import java.util.List
//
// This file contains methods which could have a lazy implementation for things like
@@ -4,7 +4,7 @@ package kotlin
// NOTE THIS FILE IS AUTO-GENERATED by the GenerateStandardLib.kt
// See: https://github.com/JetBrains/kotlin/tree/master/libraries/stdlib
//
// Generated from input file: src/kotlin/JUtilCollections.kt
// Generated from input file: JUtilCollections.kt
//
@@ -21,7 +21,7 @@ import java.util.*
* Transforms each element of this collection with the given *transform* function and
* adds each return value to the given *results* collection
*/
public inline fun <R, C: Collection<in R>> ByteArray.mapTo(result: C, transform : (Byte) -> R) : C {
public inline fun <R, C: MutableCollection<in R>> ByteArray.mapTo(result: C, transform : (Byte) -> R) : C {
for (item in this)
result.add(transform(item))
return result
@@ -4,7 +4,7 @@ package kotlin
// NOTE THIS FILE IS AUTO-GENERATED by the GenerateStandardLib.kt
// See: https://github.com/JetBrains/kotlin/tree/master/libraries/stdlib
//
// Generated from input file: src/kotlin/JUtilCollectionsJVM.kt
// Generated from input file: JUtilCollectionsJVM.kt
//
@@ -22,6 +22,6 @@ import java.util.*
*
* @includeFunctionBody ../../test/CollectionTest.kt map
*/
public inline fun <R> ByteArray.map(transform : (Byte) -> R) : java.util.List<R> {
public inline fun <R> ByteArray.map(transform : (Byte) -> R) : List<R> {
return mapTo(java.util.ArrayList<R>(this.size), transform)
}
@@ -5,7 +5,7 @@ package kotlin
// NOTE THIS FILE IS AUTO-GENERATED by the GenerateStandardLib.kt
// See: https://github.com/JetBrains/kotlin/tree/master/libraries/stdlib
//
// Generated from input file: src/kotlin/JLangIterables.kt
// Generated from input file: JLangIterables.kt
//
@@ -79,7 +79,7 @@ public inline fun CharArray.find(predicate: (Char) -> Boolean) : Char? {
*
* @includeFunctionBody ../../test/CollectionTest.kt filterIntoLinkedList
*/
public inline fun <C: Collection<Char>> CharArray.filterTo(result: C, predicate: (Char) -> Boolean) : C {
public inline fun <C: MutableCollection<Char>> CharArray.filterTo(result: C, predicate: (Char) -> Boolean) : C {
for (element in this) if (predicate(element)) result.add(element)
return result
}
@@ -89,7 +89,7 @@ public inline fun <C: Collection<Char>> CharArray.filterTo(result: C, predicate:
*
* @includeFunctionBody ../../test/CollectionTest.kt filterNotIntoLinkedList
*/
public inline fun <C: Collection<Char>> CharArray.filterNotTo(result: C, predicate: (Char) -> Boolean) : C {
public inline fun <C: MutableCollection<Char>> CharArray.filterNotTo(result: C, predicate: (Char) -> Boolean) : C {
for (element in this) if (!predicate(element)) result.add(element)
return result
}
@@ -99,7 +99,7 @@ public inline fun <C: Collection<Char>> CharArray.filterNotTo(result: C, predica
*
* @includeFunctionBody ../../test/CollectionTest.kt filterNotNullIntoLinkedList
*/
public inline fun <C: Collection<Char>> CharArray?.filterNotNullTo(result: C) : C {
public inline fun <C: MutableCollection<Char>> CharArray?.filterNotNullTo(result: C) : C {
if (this != null) {
for (element in this) if (element != null) result.add(element)
}
@@ -111,7 +111,7 @@ public inline fun <C: Collection<Char>> CharArray?.filterNotNullTo(result: C) :
*
* @includeFunctionBody ../../test/CollectionTest.kt flatMap
*/
public inline fun <R> CharArray.flatMapTo(result: Collection<R>, transform: (Char) -> Collection<R>) : Collection<R> {
public inline fun <R> CharArray.flatMapTo(result: MutableCollection<R>, transform: (Char) -> Collection<R>) : Collection<R> {
for (element in this) {
val list = transform(element)
if (list != null) {
@@ -181,14 +181,14 @@ public inline fun CharArray.reduceRight(operation: (Char, Char) -> Char): Char =
*
* @includeFunctionBody ../../test/CollectionTest.kt groupBy
*/
public inline fun <K> CharArray.groupBy(toKey: (Char) -> K) : Map<K, List<Char>> = groupByTo<K>(HashMap<K, List<Char>>(), toKey)
public inline fun <K> CharArray.groupBy(toKey: (Char) -> K) : Map<K, MutableList<Char>> = groupByTo<K>(HashMap<K, MutableList<Char>>(), toKey)
/**
* Groups the elements in the collection into the given [[Map]] using the supplied *toKey* function to calculate the key to group the elements by
*
* @includeFunctionBody ../../test/CollectionTest.kt groupBy
*/
public inline fun <K> CharArray.groupByTo(result: Map<K, List<Char>>, toKey: (Char) -> K) : Map<K, List<Char>> {
public inline fun <K> CharArray.groupByTo(result: MutableMap<K, MutableList<Char>>, toKey: (Char) -> K) : Map<K, MutableList<Char>> {
for (element in this) {
val key = toKey(element)
val list = result.getOrPut(key) { ArrayList<Char>() }
@@ -212,7 +212,7 @@ public inline fun CharArray.makeString(separator: String = ", ", prefix: String
}
/** Returns a list containing the everything but the first elements that satisfy the given *predicate* */
public inline fun <L: List<Char>> CharArray.dropWhileTo(result: L, predicate: (Char) -> Boolean) : L {
public inline fun <L: MutableList<Char>> CharArray.dropWhileTo(result: L, predicate: (Char) -> Boolean) : L {
var start = true
for (element in this) {
if (start && predicate(element)) {
@@ -226,13 +226,13 @@ public inline fun <L: List<Char>> CharArray.dropWhileTo(result: L, predicate: (C
}
/** Returns a list containing the first elements that satisfy the given *predicate* */
public inline fun <C: Collection<Char>> CharArray.takeWhileTo(result: C, predicate: (Char) -> Boolean) : C {
public inline fun <C: MutableCollection<Char>> CharArray.takeWhileTo(result: C, predicate: (Char) -> Boolean) : C {
for (element in this) if (predicate(element)) result.add(element) else break
return result
}
/** Copies all elements into the given collection */
public inline fun <C: Collection<Char>> CharArray.toCollection(result: C) : C {
public inline fun <C: MutableCollection<Char>> CharArray.toCollection(result: C) : C {
for (element in this) result.add(element)
return result
}
@@ -5,7 +5,7 @@ package kotlin
// NOTE THIS FILE IS AUTO-GENERATED by the GenerateStandardLib.kt
// See: https://github.com/JetBrains/kotlin/tree/master/libraries/stdlib
//
// Generated from input file: src/kotlin/JLangIterablesJVM.kt
// Generated from input file: JLangIterablesJVM.kt
//
@@ -5,13 +5,11 @@ package kotlin
// NOTE THIS FILE IS AUTO-GENERATED by the GenerateStandardLib.kt
// See: https://github.com/JetBrains/kotlin/tree/master/libraries/stdlib
//
// Generated from input file: src/kotlin/JLangIterablesLazy.kt
// Generated from input file: JLangIterablesLazy.kt
//
import java.util.ArrayList
import java.util.Collection
import java.util.List
//
// This file contains methods which could have a lazy implementation for things like
@@ -4,7 +4,7 @@ package kotlin
// NOTE THIS FILE IS AUTO-GENERATED by the GenerateStandardLib.kt
// See: https://github.com/JetBrains/kotlin/tree/master/libraries/stdlib
//
// Generated from input file: src/kotlin/JUtilCollections.kt
// Generated from input file: JUtilCollections.kt
//
@@ -21,7 +21,7 @@ import java.util.*
* Transforms each element of this collection with the given *transform* function and
* adds each return value to the given *results* collection
*/
public inline fun <R, C: Collection<in R>> CharArray.mapTo(result: C, transform : (Char) -> R) : C {
public inline fun <R, C: MutableCollection<in R>> CharArray.mapTo(result: C, transform : (Char) -> R) : C {
for (item in this)
result.add(transform(item))
return result
@@ -4,7 +4,7 @@ package kotlin
// NOTE THIS FILE IS AUTO-GENERATED by the GenerateStandardLib.kt
// See: https://github.com/JetBrains/kotlin/tree/master/libraries/stdlib
//
// Generated from input file: src/kotlin/JUtilCollectionsJVM.kt
// Generated from input file: JUtilCollectionsJVM.kt
//
@@ -22,6 +22,6 @@ import java.util.*
*
* @includeFunctionBody ../../test/CollectionTest.kt map
*/
public inline fun <R> CharArray.map(transform : (Char) -> R) : java.util.List<R> {
public inline fun <R> CharArray.map(transform : (Char) -> R) : List<R> {
return mapTo(java.util.ArrayList<R>(this.size), transform)
}
@@ -5,7 +5,7 @@ package kotlin
// NOTE THIS FILE IS AUTO-GENERATED by the GenerateStandardLib.kt
// See: https://github.com/JetBrains/kotlin/tree/master/libraries/stdlib
//
// Generated from input file: src/kotlin/JLangIterables.kt
// Generated from input file: JLangIterables.kt
//
@@ -79,7 +79,7 @@ public inline fun DoubleArray.find(predicate: (Double) -> Boolean) : Double? {
*
* @includeFunctionBody ../../test/CollectionTest.kt filterIntoLinkedList
*/
public inline fun <C: Collection<Double>> DoubleArray.filterTo(result: C, predicate: (Double) -> Boolean) : C {
public inline fun <C: MutableCollection<Double>> DoubleArray.filterTo(result: C, predicate: (Double) -> Boolean) : C {
for (element in this) if (predicate(element)) result.add(element)
return result
}
@@ -89,7 +89,7 @@ public inline fun <C: Collection<Double>> DoubleArray.filterTo(result: C, predic
*
* @includeFunctionBody ../../test/CollectionTest.kt filterNotIntoLinkedList
*/
public inline fun <C: Collection<Double>> DoubleArray.filterNotTo(result: C, predicate: (Double) -> Boolean) : C {
public inline fun <C: MutableCollection<Double>> DoubleArray.filterNotTo(result: C, predicate: (Double) -> Boolean) : C {
for (element in this) if (!predicate(element)) result.add(element)
return result
}
@@ -99,7 +99,7 @@ public inline fun <C: Collection<Double>> DoubleArray.filterNotTo(result: C, pre
*
* @includeFunctionBody ../../test/CollectionTest.kt filterNotNullIntoLinkedList
*/
public inline fun <C: Collection<Double>> DoubleArray?.filterNotNullTo(result: C) : C {
public inline fun <C: MutableCollection<Double>> DoubleArray?.filterNotNullTo(result: C) : C {
if (this != null) {
for (element in this) if (element != null) result.add(element)
}
@@ -111,7 +111,7 @@ public inline fun <C: Collection<Double>> DoubleArray?.filterNotNullTo(result: C
*
* @includeFunctionBody ../../test/CollectionTest.kt flatMap
*/
public inline fun <R> DoubleArray.flatMapTo(result: Collection<R>, transform: (Double) -> Collection<R>) : Collection<R> {
public inline fun <R> DoubleArray.flatMapTo(result: MutableCollection<R>, transform: (Double) -> Collection<R>) : Collection<R> {
for (element in this) {
val list = transform(element)
if (list != null) {
@@ -181,14 +181,14 @@ public inline fun DoubleArray.reduceRight(operation: (Double, Double) -> Double)
*
* @includeFunctionBody ../../test/CollectionTest.kt groupBy
*/
public inline fun <K> DoubleArray.groupBy(toKey: (Double) -> K) : Map<K, List<Double>> = groupByTo<K>(HashMap<K, List<Double>>(), toKey)
public inline fun <K> DoubleArray.groupBy(toKey: (Double) -> K) : Map<K, MutableList<Double>> = groupByTo<K>(HashMap<K, MutableList<Double>>(), toKey)
/**
* Groups the elements in the collection into the given [[Map]] using the supplied *toKey* function to calculate the key to group the elements by
*
* @includeFunctionBody ../../test/CollectionTest.kt groupBy
*/
public inline fun <K> DoubleArray.groupByTo(result: Map<K, List<Double>>, toKey: (Double) -> K) : Map<K, List<Double>> {
public inline fun <K> DoubleArray.groupByTo(result: MutableMap<K, MutableList<Double>>, toKey: (Double) -> K) : Map<K, MutableList<Double>> {
for (element in this) {
val key = toKey(element)
val list = result.getOrPut(key) { ArrayList<Double>() }
@@ -212,7 +212,7 @@ public inline fun DoubleArray.makeString(separator: String = ", ", prefix: Strin
}
/** Returns a list containing the everything but the first elements that satisfy the given *predicate* */
public inline fun <L: List<Double>> DoubleArray.dropWhileTo(result: L, predicate: (Double) -> Boolean) : L {
public inline fun <L: MutableList<Double>> DoubleArray.dropWhileTo(result: L, predicate: (Double) -> Boolean) : L {
var start = true
for (element in this) {
if (start && predicate(element)) {
@@ -226,13 +226,13 @@ public inline fun <L: List<Double>> DoubleArray.dropWhileTo(result: L, predicate
}
/** Returns a list containing the first elements that satisfy the given *predicate* */
public inline fun <C: Collection<Double>> DoubleArray.takeWhileTo(result: C, predicate: (Double) -> Boolean) : C {
public inline fun <C: MutableCollection<Double>> DoubleArray.takeWhileTo(result: C, predicate: (Double) -> Boolean) : C {
for (element in this) if (predicate(element)) result.add(element) else break
return result
}
/** Copies all elements into the given collection */
public inline fun <C: Collection<Double>> DoubleArray.toCollection(result: C) : C {
public inline fun <C: MutableCollection<Double>> DoubleArray.toCollection(result: C) : C {
for (element in this) result.add(element)
return result
}
@@ -5,7 +5,7 @@ package kotlin
// NOTE THIS FILE IS AUTO-GENERATED by the GenerateStandardLib.kt
// See: https://github.com/JetBrains/kotlin/tree/master/libraries/stdlib
//
// Generated from input file: src/kotlin/JLangIterablesJVM.kt
// Generated from input file: JLangIterablesJVM.kt
//
@@ -5,13 +5,11 @@ package kotlin
// NOTE THIS FILE IS AUTO-GENERATED by the GenerateStandardLib.kt
// See: https://github.com/JetBrains/kotlin/tree/master/libraries/stdlib
//
// Generated from input file: src/kotlin/JLangIterablesLazy.kt
// Generated from input file: JLangIterablesLazy.kt
//
import java.util.ArrayList
import java.util.Collection
import java.util.List
//
// This file contains methods which could have a lazy implementation for things like
@@ -4,7 +4,7 @@ package kotlin
// NOTE THIS FILE IS AUTO-GENERATED by the GenerateStandardLib.kt
// See: https://github.com/JetBrains/kotlin/tree/master/libraries/stdlib
//
// Generated from input file: src/kotlin/JUtilCollections.kt
// Generated from input file: JUtilCollections.kt
//
@@ -21,7 +21,7 @@ import java.util.*
* Transforms each element of this collection with the given *transform* function and
* adds each return value to the given *results* collection
*/
public inline fun <R, C: Collection<in R>> DoubleArray.mapTo(result: C, transform : (Double) -> R) : C {
public inline fun <R, C: MutableCollection<in R>> DoubleArray.mapTo(result: C, transform : (Double) -> R) : C {
for (item in this)
result.add(transform(item))
return result
@@ -4,7 +4,7 @@ package kotlin
// NOTE THIS FILE IS AUTO-GENERATED by the GenerateStandardLib.kt
// See: https://github.com/JetBrains/kotlin/tree/master/libraries/stdlib
//
// Generated from input file: src/kotlin/JUtilCollectionsJVM.kt
// Generated from input file: JUtilCollectionsJVM.kt
//
@@ -22,6 +22,6 @@ import java.util.*
*
* @includeFunctionBody ../../test/CollectionTest.kt map
*/
public inline fun <R> DoubleArray.map(transform : (Double) -> R) : java.util.List<R> {
public inline fun <R> DoubleArray.map(transform : (Double) -> R) : List<R> {
return mapTo(java.util.ArrayList<R>(this.size), transform)
}
@@ -5,7 +5,7 @@ package kotlin
// NOTE THIS FILE IS AUTO-GENERATED by the GenerateStandardLib.kt
// See: https://github.com/JetBrains/kotlin/tree/master/libraries/stdlib
//
// Generated from input file: src/kotlin/JLangIterables.kt
// Generated from input file: JLangIterables.kt
//
@@ -79,7 +79,7 @@ public inline fun FloatArray.find(predicate: (Float) -> Boolean) : Float? {
*
* @includeFunctionBody ../../test/CollectionTest.kt filterIntoLinkedList
*/
public inline fun <C: Collection<Float>> FloatArray.filterTo(result: C, predicate: (Float) -> Boolean) : C {
public inline fun <C: MutableCollection<Float>> FloatArray.filterTo(result: C, predicate: (Float) -> Boolean) : C {
for (element in this) if (predicate(element)) result.add(element)
return result
}
@@ -89,7 +89,7 @@ public inline fun <C: Collection<Float>> FloatArray.filterTo(result: C, predicat
*
* @includeFunctionBody ../../test/CollectionTest.kt filterNotIntoLinkedList
*/
public inline fun <C: Collection<Float>> FloatArray.filterNotTo(result: C, predicate: (Float) -> Boolean) : C {
public inline fun <C: MutableCollection<Float>> FloatArray.filterNotTo(result: C, predicate: (Float) -> Boolean) : C {
for (element in this) if (!predicate(element)) result.add(element)
return result
}
@@ -99,7 +99,7 @@ public inline fun <C: Collection<Float>> FloatArray.filterNotTo(result: C, predi
*
* @includeFunctionBody ../../test/CollectionTest.kt filterNotNullIntoLinkedList
*/
public inline fun <C: Collection<Float>> FloatArray?.filterNotNullTo(result: C) : C {
public inline fun <C: MutableCollection<Float>> FloatArray?.filterNotNullTo(result: C) : C {
if (this != null) {
for (element in this) if (element != null) result.add(element)
}
@@ -111,7 +111,7 @@ public inline fun <C: Collection<Float>> FloatArray?.filterNotNullTo(result: C)
*
* @includeFunctionBody ../../test/CollectionTest.kt flatMap
*/
public inline fun <R> FloatArray.flatMapTo(result: Collection<R>, transform: (Float) -> Collection<R>) : Collection<R> {
public inline fun <R> FloatArray.flatMapTo(result: MutableCollection<R>, transform: (Float) -> Collection<R>) : Collection<R> {
for (element in this) {
val list = transform(element)
if (list != null) {
@@ -181,14 +181,14 @@ public inline fun FloatArray.reduceRight(operation: (Float, Float) -> Float): Fl
*
* @includeFunctionBody ../../test/CollectionTest.kt groupBy
*/
public inline fun <K> FloatArray.groupBy(toKey: (Float) -> K) : Map<K, List<Float>> = groupByTo<K>(HashMap<K, List<Float>>(), toKey)
public inline fun <K> FloatArray.groupBy(toKey: (Float) -> K) : Map<K, MutableList<Float>> = groupByTo<K>(HashMap<K, MutableList<Float>>(), toKey)
/**
* Groups the elements in the collection into the given [[Map]] using the supplied *toKey* function to calculate the key to group the elements by
*
* @includeFunctionBody ../../test/CollectionTest.kt groupBy
*/
public inline fun <K> FloatArray.groupByTo(result: Map<K, List<Float>>, toKey: (Float) -> K) : Map<K, List<Float>> {
public inline fun <K> FloatArray.groupByTo(result: MutableMap<K, MutableList<Float>>, toKey: (Float) -> K) : Map<K, MutableList<Float>> {
for (element in this) {
val key = toKey(element)
val list = result.getOrPut(key) { ArrayList<Float>() }
@@ -212,7 +212,7 @@ public inline fun FloatArray.makeString(separator: String = ", ", prefix: String
}
/** Returns a list containing the everything but the first elements that satisfy the given *predicate* */
public inline fun <L: List<Float>> FloatArray.dropWhileTo(result: L, predicate: (Float) -> Boolean) : L {
public inline fun <L: MutableList<Float>> FloatArray.dropWhileTo(result: L, predicate: (Float) -> Boolean) : L {
var start = true
for (element in this) {
if (start && predicate(element)) {
@@ -226,13 +226,13 @@ public inline fun <L: List<Float>> FloatArray.dropWhileTo(result: L, predicate:
}
/** Returns a list containing the first elements that satisfy the given *predicate* */
public inline fun <C: Collection<Float>> FloatArray.takeWhileTo(result: C, predicate: (Float) -> Boolean) : C {
public inline fun <C: MutableCollection<Float>> FloatArray.takeWhileTo(result: C, predicate: (Float) -> Boolean) : C {
for (element in this) if (predicate(element)) result.add(element) else break
return result
}
/** Copies all elements into the given collection */
public inline fun <C: Collection<Float>> FloatArray.toCollection(result: C) : C {
public inline fun <C: MutableCollection<Float>> FloatArray.toCollection(result: C) : C {
for (element in this) result.add(element)
return result
}
@@ -5,7 +5,7 @@ package kotlin
// NOTE THIS FILE IS AUTO-GENERATED by the GenerateStandardLib.kt
// See: https://github.com/JetBrains/kotlin/tree/master/libraries/stdlib
//
// Generated from input file: src/kotlin/JLangIterablesJVM.kt
// Generated from input file: JLangIterablesJVM.kt
//
@@ -5,13 +5,11 @@ package kotlin
// NOTE THIS FILE IS AUTO-GENERATED by the GenerateStandardLib.kt
// See: https://github.com/JetBrains/kotlin/tree/master/libraries/stdlib
//
// Generated from input file: src/kotlin/JLangIterablesLazy.kt
// Generated from input file: JLangIterablesLazy.kt
//
import java.util.ArrayList
import java.util.Collection
import java.util.List
//
// This file contains methods which could have a lazy implementation for things like
@@ -4,7 +4,7 @@ package kotlin
// NOTE THIS FILE IS AUTO-GENERATED by the GenerateStandardLib.kt
// See: https://github.com/JetBrains/kotlin/tree/master/libraries/stdlib
//
// Generated from input file: src/kotlin/JUtilCollections.kt
// Generated from input file: JUtilCollections.kt
//
@@ -21,7 +21,7 @@ import java.util.*
* Transforms each element of this collection with the given *transform* function and
* adds each return value to the given *results* collection
*/
public inline fun <R, C: Collection<in R>> FloatArray.mapTo(result: C, transform : (Float) -> R) : C {
public inline fun <R, C: MutableCollection<in R>> FloatArray.mapTo(result: C, transform : (Float) -> R) : C {
for (item in this)
result.add(transform(item))
return result
@@ -4,7 +4,7 @@ package kotlin
// NOTE THIS FILE IS AUTO-GENERATED by the GenerateStandardLib.kt
// See: https://github.com/JetBrains/kotlin/tree/master/libraries/stdlib
//
// Generated from input file: src/kotlin/JUtilCollectionsJVM.kt
// Generated from input file: JUtilCollectionsJVM.kt
//
@@ -22,6 +22,6 @@ import java.util.*
*
* @includeFunctionBody ../../test/CollectionTest.kt map
*/
public inline fun <R> FloatArray.map(transform : (Float) -> R) : java.util.List<R> {
public inline fun <R> FloatArray.map(transform : (Float) -> R) : List<R> {
return mapTo(java.util.ArrayList<R>(this.size), transform)
}
@@ -5,7 +5,7 @@ package kotlin
// NOTE THIS FILE IS AUTO-GENERATED by the GenerateStandardLib.kt
// See: https://github.com/JetBrains/kotlin/tree/master/libraries/stdlib
//
// Generated from input file: src/kotlin/JLangIterables.kt
// Generated from input file: JLangIterables.kt
//
@@ -79,7 +79,7 @@ public inline fun IntArray.find(predicate: (Int) -> Boolean) : Int? {
*
* @includeFunctionBody ../../test/CollectionTest.kt filterIntoLinkedList
*/
public inline fun <C: Collection<Int>> IntArray.filterTo(result: C, predicate: (Int) -> Boolean) : C {
public inline fun <C: MutableCollection<Int>> IntArray.filterTo(result: C, predicate: (Int) -> Boolean) : C {
for (element in this) if (predicate(element)) result.add(element)
return result
}
@@ -89,7 +89,7 @@ public inline fun <C: Collection<Int>> IntArray.filterTo(result: C, predicate: (
*
* @includeFunctionBody ../../test/CollectionTest.kt filterNotIntoLinkedList
*/
public inline fun <C: Collection<Int>> IntArray.filterNotTo(result: C, predicate: (Int) -> Boolean) : C {
public inline fun <C: MutableCollection<Int>> IntArray.filterNotTo(result: C, predicate: (Int) -> Boolean) : C {
for (element in this) if (!predicate(element)) result.add(element)
return result
}
@@ -99,7 +99,7 @@ public inline fun <C: Collection<Int>> IntArray.filterNotTo(result: C, predicate
*
* @includeFunctionBody ../../test/CollectionTest.kt filterNotNullIntoLinkedList
*/
public inline fun <C: Collection<Int>> IntArray?.filterNotNullTo(result: C) : C {
public inline fun <C: MutableCollection<Int>> IntArray?.filterNotNullTo(result: C) : C {
if (this != null) {
for (element in this) if (element != null) result.add(element)
}
@@ -111,7 +111,7 @@ public inline fun <C: Collection<Int>> IntArray?.filterNotNullTo(result: C) : C
*
* @includeFunctionBody ../../test/CollectionTest.kt flatMap
*/
public inline fun <R> IntArray.flatMapTo(result: Collection<R>, transform: (Int) -> Collection<R>) : Collection<R> {
public inline fun <R> IntArray.flatMapTo(result: MutableCollection<R>, transform: (Int) -> Collection<R>) : Collection<R> {
for (element in this) {
val list = transform(element)
if (list != null) {
@@ -181,14 +181,14 @@ public inline fun IntArray.reduceRight(operation: (Int, Int) -> Int): Int = reve
*
* @includeFunctionBody ../../test/CollectionTest.kt groupBy
*/
public inline fun <K> IntArray.groupBy(toKey: (Int) -> K) : Map<K, List<Int>> = groupByTo<K>(HashMap<K, List<Int>>(), toKey)
public inline fun <K> IntArray.groupBy(toKey: (Int) -> K) : Map<K, MutableList<Int>> = groupByTo<K>(HashMap<K, MutableList<Int>>(), toKey)
/**
* Groups the elements in the collection into the given [[Map]] using the supplied *toKey* function to calculate the key to group the elements by
*
* @includeFunctionBody ../../test/CollectionTest.kt groupBy
*/
public inline fun <K> IntArray.groupByTo(result: Map<K, List<Int>>, toKey: (Int) -> K) : Map<K, List<Int>> {
public inline fun <K> IntArray.groupByTo(result: MutableMap<K, MutableList<Int>>, toKey: (Int) -> K) : Map<K, MutableList<Int>> {
for (element in this) {
val key = toKey(element)
val list = result.getOrPut(key) { ArrayList<Int>() }
@@ -212,7 +212,7 @@ public inline fun IntArray.makeString(separator: String = ", ", prefix: String =
}
/** Returns a list containing the everything but the first elements that satisfy the given *predicate* */
public inline fun <L: List<Int>> IntArray.dropWhileTo(result: L, predicate: (Int) -> Boolean) : L {
public inline fun <L: MutableList<Int>> IntArray.dropWhileTo(result: L, predicate: (Int) -> Boolean) : L {
var start = true
for (element in this) {
if (start && predicate(element)) {
@@ -226,13 +226,13 @@ public inline fun <L: List<Int>> IntArray.dropWhileTo(result: L, predicate: (Int
}
/** Returns a list containing the first elements that satisfy the given *predicate* */
public inline fun <C: Collection<Int>> IntArray.takeWhileTo(result: C, predicate: (Int) -> Boolean) : C {
public inline fun <C: MutableCollection<Int>> IntArray.takeWhileTo(result: C, predicate: (Int) -> Boolean) : C {
for (element in this) if (predicate(element)) result.add(element) else break
return result
}
/** Copies all elements into the given collection */
public inline fun <C: Collection<Int>> IntArray.toCollection(result: C) : C {
public inline fun <C: MutableCollection<Int>> IntArray.toCollection(result: C) : C {
for (element in this) result.add(element)
return result
}
@@ -5,7 +5,7 @@ package kotlin
// NOTE THIS FILE IS AUTO-GENERATED by the GenerateStandardLib.kt
// See: https://github.com/JetBrains/kotlin/tree/master/libraries/stdlib
//
// Generated from input file: src/kotlin/JLangIterablesJVM.kt
// Generated from input file: JLangIterablesJVM.kt
//
@@ -5,13 +5,11 @@ package kotlin
// NOTE THIS FILE IS AUTO-GENERATED by the GenerateStandardLib.kt
// See: https://github.com/JetBrains/kotlin/tree/master/libraries/stdlib
//
// Generated from input file: src/kotlin/JLangIterablesLazy.kt
// Generated from input file: JLangIterablesLazy.kt
//
import java.util.ArrayList
import java.util.Collection
import java.util.List
//
// This file contains methods which could have a lazy implementation for things like
@@ -4,7 +4,7 @@ package kotlin
// NOTE THIS FILE IS AUTO-GENERATED by the GenerateStandardLib.kt
// See: https://github.com/JetBrains/kotlin/tree/master/libraries/stdlib
//
// Generated from input file: src/kotlin/JUtilCollections.kt
// Generated from input file: JUtilCollections.kt
//
@@ -21,7 +21,7 @@ import java.util.*
* Transforms each element of this collection with the given *transform* function and
* adds each return value to the given *results* collection
*/
public inline fun <R, C: Collection<in R>> IntArray.mapTo(result: C, transform : (Int) -> R) : C {
public inline fun <R, C: MutableCollection<in R>> IntArray.mapTo(result: C, transform : (Int) -> R) : C {
for (item in this)
result.add(transform(item))
return result
@@ -4,7 +4,7 @@ package kotlin
// NOTE THIS FILE IS AUTO-GENERATED by the GenerateStandardLib.kt
// See: https://github.com/JetBrains/kotlin/tree/master/libraries/stdlib
//
// Generated from input file: src/kotlin/JUtilCollectionsJVM.kt
// Generated from input file: JUtilCollectionsJVM.kt
//
@@ -22,6 +22,6 @@ import java.util.*
*
* @includeFunctionBody ../../test/CollectionTest.kt map
*/
public inline fun <R> IntArray.map(transform : (Int) -> R) : java.util.List<R> {
public inline fun <R> IntArray.map(transform : (Int) -> R) : List<R> {
return mapTo(java.util.ArrayList<R>(this.size), transform)
}
@@ -4,7 +4,7 @@ package kotlin
// NOTE THIS FILE IS AUTO-GENERATED by the GenerateStandardLib.kt
// See: https://github.com/JetBrains/kotlin/tree/master/libraries/stdlib
//
// Generated from input file: src/kotlin/JLangIterables.kt
// Generated from input file: JLangIterables.kt
//
@@ -78,7 +78,7 @@ public inline fun <T> Iterator<T>.find(predicate: (T) -> Boolean) : T? {
*
* @includeFunctionBody ../../test/CollectionTest.kt filterIntoLinkedList
*/
public inline fun <T, C: Collection<in T>> Iterator<T>.filterTo(result: C, predicate: (T) -> Boolean) : C {
public inline fun <T, C: MutableCollection<in T>> Iterator<T>.filterTo(result: C, predicate: (T) -> Boolean) : C {
for (element in this) if (predicate(element)) result.add(element)
return result
}
@@ -88,7 +88,7 @@ public inline fun <T, C: Collection<in T>> Iterator<T>.filterTo(result: C, predi
*
* @includeFunctionBody ../../test/CollectionTest.kt filterNotIntoLinkedList
*/
public inline fun <T, C: Collection<in T>> Iterator<T>.filterNotTo(result: C, predicate: (T) -> Boolean) : C {
public inline fun <T, C: MutableCollection<in T>> Iterator<T>.filterNotTo(result: C, predicate: (T) -> Boolean) : C {
for (element in this) if (!predicate(element)) result.add(element)
return result
}
@@ -98,7 +98,7 @@ public inline fun <T, C: Collection<in T>> Iterator<T>.filterNotTo(result: C, pr
*
* @includeFunctionBody ../../test/CollectionTest.kt filterNotNullIntoLinkedList
*/
public inline fun <T, C: Collection<in T>> Iterator<T?>?.filterNotNullTo(result: C) : C {
public inline fun <T, C: MutableCollection<in T>> Iterator<T?>?.filterNotNullTo(result: C) : C {
if (this != null) {
for (element in this) if (element != null) result.add(element)
}
@@ -110,7 +110,7 @@ public inline fun <T, C: Collection<in T>> Iterator<T?>?.filterNotNullTo(result:
*
* @includeFunctionBody ../../test/CollectionTest.kt flatMap
*/
public inline fun <T, R> Iterator<T>.flatMapTo(result: Collection<R>, transform: (T) -> Collection<R>) : Collection<R> {
public inline fun <T, R> Iterator<T>.flatMapTo(result: MutableCollection<R>, transform: (T) -> Collection<R>) : Collection<R> {
for (element in this) {
val list = transform(element)
if (list != null) {
@@ -180,14 +180,14 @@ public inline fun <T> Iterator<T>.reduceRight(operation: (T, T) -> T): T = rever
*
* @includeFunctionBody ../../test/CollectionTest.kt groupBy
*/
public inline fun <T, K> Iterator<T>.groupBy(toKey: (T) -> K) : Map<K, List<T>> = groupByTo<T,K>(HashMap<K, List<T>>(), toKey)
public inline fun <T, K> Iterator<T>.groupBy(toKey: (T) -> K) : Map<K, MutableList<T>> = groupByTo<T,K>(HashMap<K, MutableList<T>>(), toKey)
/**
* Groups the elements in the collection into the given [[Map]] using the supplied *toKey* function to calculate the key to group the elements by
*
* @includeFunctionBody ../../test/CollectionTest.kt groupBy
*/
public inline fun <T, K> Iterator<T>.groupByTo(result: Map<K, List<T>>, toKey: (T) -> K) : Map<K, List<T>> {
public inline fun <T, K> Iterator<T>.groupByTo(result: MutableMap<K, MutableList<T>>, toKey: (T) -> K) : Map<K, MutableList<T>> {
for (element in this) {
val key = toKey(element)
val list = result.getOrPut(key) { ArrayList<T>() }
@@ -211,7 +211,7 @@ public inline fun <T> Iterator<T>.makeString(separator: String = ", ", prefix: S
}
/** Returns a list containing the everything but the first elements that satisfy the given *predicate* */
public inline fun <T, L: List<in T>> Iterator<T>.dropWhileTo(result: L, predicate: (T) -> Boolean) : L {
public inline fun <T, L: MutableList<in T>> Iterator<T>.dropWhileTo(result: L, predicate: (T) -> Boolean) : L {
var start = true
for (element in this) {
if (start && predicate(element)) {
@@ -225,13 +225,13 @@ public inline fun <T, L: List<in T>> Iterator<T>.dropWhileTo(result: L, predicat
}
/** Returns a list containing the first elements that satisfy the given *predicate* */
public inline fun <T, C: Collection<in T>> Iterator<T>.takeWhileTo(result: C, predicate: (T) -> Boolean) : C {
public inline fun <T, C: MutableCollection<in T>> Iterator<T>.takeWhileTo(result: C, predicate: (T) -> Boolean) : C {
for (element in this) if (predicate(element)) result.add(element) else break
return result
}
/** Copies all elements into the given collection */
public inline fun <in T, C: Collection<in T>> Iterator<T>.toCollection(result: C) : C {
public inline fun <in T, C: MutableCollection<in T>> Iterator<T>.toCollection(result: C) : C {
for (element in this) result.add(element)
return result
}
@@ -4,7 +4,7 @@ package kotlin
// NOTE THIS FILE IS AUTO-GENERATED by the GenerateStandardLib.kt
// See: https://github.com/JetBrains/kotlin/tree/master/libraries/stdlib
//
// Generated from input file: src/kotlin/JLangIterablesJVM.kt
// Generated from input file: JLangIterablesJVM.kt
//
@@ -5,7 +5,7 @@ package kotlin
// NOTE THIS FILE IS AUTO-GENERATED by the GenerateStandardLib.kt
// See: https://github.com/JetBrains/kotlin/tree/master/libraries/stdlib
//
// Generated from input file: src/kotlin/JLangIterables.kt
// Generated from input file: JLangIterables.kt
//
@@ -79,7 +79,7 @@ public inline fun LongArray.find(predicate: (Long) -> Boolean) : Long? {
*
* @includeFunctionBody ../../test/CollectionTest.kt filterIntoLinkedList
*/
public inline fun <C: Collection<Long>> LongArray.filterTo(result: C, predicate: (Long) -> Boolean) : C {
public inline fun <C: MutableCollection<Long>> LongArray.filterTo(result: C, predicate: (Long) -> Boolean) : C {
for (element in this) if (predicate(element)) result.add(element)
return result
}
@@ -89,7 +89,7 @@ public inline fun <C: Collection<Long>> LongArray.filterTo(result: C, predicate:
*
* @includeFunctionBody ../../test/CollectionTest.kt filterNotIntoLinkedList
*/
public inline fun <C: Collection<Long>> LongArray.filterNotTo(result: C, predicate: (Long) -> Boolean) : C {
public inline fun <C: MutableCollection<Long>> LongArray.filterNotTo(result: C, predicate: (Long) -> Boolean) : C {
for (element in this) if (!predicate(element)) result.add(element)
return result
}
@@ -99,7 +99,7 @@ public inline fun <C: Collection<Long>> LongArray.filterNotTo(result: C, predica
*
* @includeFunctionBody ../../test/CollectionTest.kt filterNotNullIntoLinkedList
*/
public inline fun <C: Collection<Long>> LongArray?.filterNotNullTo(result: C) : C {
public inline fun <C: MutableCollection<Long>> LongArray?.filterNotNullTo(result: C) : C {
if (this != null) {
for (element in this) if (element != null) result.add(element)
}
@@ -111,7 +111,7 @@ public inline fun <C: Collection<Long>> LongArray?.filterNotNullTo(result: C) :
*
* @includeFunctionBody ../../test/CollectionTest.kt flatMap
*/
public inline fun <R> LongArray.flatMapTo(result: Collection<R>, transform: (Long) -> Collection<R>) : Collection<R> {
public inline fun <R> LongArray.flatMapTo(result: MutableCollection<R>, transform: (Long) -> Collection<R>) : Collection<R> {
for (element in this) {
val list = transform(element)
if (list != null) {
@@ -181,14 +181,14 @@ public inline fun LongArray.reduceRight(operation: (Long, Long) -> Long): Long =
*
* @includeFunctionBody ../../test/CollectionTest.kt groupBy
*/
public inline fun <K> LongArray.groupBy(toKey: (Long) -> K) : Map<K, List<Long>> = groupByTo<K>(HashMap<K, List<Long>>(), toKey)
public inline fun <K> LongArray.groupBy(toKey: (Long) -> K) : Map<K, MutableList<Long>> = groupByTo<K>(HashMap<K, MutableList<Long>>(), toKey)
/**
* Groups the elements in the collection into the given [[Map]] using the supplied *toKey* function to calculate the key to group the elements by
*
* @includeFunctionBody ../../test/CollectionTest.kt groupBy
*/
public inline fun <K> LongArray.groupByTo(result: Map<K, List<Long>>, toKey: (Long) -> K) : Map<K, List<Long>> {
public inline fun <K> LongArray.groupByTo(result: MutableMap<K, MutableList<Long>>, toKey: (Long) -> K) : Map<K, MutableList<Long>> {
for (element in this) {
val key = toKey(element)
val list = result.getOrPut(key) { ArrayList<Long>() }
@@ -212,7 +212,7 @@ public inline fun LongArray.makeString(separator: String = ", ", prefix: String
}
/** Returns a list containing the everything but the first elements that satisfy the given *predicate* */
public inline fun <L: List<Long>> LongArray.dropWhileTo(result: L, predicate: (Long) -> Boolean) : L {
public inline fun <L: MutableList<Long>> LongArray.dropWhileTo(result: L, predicate: (Long) -> Boolean) : L {
var start = true
for (element in this) {
if (start && predicate(element)) {
@@ -226,13 +226,13 @@ public inline fun <L: List<Long>> LongArray.dropWhileTo(result: L, predicate: (L
}
/** Returns a list containing the first elements that satisfy the given *predicate* */
public inline fun <C: Collection<Long>> LongArray.takeWhileTo(result: C, predicate: (Long) -> Boolean) : C {
public inline fun <C: MutableCollection<Long>> LongArray.takeWhileTo(result: C, predicate: (Long) -> Boolean) : C {
for (element in this) if (predicate(element)) result.add(element) else break
return result
}
/** Copies all elements into the given collection */
public inline fun <C: Collection<Long>> LongArray.toCollection(result: C) : C {
public inline fun <C: MutableCollection<Long>> LongArray.toCollection(result: C) : C {
for (element in this) result.add(element)
return result
}
@@ -5,7 +5,7 @@ package kotlin
// NOTE THIS FILE IS AUTO-GENERATED by the GenerateStandardLib.kt
// See: https://github.com/JetBrains/kotlin/tree/master/libraries/stdlib
//
// Generated from input file: src/kotlin/JLangIterablesJVM.kt
// Generated from input file: JLangIterablesJVM.kt
//
@@ -5,13 +5,11 @@ package kotlin
// NOTE THIS FILE IS AUTO-GENERATED by the GenerateStandardLib.kt
// See: https://github.com/JetBrains/kotlin/tree/master/libraries/stdlib
//
// Generated from input file: src/kotlin/JLangIterablesLazy.kt
// Generated from input file: JLangIterablesLazy.kt
//
import java.util.ArrayList
import java.util.Collection
import java.util.List
//
// This file contains methods which could have a lazy implementation for things like
@@ -4,7 +4,7 @@ package kotlin
// NOTE THIS FILE IS AUTO-GENERATED by the GenerateStandardLib.kt
// See: https://github.com/JetBrains/kotlin/tree/master/libraries/stdlib
//
// Generated from input file: src/kotlin/JUtilCollections.kt
// Generated from input file: JUtilCollections.kt
//
@@ -21,7 +21,7 @@ import java.util.*
* Transforms each element of this collection with the given *transform* function and
* adds each return value to the given *results* collection
*/
public inline fun <R, C: Collection<in R>> LongArray.mapTo(result: C, transform : (Long) -> R) : C {
public inline fun <R, C: MutableCollection<in R>> LongArray.mapTo(result: C, transform : (Long) -> R) : C {
for (item in this)
result.add(transform(item))
return result
@@ -4,7 +4,7 @@ package kotlin
// NOTE THIS FILE IS AUTO-GENERATED by the GenerateStandardLib.kt
// See: https://github.com/JetBrains/kotlin/tree/master/libraries/stdlib
//
// Generated from input file: src/kotlin/JUtilCollectionsJVM.kt
// Generated from input file: JUtilCollectionsJVM.kt
//
@@ -22,6 +22,6 @@ import java.util.*
*
* @includeFunctionBody ../../test/CollectionTest.kt map
*/
public inline fun <R> LongArray.map(transform : (Long) -> R) : java.util.List<R> {
public inline fun <R> LongArray.map(transform : (Long) -> R) : List<R> {
return mapTo(java.util.ArrayList<R>(this.size), transform)
}
@@ -5,7 +5,7 @@ package kotlin
// NOTE THIS FILE IS AUTO-GENERATED by the GenerateStandardLib.kt
// See: https://github.com/JetBrains/kotlin/tree/master/libraries/stdlib
//
// Generated from input file: src/kotlin/JLangIterables.kt
// Generated from input file: JLangIterables.kt
//
@@ -79,7 +79,7 @@ public inline fun ShortArray.find(predicate: (Short) -> Boolean) : Short? {
*
* @includeFunctionBody ../../test/CollectionTest.kt filterIntoLinkedList
*/
public inline fun <C: Collection<Short>> ShortArray.filterTo(result: C, predicate: (Short) -> Boolean) : C {
public inline fun <C: MutableCollection<Short>> ShortArray.filterTo(result: C, predicate: (Short) -> Boolean) : C {
for (element in this) if (predicate(element)) result.add(element)
return result
}
@@ -89,7 +89,7 @@ public inline fun <C: Collection<Short>> ShortArray.filterTo(result: C, predicat
*
* @includeFunctionBody ../../test/CollectionTest.kt filterNotIntoLinkedList
*/
public inline fun <C: Collection<Short>> ShortArray.filterNotTo(result: C, predicate: (Short) -> Boolean) : C {
public inline fun <C: MutableCollection<Short>> ShortArray.filterNotTo(result: C, predicate: (Short) -> Boolean) : C {
for (element in this) if (!predicate(element)) result.add(element)
return result
}
@@ -99,7 +99,7 @@ public inline fun <C: Collection<Short>> ShortArray.filterNotTo(result: C, predi
*
* @includeFunctionBody ../../test/CollectionTest.kt filterNotNullIntoLinkedList
*/
public inline fun <C: Collection<Short>> ShortArray?.filterNotNullTo(result: C) : C {
public inline fun <C: MutableCollection<Short>> ShortArray?.filterNotNullTo(result: C) : C {
if (this != null) {
for (element in this) if (element != null) result.add(element)
}
@@ -111,7 +111,7 @@ public inline fun <C: Collection<Short>> ShortArray?.filterNotNullTo(result: C)
*
* @includeFunctionBody ../../test/CollectionTest.kt flatMap
*/
public inline fun <R> ShortArray.flatMapTo(result: Collection<R>, transform: (Short) -> Collection<R>) : Collection<R> {
public inline fun <R> ShortArray.flatMapTo(result: MutableCollection<R>, transform: (Short) -> Collection<R>) : Collection<R> {
for (element in this) {
val list = transform(element)
if (list != null) {
@@ -181,14 +181,14 @@ public inline fun ShortArray.reduceRight(operation: (Short, Short) -> Short): Sh
*
* @includeFunctionBody ../../test/CollectionTest.kt groupBy
*/
public inline fun <K> ShortArray.groupBy(toKey: (Short) -> K) : Map<K, List<Short>> = groupByTo<K>(HashMap<K, List<Short>>(), toKey)
public inline fun <K> ShortArray.groupBy(toKey: (Short) -> K) : Map<K, MutableList<Short>> = groupByTo<K>(HashMap<K, MutableList<Short>>(), toKey)
/**
* Groups the elements in the collection into the given [[Map]] using the supplied *toKey* function to calculate the key to group the elements by
*
* @includeFunctionBody ../../test/CollectionTest.kt groupBy
*/
public inline fun <K> ShortArray.groupByTo(result: Map<K, List<Short>>, toKey: (Short) -> K) : Map<K, List<Short>> {
public inline fun <K> ShortArray.groupByTo(result: MutableMap<K, MutableList<Short>>, toKey: (Short) -> K) : Map<K, MutableList<Short>> {
for (element in this) {
val key = toKey(element)
val list = result.getOrPut(key) { ArrayList<Short>() }
@@ -212,7 +212,7 @@ public inline fun ShortArray.makeString(separator: String = ", ", prefix: String
}
/** Returns a list containing the everything but the first elements that satisfy the given *predicate* */
public inline fun <L: List<Short>> ShortArray.dropWhileTo(result: L, predicate: (Short) -> Boolean) : L {
public inline fun <L: MutableList<Short>> ShortArray.dropWhileTo(result: L, predicate: (Short) -> Boolean) : L {
var start = true
for (element in this) {
if (start && predicate(element)) {
@@ -226,13 +226,13 @@ public inline fun <L: List<Short>> ShortArray.dropWhileTo(result: L, predicate:
}
/** Returns a list containing the first elements that satisfy the given *predicate* */
public inline fun <C: Collection<Short>> ShortArray.takeWhileTo(result: C, predicate: (Short) -> Boolean) : C {
public inline fun <C: MutableCollection<Short>> ShortArray.takeWhileTo(result: C, predicate: (Short) -> Boolean) : C {
for (element in this) if (predicate(element)) result.add(element) else break
return result
}
/** Copies all elements into the given collection */
public inline fun <C: Collection<Short>> ShortArray.toCollection(result: C) : C {
public inline fun <C: MutableCollection<Short>> ShortArray.toCollection(result: C) : C {
for (element in this) result.add(element)
return result
}
@@ -5,7 +5,7 @@ package kotlin
// NOTE THIS FILE IS AUTO-GENERATED by the GenerateStandardLib.kt
// See: https://github.com/JetBrains/kotlin/tree/master/libraries/stdlib
//
// Generated from input file: src/kotlin/JLangIterablesJVM.kt
// Generated from input file: JLangIterablesJVM.kt
//
@@ -5,13 +5,11 @@ package kotlin
// NOTE THIS FILE IS AUTO-GENERATED by the GenerateStandardLib.kt
// See: https://github.com/JetBrains/kotlin/tree/master/libraries/stdlib
//
// Generated from input file: src/kotlin/JLangIterablesLazy.kt
// Generated from input file: JLangIterablesLazy.kt
//
import java.util.ArrayList
import java.util.Collection
import java.util.List
//
// This file contains methods which could have a lazy implementation for things like
@@ -4,7 +4,7 @@ package kotlin
// NOTE THIS FILE IS AUTO-GENERATED by the GenerateStandardLib.kt
// See: https://github.com/JetBrains/kotlin/tree/master/libraries/stdlib
//
// Generated from input file: src/kotlin/JUtilCollections.kt
// Generated from input file: JUtilCollections.kt
//
@@ -21,7 +21,7 @@ import java.util.*
* Transforms each element of this collection with the given *transform* function and
* adds each return value to the given *results* collection
*/
public inline fun <R, C: Collection<in R>> ShortArray.mapTo(result: C, transform : (Short) -> R) : C {
public inline fun <R, C: MutableCollection<in R>> ShortArray.mapTo(result: C, transform : (Short) -> R) : C {
for (item in this)
result.add(transform(item))
return result
@@ -4,7 +4,7 @@ package kotlin
// NOTE THIS FILE IS AUTO-GENERATED by the GenerateStandardLib.kt
// See: https://github.com/JetBrains/kotlin/tree/master/libraries/stdlib
//
// Generated from input file: src/kotlin/JUtilCollectionsJVM.kt
// Generated from input file: JUtilCollectionsJVM.kt
//
@@ -22,6 +22,6 @@ import java.util.*
*
* @includeFunctionBody ../../test/CollectionTest.kt map
*/
public inline fun <R> ShortArray.map(transform : (Short) -> R) : java.util.List<R> {
public inline fun <R> ShortArray.map(transform : (Short) -> R) : List<R> {
return mapTo(java.util.ArrayList<R>(this.size), transform)
}
@@ -4,7 +4,7 @@ package kotlin
// NOTE THIS FILE IS AUTO-GENERATED by the GenerateStandardLib.kt
// See: https://github.com/JetBrains/kotlin/tree/master/libraries/stdlib
//
// Generated from input file: src/kotlin/JUtilCollections.kt
// Generated from input file: JUtilCollections.kt
//
@@ -21,7 +21,7 @@ import java.util.*
* Transforms each element of this collection with the given *transform* function and
* adds each return value to the given *results* collection
*/
public inline fun <T, R, C: Collection<in R>> Iterable<T>.mapTo(result: C, transform : (T) -> R) : C {
public inline fun <T, R, C: MutableCollection<in R>> Iterable<T>.mapTo(result: C, transform : (T) -> R) : C {
for (item in this)
result.add(transform(item))
return result
@@ -4,7 +4,7 @@ package kotlin
// NOTE THIS FILE IS AUTO-GENERATED by the GenerateStandardLib.kt
// See: https://github.com/JetBrains/kotlin/tree/master/libraries/stdlib
//
// Generated from input file: src/kotlin/JUtilCollectionsJVM.kt
// Generated from input file: JUtilCollectionsJVM.kt
//
@@ -22,6 +22,6 @@ import java.util.*
*
* @includeFunctionBody ../../test/CollectionTest.kt map
*/
public inline fun <T, R> Iterable<T>.map(transform : (T) -> R) : java.util.List<R> {
public inline fun <T, R> Iterable<T>.map(transform : (T) -> R) : List<R> {
return mapTo(java.util.ArrayList<R>(), transform)
}