refactored the standard library so most of the collection APIs in the standard library can be compiled to JS
This commit is contained in:
@@ -1,3 +1,6 @@
|
||||
package kotlin
|
||||
|
||||
import kotlin.util.*
|
||||
|
||||
//
|
||||
// NOTE THIS FILE IS AUTO-GENERATED by the GenerateStandardLib.kt
|
||||
@@ -6,9 +9,6 @@
|
||||
// Generated from input file: src/kotlin/JLangIterables.kt
|
||||
//
|
||||
|
||||
package kotlin
|
||||
|
||||
import kotlin.util.*
|
||||
|
||||
import java.util.*
|
||||
|
||||
@@ -232,21 +232,20 @@ public inline fun <T, C: Collection<in T>> Array<T>.takeWhileTo(result: C, predi
|
||||
return result
|
||||
}
|
||||
|
||||
/** Copies all elements into the given collection */
|
||||
public inline fun <in T, C: Collection<in T>> Array<T>.toCollection(result: C) : C {
|
||||
for (element in this) result.add(element)
|
||||
return result
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverses the order the elements into a list
|
||||
*
|
||||
* @includeFunctionBody ../../test/CollectionTest.kt reverse
|
||||
*/
|
||||
public inline fun <T> Array<T>.reverse() : List<T> {
|
||||
val answer = LinkedList<T>()
|
||||
for (element in this) answer.addFirst(element)
|
||||
return answer
|
||||
}
|
||||
|
||||
/** Copies all elements into the given collection */
|
||||
public inline fun <in T, C: Collection<in T>> Array<T>.toCollection(result: C) : C {
|
||||
for (element in this) result.add(element)
|
||||
return result
|
||||
val list = toList()
|
||||
return list.reverse()
|
||||
}
|
||||
|
||||
/** Copies all elements into a [[LinkedList]] */
|
||||
@@ -258,12 +257,6 @@ public inline fun <in T> Array<T>.toList() : List<T> = toCollection(ArrayList<T>
|
||||
/** Copies all elements into a [[List] */
|
||||
public inline fun <in T> Array<T>.toCollection() : Collection<T> = toCollection(ArrayList<T>())
|
||||
|
||||
/** Copies all elements into a [[Set]] */
|
||||
public inline fun <in T> Array<T>.toSet() : Set<T> = toCollection(HashSet<T>())
|
||||
|
||||
/** Copies all elements into a [[SortedSet]] */
|
||||
public inline fun <in T> Array<T>.toSortedSet() : SortedSet<T> = toCollection(TreeSet<T>())
|
||||
|
||||
/**
|
||||
TODO figure out necessary variance/generics ninja stuff... :)
|
||||
public inline fun <in T> Array<T>.toSortedList(transform: fun(T) : java.lang.Comparable<*>) : List<T> {
|
||||
@@ -272,3 +265,20 @@ public inline fun <in T> Array<T>.toSortedList(transform: fun(T) : java.lang.Com
|
||||
return answer
|
||||
}
|
||||
*/
|
||||
|
||||
//
|
||||
// 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
|
||||
//
|
||||
|
||||
|
||||
import java.util.*
|
||||
|
||||
/** Copies all elements into a [[Set]] */
|
||||
public inline fun <in T> Array<T>.toSet() : Set<T> = toCollection(HashSet<T>())
|
||||
|
||||
/** Copies all elements into a [[SortedSet]] */
|
||||
public inline fun <in T> Array<T>.toSortedSet() : SortedSet<T> = toCollection(TreeSet<T>())
|
||||
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
package kotlin
|
||||
|
||||
import kotlin.util.*
|
||||
|
||||
//
|
||||
// NOTE THIS FILE IS AUTO-GENERATED by the GenerateStandardLib.kt
|
||||
@@ -6,9 +9,6 @@
|
||||
// Generated from input file: src/kotlin/JLangIterablesLazy.kt
|
||||
//
|
||||
|
||||
package kotlin
|
||||
|
||||
import kotlin.util.*
|
||||
|
||||
import java.util.ArrayList
|
||||
import java.util.Collection
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
package kotlin
|
||||
|
||||
//
|
||||
// NOTE THIS FILE IS AUTO-GENERATED by the GenerateStandardLib.kt
|
||||
@@ -6,7 +7,33 @@
|
||||
// Generated from input file: src/kotlin/JUtilCollections.kt
|
||||
//
|
||||
|
||||
package kotlin
|
||||
|
||||
import java.util.*
|
||||
|
||||
//
|
||||
// This file contains methods which are optimised for working on Collection / Array collections where the size
|
||||
// could be used to implement a more optimal solution
|
||||
//
|
||||
// See [[GenerateStandardLib.kt]] for more details
|
||||
//
|
||||
|
||||
/**
|
||||
* 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 {
|
||||
for (item in this)
|
||||
result.add(transform(item))
|
||||
return result
|
||||
}
|
||||
|
||||
//
|
||||
// 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
|
||||
//
|
||||
|
||||
|
||||
import java.util.*
|
||||
|
||||
@@ -25,13 +52,3 @@ import java.util.*
|
||||
public inline fun <T, R> Array<T>.map(transform : (T) -> R) : java.util.List<R> {
|
||||
return mapTo(java.util.ArrayList<R>(this.size), transform)
|
||||
}
|
||||
|
||||
/**
|
||||
* 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 {
|
||||
for (item in this)
|
||||
result.add(transform(item))
|
||||
return result
|
||||
}
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
package kotlin
|
||||
|
||||
import kotlin.util.*
|
||||
|
||||
//
|
||||
// NOTE THIS FILE IS AUTO-GENERATED by the GenerateStandardLib.kt
|
||||
@@ -6,9 +9,6 @@
|
||||
// Generated from input file: src/kotlin/JLangIterables.kt
|
||||
//
|
||||
|
||||
package kotlin
|
||||
|
||||
import kotlin.util.*
|
||||
|
||||
import java.util.*
|
||||
|
||||
@@ -232,21 +232,20 @@ public inline fun <C: Collection<Boolean>> BooleanArray.takeWhileTo(result: C, p
|
||||
return result
|
||||
}
|
||||
|
||||
/** Copies all elements into the given collection */
|
||||
public inline fun <C: Collection<Boolean>> BooleanArray.toCollection(result: C) : C {
|
||||
for (element in this) result.add(element)
|
||||
return result
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverses the order the elements into a list
|
||||
*
|
||||
* @includeFunctionBody ../../test/CollectionTest.kt reverse
|
||||
*/
|
||||
public inline fun BooleanArray.reverse() : List<Boolean> {
|
||||
val answer = LinkedList<Boolean>()
|
||||
for (element in this) answer.addFirst(element)
|
||||
return answer
|
||||
}
|
||||
|
||||
/** Copies all elements into the given collection */
|
||||
public inline fun <C: Collection<Boolean>> BooleanArray.toCollection(result: C) : C {
|
||||
for (element in this) result.add(element)
|
||||
return result
|
||||
val list = toList()
|
||||
return list.reverse()
|
||||
}
|
||||
|
||||
/** Copies all elements into a [[LinkedList]] */
|
||||
@@ -258,12 +257,6 @@ public inline fun BooleanArray.toList() : List<Boolean> = toCollection(ArrayLis
|
||||
/** Copies all elements into a [[List] */
|
||||
public inline fun BooleanArray.toCollection() : Collection<Boolean> = toCollection(ArrayList<Boolean>())
|
||||
|
||||
/** Copies all elements into a [[Set]] */
|
||||
public inline fun BooleanArray.toSet() : Set<Boolean> = toCollection(HashSet<Boolean>())
|
||||
|
||||
/** Copies all elements into a [[SortedSet]] */
|
||||
public inline fun BooleanArray.toSortedSet() : SortedSet<Boolean> = toCollection(TreeSet<Boolean>())
|
||||
|
||||
/**
|
||||
TODO figure out necessary variance/generics ninja stuff... :)
|
||||
public inline fun BooleanArray.toSortedList(transform: fun(Boolean) : java.lang.Comparable<*>) : List<Boolean> {
|
||||
@@ -272,3 +265,20 @@ public inline fun BooleanArray.toSortedList(transform: fun(Boolean) : java.lang
|
||||
return answer
|
||||
}
|
||||
*/
|
||||
|
||||
//
|
||||
// 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
|
||||
//
|
||||
|
||||
|
||||
import java.util.*
|
||||
|
||||
/** Copies all elements into a [[Set]] */
|
||||
public inline fun BooleanArray.toSet() : Set<Boolean> = toCollection(HashSet<Boolean>())
|
||||
|
||||
/** Copies all elements into a [[SortedSet]] */
|
||||
public inline fun BooleanArray.toSortedSet() : SortedSet<Boolean> = toCollection(TreeSet<Boolean>())
|
||||
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
package kotlin
|
||||
|
||||
import kotlin.util.*
|
||||
|
||||
//
|
||||
// NOTE THIS FILE IS AUTO-GENERATED by the GenerateStandardLib.kt
|
||||
@@ -6,9 +9,6 @@
|
||||
// Generated from input file: src/kotlin/JLangIterablesLazy.kt
|
||||
//
|
||||
|
||||
package kotlin
|
||||
|
||||
import kotlin.util.*
|
||||
|
||||
import java.util.ArrayList
|
||||
import java.util.Collection
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
package kotlin
|
||||
|
||||
//
|
||||
// NOTE THIS FILE IS AUTO-GENERATED by the GenerateStandardLib.kt
|
||||
@@ -6,7 +7,33 @@
|
||||
// Generated from input file: src/kotlin/JUtilCollections.kt
|
||||
//
|
||||
|
||||
package kotlin
|
||||
|
||||
import java.util.*
|
||||
|
||||
//
|
||||
// This file contains methods which are optimised for working on Collection / Array collections where the size
|
||||
// could be used to implement a more optimal solution
|
||||
//
|
||||
// See [[GenerateStandardLib.kt]] for more details
|
||||
//
|
||||
|
||||
/**
|
||||
* 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 {
|
||||
for (item in this)
|
||||
result.add(transform(item))
|
||||
return result
|
||||
}
|
||||
|
||||
//
|
||||
// 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
|
||||
//
|
||||
|
||||
|
||||
import java.util.*
|
||||
|
||||
@@ -25,13 +52,3 @@ import java.util.*
|
||||
public inline fun <R> BooleanArray.map(transform : (Boolean) -> R) : java.util.List<R> {
|
||||
return mapTo(java.util.ArrayList<R>(this.size), transform)
|
||||
}
|
||||
|
||||
/**
|
||||
* 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 {
|
||||
for (item in this)
|
||||
result.add(transform(item))
|
||||
return result
|
||||
}
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
package kotlin
|
||||
|
||||
import kotlin.util.*
|
||||
|
||||
//
|
||||
// NOTE THIS FILE IS AUTO-GENERATED by the GenerateStandardLib.kt
|
||||
@@ -6,9 +9,6 @@
|
||||
// Generated from input file: src/kotlin/JLangIterables.kt
|
||||
//
|
||||
|
||||
package kotlin
|
||||
|
||||
import kotlin.util.*
|
||||
|
||||
import java.util.*
|
||||
|
||||
@@ -232,21 +232,20 @@ public inline fun <C: Collection<Byte>> ByteArray.takeWhileTo(result: C, predica
|
||||
return result
|
||||
}
|
||||
|
||||
/** Copies all elements into the given collection */
|
||||
public inline fun <C: Collection<Byte>> ByteArray.toCollection(result: C) : C {
|
||||
for (element in this) result.add(element)
|
||||
return result
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverses the order the elements into a list
|
||||
*
|
||||
* @includeFunctionBody ../../test/CollectionTest.kt reverse
|
||||
*/
|
||||
public inline fun ByteArray.reverse() : List<Byte> {
|
||||
val answer = LinkedList<Byte>()
|
||||
for (element in this) answer.addFirst(element)
|
||||
return answer
|
||||
}
|
||||
|
||||
/** Copies all elements into the given collection */
|
||||
public inline fun <C: Collection<Byte>> ByteArray.toCollection(result: C) : C {
|
||||
for (element in this) result.add(element)
|
||||
return result
|
||||
val list = toList()
|
||||
return list.reverse()
|
||||
}
|
||||
|
||||
/** Copies all elements into a [[LinkedList]] */
|
||||
@@ -258,12 +257,6 @@ public inline fun ByteArray.toList() : List<Byte> = toCollection(ArrayList<Byte
|
||||
/** Copies all elements into a [[List] */
|
||||
public inline fun ByteArray.toCollection() : Collection<Byte> = toCollection(ArrayList<Byte>())
|
||||
|
||||
/** Copies all elements into a [[Set]] */
|
||||
public inline fun ByteArray.toSet() : Set<Byte> = toCollection(HashSet<Byte>())
|
||||
|
||||
/** Copies all elements into a [[SortedSet]] */
|
||||
public inline fun ByteArray.toSortedSet() : SortedSet<Byte> = toCollection(TreeSet<Byte>())
|
||||
|
||||
/**
|
||||
TODO figure out necessary variance/generics ninja stuff... :)
|
||||
public inline fun ByteArray.toSortedList(transform: fun(Byte) : java.lang.Comparable<*>) : List<Byte> {
|
||||
@@ -272,3 +265,20 @@ public inline fun ByteArray.toSortedList(transform: fun(Byte) : java.lang.Compa
|
||||
return answer
|
||||
}
|
||||
*/
|
||||
|
||||
//
|
||||
// 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
|
||||
//
|
||||
|
||||
|
||||
import java.util.*
|
||||
|
||||
/** Copies all elements into a [[Set]] */
|
||||
public inline fun ByteArray.toSet() : Set<Byte> = toCollection(HashSet<Byte>())
|
||||
|
||||
/** Copies all elements into a [[SortedSet]] */
|
||||
public inline fun ByteArray.toSortedSet() : SortedSet<Byte> = toCollection(TreeSet<Byte>())
|
||||
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
package kotlin
|
||||
|
||||
import kotlin.util.*
|
||||
|
||||
//
|
||||
// NOTE THIS FILE IS AUTO-GENERATED by the GenerateStandardLib.kt
|
||||
@@ -6,9 +9,6 @@
|
||||
// Generated from input file: src/kotlin/JLangIterablesLazy.kt
|
||||
//
|
||||
|
||||
package kotlin
|
||||
|
||||
import kotlin.util.*
|
||||
|
||||
import java.util.ArrayList
|
||||
import java.util.Collection
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
package kotlin
|
||||
|
||||
//
|
||||
// NOTE THIS FILE IS AUTO-GENERATED by the GenerateStandardLib.kt
|
||||
@@ -6,7 +7,33 @@
|
||||
// Generated from input file: src/kotlin/JUtilCollections.kt
|
||||
//
|
||||
|
||||
package kotlin
|
||||
|
||||
import java.util.*
|
||||
|
||||
//
|
||||
// This file contains methods which are optimised for working on Collection / Array collections where the size
|
||||
// could be used to implement a more optimal solution
|
||||
//
|
||||
// See [[GenerateStandardLib.kt]] for more details
|
||||
//
|
||||
|
||||
/**
|
||||
* 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 {
|
||||
for (item in this)
|
||||
result.add(transform(item))
|
||||
return result
|
||||
}
|
||||
|
||||
//
|
||||
// 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
|
||||
//
|
||||
|
||||
|
||||
import java.util.*
|
||||
|
||||
@@ -25,13 +52,3 @@ import java.util.*
|
||||
public inline fun <R> ByteArray.map(transform : (Byte) -> R) : java.util.List<R> {
|
||||
return mapTo(java.util.ArrayList<R>(this.size), transform)
|
||||
}
|
||||
|
||||
/**
|
||||
* 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 {
|
||||
for (item in this)
|
||||
result.add(transform(item))
|
||||
return result
|
||||
}
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
package kotlin
|
||||
|
||||
import kotlin.util.*
|
||||
|
||||
//
|
||||
// NOTE THIS FILE IS AUTO-GENERATED by the GenerateStandardLib.kt
|
||||
@@ -6,9 +9,6 @@
|
||||
// Generated from input file: src/kotlin/JLangIterables.kt
|
||||
//
|
||||
|
||||
package kotlin
|
||||
|
||||
import kotlin.util.*
|
||||
|
||||
import java.util.*
|
||||
|
||||
@@ -232,21 +232,20 @@ public inline fun <C: Collection<Char>> CharArray.takeWhileTo(result: C, predica
|
||||
return result
|
||||
}
|
||||
|
||||
/** Copies all elements into the given collection */
|
||||
public inline fun <C: Collection<Char>> CharArray.toCollection(result: C) : C {
|
||||
for (element in this) result.add(element)
|
||||
return result
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverses the order the elements into a list
|
||||
*
|
||||
* @includeFunctionBody ../../test/CollectionTest.kt reverse
|
||||
*/
|
||||
public inline fun CharArray.reverse() : List<Char> {
|
||||
val answer = LinkedList<Char>()
|
||||
for (element in this) answer.addFirst(element)
|
||||
return answer
|
||||
}
|
||||
|
||||
/** Copies all elements into the given collection */
|
||||
public inline fun <C: Collection<Char>> CharArray.toCollection(result: C) : C {
|
||||
for (element in this) result.add(element)
|
||||
return result
|
||||
val list = toList()
|
||||
return list.reverse()
|
||||
}
|
||||
|
||||
/** Copies all elements into a [[LinkedList]] */
|
||||
@@ -258,12 +257,6 @@ public inline fun CharArray.toList() : List<Char> = toCollection(ArrayList<Char
|
||||
/** Copies all elements into a [[List] */
|
||||
public inline fun CharArray.toCollection() : Collection<Char> = toCollection(ArrayList<Char>())
|
||||
|
||||
/** Copies all elements into a [[Set]] */
|
||||
public inline fun CharArray.toSet() : Set<Char> = toCollection(HashSet<Char>())
|
||||
|
||||
/** Copies all elements into a [[SortedSet]] */
|
||||
public inline fun CharArray.toSortedSet() : SortedSet<Char> = toCollection(TreeSet<Char>())
|
||||
|
||||
/**
|
||||
TODO figure out necessary variance/generics ninja stuff... :)
|
||||
public inline fun CharArray.toSortedList(transform: fun(Char) : java.lang.Comparable<*>) : List<Char> {
|
||||
@@ -272,3 +265,20 @@ public inline fun CharArray.toSortedList(transform: fun(Char) : java.lang.Compa
|
||||
return answer
|
||||
}
|
||||
*/
|
||||
|
||||
//
|
||||
// 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
|
||||
//
|
||||
|
||||
|
||||
import java.util.*
|
||||
|
||||
/** Copies all elements into a [[Set]] */
|
||||
public inline fun CharArray.toSet() : Set<Char> = toCollection(HashSet<Char>())
|
||||
|
||||
/** Copies all elements into a [[SortedSet]] */
|
||||
public inline fun CharArray.toSortedSet() : SortedSet<Char> = toCollection(TreeSet<Char>())
|
||||
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
package kotlin
|
||||
|
||||
import kotlin.util.*
|
||||
|
||||
//
|
||||
// NOTE THIS FILE IS AUTO-GENERATED by the GenerateStandardLib.kt
|
||||
@@ -6,9 +9,6 @@
|
||||
// Generated from input file: src/kotlin/JLangIterablesLazy.kt
|
||||
//
|
||||
|
||||
package kotlin
|
||||
|
||||
import kotlin.util.*
|
||||
|
||||
import java.util.ArrayList
|
||||
import java.util.Collection
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
package kotlin
|
||||
|
||||
//
|
||||
// NOTE THIS FILE IS AUTO-GENERATED by the GenerateStandardLib.kt
|
||||
@@ -6,7 +7,33 @@
|
||||
// Generated from input file: src/kotlin/JUtilCollections.kt
|
||||
//
|
||||
|
||||
package kotlin
|
||||
|
||||
import java.util.*
|
||||
|
||||
//
|
||||
// This file contains methods which are optimised for working on Collection / Array collections where the size
|
||||
// could be used to implement a more optimal solution
|
||||
//
|
||||
// See [[GenerateStandardLib.kt]] for more details
|
||||
//
|
||||
|
||||
/**
|
||||
* 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 {
|
||||
for (item in this)
|
||||
result.add(transform(item))
|
||||
return result
|
||||
}
|
||||
|
||||
//
|
||||
// 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
|
||||
//
|
||||
|
||||
|
||||
import java.util.*
|
||||
|
||||
@@ -25,13 +52,3 @@ import java.util.*
|
||||
public inline fun <R> CharArray.map(transform : (Char) -> R) : java.util.List<R> {
|
||||
return mapTo(java.util.ArrayList<R>(this.size), transform)
|
||||
}
|
||||
|
||||
/**
|
||||
* 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 {
|
||||
for (item in this)
|
||||
result.add(transform(item))
|
||||
return result
|
||||
}
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
package kotlin
|
||||
|
||||
import kotlin.util.*
|
||||
|
||||
//
|
||||
// NOTE THIS FILE IS AUTO-GENERATED by the GenerateStandardLib.kt
|
||||
@@ -6,9 +9,6 @@
|
||||
// Generated from input file: src/kotlin/JLangIterables.kt
|
||||
//
|
||||
|
||||
package kotlin
|
||||
|
||||
import kotlin.util.*
|
||||
|
||||
import java.util.*
|
||||
|
||||
@@ -232,21 +232,20 @@ public inline fun <C: Collection<Double>> DoubleArray.takeWhileTo(result: C, pre
|
||||
return result
|
||||
}
|
||||
|
||||
/** Copies all elements into the given collection */
|
||||
public inline fun <C: Collection<Double>> DoubleArray.toCollection(result: C) : C {
|
||||
for (element in this) result.add(element)
|
||||
return result
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverses the order the elements into a list
|
||||
*
|
||||
* @includeFunctionBody ../../test/CollectionTest.kt reverse
|
||||
*/
|
||||
public inline fun DoubleArray.reverse() : List<Double> {
|
||||
val answer = LinkedList<Double>()
|
||||
for (element in this) answer.addFirst(element)
|
||||
return answer
|
||||
}
|
||||
|
||||
/** Copies all elements into the given collection */
|
||||
public inline fun <C: Collection<Double>> DoubleArray.toCollection(result: C) : C {
|
||||
for (element in this) result.add(element)
|
||||
return result
|
||||
val list = toList()
|
||||
return list.reverse()
|
||||
}
|
||||
|
||||
/** Copies all elements into a [[LinkedList]] */
|
||||
@@ -258,12 +257,6 @@ public inline fun DoubleArray.toList() : List<Double> = toCollection(ArrayList<
|
||||
/** Copies all elements into a [[List] */
|
||||
public inline fun DoubleArray.toCollection() : Collection<Double> = toCollection(ArrayList<Double>())
|
||||
|
||||
/** Copies all elements into a [[Set]] */
|
||||
public inline fun DoubleArray.toSet() : Set<Double> = toCollection(HashSet<Double>())
|
||||
|
||||
/** Copies all elements into a [[SortedSet]] */
|
||||
public inline fun DoubleArray.toSortedSet() : SortedSet<Double> = toCollection(TreeSet<Double>())
|
||||
|
||||
/**
|
||||
TODO figure out necessary variance/generics ninja stuff... :)
|
||||
public inline fun DoubleArray.toSortedList(transform: fun(Double) : java.lang.Comparable<*>) : List<Double> {
|
||||
@@ -272,3 +265,20 @@ public inline fun DoubleArray.toSortedList(transform: fun(Double) : java.lang.C
|
||||
return answer
|
||||
}
|
||||
*/
|
||||
|
||||
//
|
||||
// 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
|
||||
//
|
||||
|
||||
|
||||
import java.util.*
|
||||
|
||||
/** Copies all elements into a [[Set]] */
|
||||
public inline fun DoubleArray.toSet() : Set<Double> = toCollection(HashSet<Double>())
|
||||
|
||||
/** Copies all elements into a [[SortedSet]] */
|
||||
public inline fun DoubleArray.toSortedSet() : SortedSet<Double> = toCollection(TreeSet<Double>())
|
||||
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
package kotlin
|
||||
|
||||
import kotlin.util.*
|
||||
|
||||
//
|
||||
// NOTE THIS FILE IS AUTO-GENERATED by the GenerateStandardLib.kt
|
||||
@@ -6,9 +9,6 @@
|
||||
// Generated from input file: src/kotlin/JLangIterablesLazy.kt
|
||||
//
|
||||
|
||||
package kotlin
|
||||
|
||||
import kotlin.util.*
|
||||
|
||||
import java.util.ArrayList
|
||||
import java.util.Collection
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
package kotlin
|
||||
|
||||
//
|
||||
// NOTE THIS FILE IS AUTO-GENERATED by the GenerateStandardLib.kt
|
||||
@@ -6,7 +7,33 @@
|
||||
// Generated from input file: src/kotlin/JUtilCollections.kt
|
||||
//
|
||||
|
||||
package kotlin
|
||||
|
||||
import java.util.*
|
||||
|
||||
//
|
||||
// This file contains methods which are optimised for working on Collection / Array collections where the size
|
||||
// could be used to implement a more optimal solution
|
||||
//
|
||||
// See [[GenerateStandardLib.kt]] for more details
|
||||
//
|
||||
|
||||
/**
|
||||
* 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 {
|
||||
for (item in this)
|
||||
result.add(transform(item))
|
||||
return result
|
||||
}
|
||||
|
||||
//
|
||||
// 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
|
||||
//
|
||||
|
||||
|
||||
import java.util.*
|
||||
|
||||
@@ -25,13 +52,3 @@ import java.util.*
|
||||
public inline fun <R> DoubleArray.map(transform : (Double) -> R) : java.util.List<R> {
|
||||
return mapTo(java.util.ArrayList<R>(this.size), transform)
|
||||
}
|
||||
|
||||
/**
|
||||
* 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 {
|
||||
for (item in this)
|
||||
result.add(transform(item))
|
||||
return result
|
||||
}
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
package kotlin
|
||||
|
||||
import kotlin.util.*
|
||||
|
||||
//
|
||||
// NOTE THIS FILE IS AUTO-GENERATED by the GenerateStandardLib.kt
|
||||
@@ -6,9 +9,6 @@
|
||||
// Generated from input file: src/kotlin/JLangIterables.kt
|
||||
//
|
||||
|
||||
package kotlin
|
||||
|
||||
import kotlin.util.*
|
||||
|
||||
import java.util.*
|
||||
|
||||
@@ -232,21 +232,20 @@ public inline fun <C: Collection<Float>> FloatArray.takeWhileTo(result: C, predi
|
||||
return result
|
||||
}
|
||||
|
||||
/** Copies all elements into the given collection */
|
||||
public inline fun <C: Collection<Float>> FloatArray.toCollection(result: C) : C {
|
||||
for (element in this) result.add(element)
|
||||
return result
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverses the order the elements into a list
|
||||
*
|
||||
* @includeFunctionBody ../../test/CollectionTest.kt reverse
|
||||
*/
|
||||
public inline fun FloatArray.reverse() : List<Float> {
|
||||
val answer = LinkedList<Float>()
|
||||
for (element in this) answer.addFirst(element)
|
||||
return answer
|
||||
}
|
||||
|
||||
/** Copies all elements into the given collection */
|
||||
public inline fun <C: Collection<Float>> FloatArray.toCollection(result: C) : C {
|
||||
for (element in this) result.add(element)
|
||||
return result
|
||||
val list = toList()
|
||||
return list.reverse()
|
||||
}
|
||||
|
||||
/** Copies all elements into a [[LinkedList]] */
|
||||
@@ -258,12 +257,6 @@ public inline fun FloatArray.toList() : List<Float> = toCollection(ArrayList<Fl
|
||||
/** Copies all elements into a [[List] */
|
||||
public inline fun FloatArray.toCollection() : Collection<Float> = toCollection(ArrayList<Float>())
|
||||
|
||||
/** Copies all elements into a [[Set]] */
|
||||
public inline fun FloatArray.toSet() : Set<Float> = toCollection(HashSet<Float>())
|
||||
|
||||
/** Copies all elements into a [[SortedSet]] */
|
||||
public inline fun FloatArray.toSortedSet() : SortedSet<Float> = toCollection(TreeSet<Float>())
|
||||
|
||||
/**
|
||||
TODO figure out necessary variance/generics ninja stuff... :)
|
||||
public inline fun FloatArray.toSortedList(transform: fun(Float) : java.lang.Comparable<*>) : List<Float> {
|
||||
@@ -272,3 +265,20 @@ public inline fun FloatArray.toSortedList(transform: fun(Float) : java.lang.Com
|
||||
return answer
|
||||
}
|
||||
*/
|
||||
|
||||
//
|
||||
// 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
|
||||
//
|
||||
|
||||
|
||||
import java.util.*
|
||||
|
||||
/** Copies all elements into a [[Set]] */
|
||||
public inline fun FloatArray.toSet() : Set<Float> = toCollection(HashSet<Float>())
|
||||
|
||||
/** Copies all elements into a [[SortedSet]] */
|
||||
public inline fun FloatArray.toSortedSet() : SortedSet<Float> = toCollection(TreeSet<Float>())
|
||||
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
package kotlin
|
||||
|
||||
import kotlin.util.*
|
||||
|
||||
//
|
||||
// NOTE THIS FILE IS AUTO-GENERATED by the GenerateStandardLib.kt
|
||||
@@ -6,9 +9,6 @@
|
||||
// Generated from input file: src/kotlin/JLangIterablesLazy.kt
|
||||
//
|
||||
|
||||
package kotlin
|
||||
|
||||
import kotlin.util.*
|
||||
|
||||
import java.util.ArrayList
|
||||
import java.util.Collection
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
package kotlin
|
||||
|
||||
//
|
||||
// NOTE THIS FILE IS AUTO-GENERATED by the GenerateStandardLib.kt
|
||||
@@ -6,7 +7,33 @@
|
||||
// Generated from input file: src/kotlin/JUtilCollections.kt
|
||||
//
|
||||
|
||||
package kotlin
|
||||
|
||||
import java.util.*
|
||||
|
||||
//
|
||||
// This file contains methods which are optimised for working on Collection / Array collections where the size
|
||||
// could be used to implement a more optimal solution
|
||||
//
|
||||
// See [[GenerateStandardLib.kt]] for more details
|
||||
//
|
||||
|
||||
/**
|
||||
* 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 {
|
||||
for (item in this)
|
||||
result.add(transform(item))
|
||||
return result
|
||||
}
|
||||
|
||||
//
|
||||
// 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
|
||||
//
|
||||
|
||||
|
||||
import java.util.*
|
||||
|
||||
@@ -25,13 +52,3 @@ import java.util.*
|
||||
public inline fun <R> FloatArray.map(transform : (Float) -> R) : java.util.List<R> {
|
||||
return mapTo(java.util.ArrayList<R>(this.size), transform)
|
||||
}
|
||||
|
||||
/**
|
||||
* 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 {
|
||||
for (item in this)
|
||||
result.add(transform(item))
|
||||
return result
|
||||
}
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
package kotlin
|
||||
|
||||
import kotlin.util.*
|
||||
|
||||
//
|
||||
// NOTE THIS FILE IS AUTO-GENERATED by the GenerateStandardLib.kt
|
||||
@@ -6,9 +9,6 @@
|
||||
// Generated from input file: src/kotlin/JLangIterables.kt
|
||||
//
|
||||
|
||||
package kotlin
|
||||
|
||||
import kotlin.util.*
|
||||
|
||||
import java.util.*
|
||||
|
||||
@@ -232,21 +232,20 @@ public inline fun <C: Collection<Int>> IntArray.takeWhileTo(result: C, predicate
|
||||
return result
|
||||
}
|
||||
|
||||
/** Copies all elements into the given collection */
|
||||
public inline fun <C: Collection<Int>> IntArray.toCollection(result: C) : C {
|
||||
for (element in this) result.add(element)
|
||||
return result
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverses the order the elements into a list
|
||||
*
|
||||
* @includeFunctionBody ../../test/CollectionTest.kt reverse
|
||||
*/
|
||||
public inline fun IntArray.reverse() : List<Int> {
|
||||
val answer = LinkedList<Int>()
|
||||
for (element in this) answer.addFirst(element)
|
||||
return answer
|
||||
}
|
||||
|
||||
/** Copies all elements into the given collection */
|
||||
public inline fun <C: Collection<Int>> IntArray.toCollection(result: C) : C {
|
||||
for (element in this) result.add(element)
|
||||
return result
|
||||
val list = toList()
|
||||
return list.reverse()
|
||||
}
|
||||
|
||||
/** Copies all elements into a [[LinkedList]] */
|
||||
@@ -258,12 +257,6 @@ public inline fun IntArray.toList() : List<Int> = toCollection(ArrayList<Int>()
|
||||
/** Copies all elements into a [[List] */
|
||||
public inline fun IntArray.toCollection() : Collection<Int> = toCollection(ArrayList<Int>())
|
||||
|
||||
/** Copies all elements into a [[Set]] */
|
||||
public inline fun IntArray.toSet() : Set<Int> = toCollection(HashSet<Int>())
|
||||
|
||||
/** Copies all elements into a [[SortedSet]] */
|
||||
public inline fun IntArray.toSortedSet() : SortedSet<Int> = toCollection(TreeSet<Int>())
|
||||
|
||||
/**
|
||||
TODO figure out necessary variance/generics ninja stuff... :)
|
||||
public inline fun IntArray.toSortedList(transform: fun(Int) : java.lang.Comparable<*>) : List<Int> {
|
||||
@@ -272,3 +265,20 @@ public inline fun IntArray.toSortedList(transform: fun(Int) : java.lang.Compara
|
||||
return answer
|
||||
}
|
||||
*/
|
||||
|
||||
//
|
||||
// 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
|
||||
//
|
||||
|
||||
|
||||
import java.util.*
|
||||
|
||||
/** Copies all elements into a [[Set]] */
|
||||
public inline fun IntArray.toSet() : Set<Int> = toCollection(HashSet<Int>())
|
||||
|
||||
/** Copies all elements into a [[SortedSet]] */
|
||||
public inline fun IntArray.toSortedSet() : SortedSet<Int> = toCollection(TreeSet<Int>())
|
||||
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
package kotlin
|
||||
|
||||
import kotlin.util.*
|
||||
|
||||
//
|
||||
// NOTE THIS FILE IS AUTO-GENERATED by the GenerateStandardLib.kt
|
||||
@@ -6,9 +9,6 @@
|
||||
// Generated from input file: src/kotlin/JLangIterablesLazy.kt
|
||||
//
|
||||
|
||||
package kotlin
|
||||
|
||||
import kotlin.util.*
|
||||
|
||||
import java.util.ArrayList
|
||||
import java.util.Collection
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
package kotlin
|
||||
|
||||
//
|
||||
// NOTE THIS FILE IS AUTO-GENERATED by the GenerateStandardLib.kt
|
||||
@@ -6,7 +7,33 @@
|
||||
// Generated from input file: src/kotlin/JUtilCollections.kt
|
||||
//
|
||||
|
||||
package kotlin
|
||||
|
||||
import java.util.*
|
||||
|
||||
//
|
||||
// This file contains methods which are optimised for working on Collection / Array collections where the size
|
||||
// could be used to implement a more optimal solution
|
||||
//
|
||||
// See [[GenerateStandardLib.kt]] for more details
|
||||
//
|
||||
|
||||
/**
|
||||
* 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 {
|
||||
for (item in this)
|
||||
result.add(transform(item))
|
||||
return result
|
||||
}
|
||||
|
||||
//
|
||||
// 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
|
||||
//
|
||||
|
||||
|
||||
import java.util.*
|
||||
|
||||
@@ -25,13 +52,3 @@ import java.util.*
|
||||
public inline fun <R> IntArray.map(transform : (Int) -> R) : java.util.List<R> {
|
||||
return mapTo(java.util.ArrayList<R>(this.size), transform)
|
||||
}
|
||||
|
||||
/**
|
||||
* 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 {
|
||||
for (item in this)
|
||||
result.add(transform(item))
|
||||
return result
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
package kotlin
|
||||
|
||||
//
|
||||
// NOTE THIS FILE IS AUTO-GENERATED by the GenerateStandardLib.kt
|
||||
@@ -6,7 +7,33 @@
|
||||
// Generated from input file: src/kotlin/JUtilCollections.kt
|
||||
//
|
||||
|
||||
package kotlin
|
||||
|
||||
import java.util.*
|
||||
|
||||
//
|
||||
// This file contains methods which are optimised for working on Collection / Array collections where the size
|
||||
// could be used to implement a more optimal solution
|
||||
//
|
||||
// See [[GenerateStandardLib.kt]] for more details
|
||||
//
|
||||
|
||||
/**
|
||||
* 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>> java.lang.Iterable<T>.mapTo(result: C, transform : (T) -> R) : C {
|
||||
for (item in this)
|
||||
result.add(transform(item))
|
||||
return result
|
||||
}
|
||||
|
||||
//
|
||||
// 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
|
||||
//
|
||||
|
||||
|
||||
import java.util.*
|
||||
|
||||
@@ -25,13 +52,3 @@ import java.util.*
|
||||
public inline fun <T, R> java.lang.Iterable<T>.map(transform : (T) -> R) : java.util.List<R> {
|
||||
return mapTo(java.util.ArrayList<R>(), transform)
|
||||
}
|
||||
|
||||
/**
|
||||
* 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>> java.lang.Iterable<T>.mapTo(result: C, transform : (T) -> R) : C {
|
||||
for (item in this)
|
||||
result.add(transform(item))
|
||||
return result
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
package kotlin
|
||||
|
||||
//
|
||||
// NOTE THIS FILE IS AUTO-GENERATED by the GenerateStandardLib.kt
|
||||
@@ -6,7 +7,6 @@
|
||||
// Generated from input file: src/kotlin/JLangIterables.kt
|
||||
//
|
||||
|
||||
package kotlin
|
||||
|
||||
import java.util.*
|
||||
|
||||
@@ -230,21 +230,20 @@ public inline fun <T, C: Collection<in T>> java.util.Iterator<T>.takeWhileTo(res
|
||||
return result
|
||||
}
|
||||
|
||||
/** Copies all elements into the given collection */
|
||||
public inline fun <in T, C: Collection<in T>> java.util.Iterator<T>.toCollection(result: C) : C {
|
||||
for (element in this) result.add(element)
|
||||
return result
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverses the order the elements into a list
|
||||
*
|
||||
* @includeFunctionBody ../../test/CollectionTest.kt reverse
|
||||
*/
|
||||
public inline fun <T> java.util.Iterator<T>.reverse() : List<T> {
|
||||
val answer = LinkedList<T>()
|
||||
for (element in this) answer.addFirst(element)
|
||||
return answer
|
||||
}
|
||||
|
||||
/** Copies all elements into the given collection */
|
||||
public inline fun <in T, C: Collection<in T>> java.util.Iterator<T>.toCollection(result: C) : C {
|
||||
for (element in this) result.add(element)
|
||||
return result
|
||||
val list = toList()
|
||||
return list.reverse()
|
||||
}
|
||||
|
||||
/** Copies all elements into a [[LinkedList]] */
|
||||
@@ -256,12 +255,6 @@ public inline fun <in T> java.util.Iterator<T>.toList() : List<T> = toCollection
|
||||
/** Copies all elements into a [[List] */
|
||||
public inline fun <in T> java.util.Iterator<T>.toCollection() : Collection<T> = toCollection(ArrayList<T>())
|
||||
|
||||
/** Copies all elements into a [[Set]] */
|
||||
public inline fun <in T> java.util.Iterator<T>.toSet() : Set<T> = toCollection(HashSet<T>())
|
||||
|
||||
/** Copies all elements into a [[SortedSet]] */
|
||||
public inline fun <in T> java.util.Iterator<T>.toSortedSet() : SortedSet<T> = toCollection(TreeSet<T>())
|
||||
|
||||
/**
|
||||
TODO figure out necessary variance/generics ninja stuff... :)
|
||||
public inline fun <in T> java.util.Iterator<T>.toSortedList(transform: fun(T) : java.lang.Comparable<*>) : List<T> {
|
||||
@@ -270,3 +263,20 @@ public inline fun <in T> java.util.Iterator<T>.toSortedList(transform: fun(T) :
|
||||
return answer
|
||||
}
|
||||
*/
|
||||
|
||||
//
|
||||
// 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
|
||||
//
|
||||
|
||||
|
||||
import java.util.*
|
||||
|
||||
/** Copies all elements into a [[Set]] */
|
||||
public inline fun <in T> java.util.Iterator<T>.toSet() : Set<T> = toCollection(HashSet<T>())
|
||||
|
||||
/** Copies all elements into a [[SortedSet]] */
|
||||
public inline fun <in T> java.util.Iterator<T>.toSortedSet() : SortedSet<T> = toCollection(TreeSet<T>())
|
||||
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
package kotlin
|
||||
|
||||
import kotlin.util.*
|
||||
|
||||
//
|
||||
// NOTE THIS FILE IS AUTO-GENERATED by the GenerateStandardLib.kt
|
||||
@@ -6,9 +9,6 @@
|
||||
// Generated from input file: src/kotlin/JLangIterables.kt
|
||||
//
|
||||
|
||||
package kotlin
|
||||
|
||||
import kotlin.util.*
|
||||
|
||||
import java.util.*
|
||||
|
||||
@@ -232,21 +232,20 @@ public inline fun <C: Collection<Long>> LongArray.takeWhileTo(result: C, predica
|
||||
return result
|
||||
}
|
||||
|
||||
/** Copies all elements into the given collection */
|
||||
public inline fun <C: Collection<Long>> LongArray.toCollection(result: C) : C {
|
||||
for (element in this) result.add(element)
|
||||
return result
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverses the order the elements into a list
|
||||
*
|
||||
* @includeFunctionBody ../../test/CollectionTest.kt reverse
|
||||
*/
|
||||
public inline fun LongArray.reverse() : List<Long> {
|
||||
val answer = LinkedList<Long>()
|
||||
for (element in this) answer.addFirst(element)
|
||||
return answer
|
||||
}
|
||||
|
||||
/** Copies all elements into the given collection */
|
||||
public inline fun <C: Collection<Long>> LongArray.toCollection(result: C) : C {
|
||||
for (element in this) result.add(element)
|
||||
return result
|
||||
val list = toList()
|
||||
return list.reverse()
|
||||
}
|
||||
|
||||
/** Copies all elements into a [[LinkedList]] */
|
||||
@@ -258,12 +257,6 @@ public inline fun LongArray.toList() : List<Long> = toCollection(ArrayList<Long
|
||||
/** Copies all elements into a [[List] */
|
||||
public inline fun LongArray.toCollection() : Collection<Long> = toCollection(ArrayList<Long>())
|
||||
|
||||
/** Copies all elements into a [[Set]] */
|
||||
public inline fun LongArray.toSet() : Set<Long> = toCollection(HashSet<Long>())
|
||||
|
||||
/** Copies all elements into a [[SortedSet]] */
|
||||
public inline fun LongArray.toSortedSet() : SortedSet<Long> = toCollection(TreeSet<Long>())
|
||||
|
||||
/**
|
||||
TODO figure out necessary variance/generics ninja stuff... :)
|
||||
public inline fun LongArray.toSortedList(transform: fun(Long) : java.lang.Comparable<*>) : List<Long> {
|
||||
@@ -272,3 +265,20 @@ public inline fun LongArray.toSortedList(transform: fun(Long) : java.lang.Compa
|
||||
return answer
|
||||
}
|
||||
*/
|
||||
|
||||
//
|
||||
// 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
|
||||
//
|
||||
|
||||
|
||||
import java.util.*
|
||||
|
||||
/** Copies all elements into a [[Set]] */
|
||||
public inline fun LongArray.toSet() : Set<Long> = toCollection(HashSet<Long>())
|
||||
|
||||
/** Copies all elements into a [[SortedSet]] */
|
||||
public inline fun LongArray.toSortedSet() : SortedSet<Long> = toCollection(TreeSet<Long>())
|
||||
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
package kotlin
|
||||
|
||||
import kotlin.util.*
|
||||
|
||||
//
|
||||
// NOTE THIS FILE IS AUTO-GENERATED by the GenerateStandardLib.kt
|
||||
@@ -6,9 +9,6 @@
|
||||
// Generated from input file: src/kotlin/JLangIterablesLazy.kt
|
||||
//
|
||||
|
||||
package kotlin
|
||||
|
||||
import kotlin.util.*
|
||||
|
||||
import java.util.ArrayList
|
||||
import java.util.Collection
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
package kotlin
|
||||
|
||||
//
|
||||
// NOTE THIS FILE IS AUTO-GENERATED by the GenerateStandardLib.kt
|
||||
@@ -6,7 +7,33 @@
|
||||
// Generated from input file: src/kotlin/JUtilCollections.kt
|
||||
//
|
||||
|
||||
package kotlin
|
||||
|
||||
import java.util.*
|
||||
|
||||
//
|
||||
// This file contains methods which are optimised for working on Collection / Array collections where the size
|
||||
// could be used to implement a more optimal solution
|
||||
//
|
||||
// See [[GenerateStandardLib.kt]] for more details
|
||||
//
|
||||
|
||||
/**
|
||||
* 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 {
|
||||
for (item in this)
|
||||
result.add(transform(item))
|
||||
return result
|
||||
}
|
||||
|
||||
//
|
||||
// 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
|
||||
//
|
||||
|
||||
|
||||
import java.util.*
|
||||
|
||||
@@ -25,13 +52,3 @@ import java.util.*
|
||||
public inline fun <R> LongArray.map(transform : (Long) -> R) : java.util.List<R> {
|
||||
return mapTo(java.util.ArrayList<R>(this.size), transform)
|
||||
}
|
||||
|
||||
/**
|
||||
* 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 {
|
||||
for (item in this)
|
||||
result.add(transform(item))
|
||||
return result
|
||||
}
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
package kotlin
|
||||
|
||||
import kotlin.util.*
|
||||
|
||||
//
|
||||
// NOTE THIS FILE IS AUTO-GENERATED by the GenerateStandardLib.kt
|
||||
@@ -6,9 +9,6 @@
|
||||
// Generated from input file: src/kotlin/JLangIterables.kt
|
||||
//
|
||||
|
||||
package kotlin
|
||||
|
||||
import kotlin.util.*
|
||||
|
||||
import java.util.*
|
||||
|
||||
@@ -232,21 +232,20 @@ public inline fun <C: Collection<Short>> ShortArray.takeWhileTo(result: C, predi
|
||||
return result
|
||||
}
|
||||
|
||||
/** Copies all elements into the given collection */
|
||||
public inline fun <C: Collection<Short>> ShortArray.toCollection(result: C) : C {
|
||||
for (element in this) result.add(element)
|
||||
return result
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverses the order the elements into a list
|
||||
*
|
||||
* @includeFunctionBody ../../test/CollectionTest.kt reverse
|
||||
*/
|
||||
public inline fun ShortArray.reverse() : List<Short> {
|
||||
val answer = LinkedList<Short>()
|
||||
for (element in this) answer.addFirst(element)
|
||||
return answer
|
||||
}
|
||||
|
||||
/** Copies all elements into the given collection */
|
||||
public inline fun <C: Collection<Short>> ShortArray.toCollection(result: C) : C {
|
||||
for (element in this) result.add(element)
|
||||
return result
|
||||
val list = toList()
|
||||
return list.reverse()
|
||||
}
|
||||
|
||||
/** Copies all elements into a [[LinkedList]] */
|
||||
@@ -258,12 +257,6 @@ public inline fun ShortArray.toList() : List<Short> = toCollection(ArrayList<Sh
|
||||
/** Copies all elements into a [[List] */
|
||||
public inline fun ShortArray.toCollection() : Collection<Short> = toCollection(ArrayList<Short>())
|
||||
|
||||
/** Copies all elements into a [[Set]] */
|
||||
public inline fun ShortArray.toSet() : Set<Short> = toCollection(HashSet<Short>())
|
||||
|
||||
/** Copies all elements into a [[SortedSet]] */
|
||||
public inline fun ShortArray.toSortedSet() : SortedSet<Short> = toCollection(TreeSet<Short>())
|
||||
|
||||
/**
|
||||
TODO figure out necessary variance/generics ninja stuff... :)
|
||||
public inline fun ShortArray.toSortedList(transform: fun(Short) : java.lang.Comparable<*>) : List<Short> {
|
||||
@@ -272,3 +265,20 @@ public inline fun ShortArray.toSortedList(transform: fun(Short) : java.lang.Com
|
||||
return answer
|
||||
}
|
||||
*/
|
||||
|
||||
//
|
||||
// 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
|
||||
//
|
||||
|
||||
|
||||
import java.util.*
|
||||
|
||||
/** Copies all elements into a [[Set]] */
|
||||
public inline fun ShortArray.toSet() : Set<Short> = toCollection(HashSet<Short>())
|
||||
|
||||
/** Copies all elements into a [[SortedSet]] */
|
||||
public inline fun ShortArray.toSortedSet() : SortedSet<Short> = toCollection(TreeSet<Short>())
|
||||
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
package kotlin
|
||||
|
||||
import kotlin.util.*
|
||||
|
||||
//
|
||||
// NOTE THIS FILE IS AUTO-GENERATED by the GenerateStandardLib.kt
|
||||
@@ -6,9 +9,6 @@
|
||||
// Generated from input file: src/kotlin/JLangIterablesLazy.kt
|
||||
//
|
||||
|
||||
package kotlin
|
||||
|
||||
import kotlin.util.*
|
||||
|
||||
import java.util.ArrayList
|
||||
import java.util.Collection
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
package kotlin
|
||||
|
||||
//
|
||||
// NOTE THIS FILE IS AUTO-GENERATED by the GenerateStandardLib.kt
|
||||
@@ -6,7 +7,33 @@
|
||||
// Generated from input file: src/kotlin/JUtilCollections.kt
|
||||
//
|
||||
|
||||
package kotlin
|
||||
|
||||
import java.util.*
|
||||
|
||||
//
|
||||
// This file contains methods which are optimised for working on Collection / Array collections where the size
|
||||
// could be used to implement a more optimal solution
|
||||
//
|
||||
// See [[GenerateStandardLib.kt]] for more details
|
||||
//
|
||||
|
||||
/**
|
||||
* 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 {
|
||||
for (item in this)
|
||||
result.add(transform(item))
|
||||
return result
|
||||
}
|
||||
|
||||
//
|
||||
// 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
|
||||
//
|
||||
|
||||
|
||||
import java.util.*
|
||||
|
||||
@@ -25,13 +52,3 @@ import java.util.*
|
||||
public inline fun <R> ShortArray.map(transform : (Short) -> R) : java.util.List<R> {
|
||||
return mapTo(java.util.ArrayList<R>(this.size), transform)
|
||||
}
|
||||
|
||||
/**
|
||||
* 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 {
|
||||
for (item in this)
|
||||
result.add(transform(item))
|
||||
return result
|
||||
}
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
package kotlin
|
||||
|
||||
import kotlin.util.*
|
||||
|
||||
//
|
||||
// NOTE THIS FILE IS AUTO-GENERATED by the GenerateStandardLib.kt
|
||||
@@ -6,9 +9,6 @@
|
||||
// Generated from input file: src/kotlin/JLangIterables.kt
|
||||
//
|
||||
|
||||
package kotlin
|
||||
|
||||
import kotlin.util.*
|
||||
|
||||
import java.util.*
|
||||
|
||||
@@ -232,21 +232,20 @@ public inline fun <T, C: Collection<in T>> Iterable<T>.takeWhileTo(result: C, pr
|
||||
return result
|
||||
}
|
||||
|
||||
/** Copies all elements into the given collection */
|
||||
public inline fun <in T, C: Collection<in T>> Iterable<T>.toCollection(result: C) : C {
|
||||
for (element in this) result.add(element)
|
||||
return result
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverses the order the elements into a list
|
||||
*
|
||||
* @includeFunctionBody ../../test/CollectionTest.kt reverse
|
||||
*/
|
||||
public inline fun <T> Iterable<T>.reverse() : List<T> {
|
||||
val answer = LinkedList<T>()
|
||||
for (element in this) answer.addFirst(element)
|
||||
return answer
|
||||
}
|
||||
|
||||
/** Copies all elements into the given collection */
|
||||
public inline fun <in T, C: Collection<in T>> Iterable<T>.toCollection(result: C) : C {
|
||||
for (element in this) result.add(element)
|
||||
return result
|
||||
val list = toList()
|
||||
return list.reverse()
|
||||
}
|
||||
|
||||
/** Copies all elements into a [[LinkedList]] */
|
||||
@@ -258,12 +257,6 @@ public inline fun <in T> Iterable<T>.toList() : List<T> = toCollection(ArrayList
|
||||
/** Copies all elements into a [[List] */
|
||||
public inline fun <in T> Iterable<T>.toCollection() : Collection<T> = toCollection(ArrayList<T>())
|
||||
|
||||
/** Copies all elements into a [[Set]] */
|
||||
public inline fun <in T> Iterable<T>.toSet() : Set<T> = toCollection(HashSet<T>())
|
||||
|
||||
/** Copies all elements into a [[SortedSet]] */
|
||||
public inline fun <in T> Iterable<T>.toSortedSet() : SortedSet<T> = toCollection(TreeSet<T>())
|
||||
|
||||
/**
|
||||
TODO figure out necessary variance/generics ninja stuff... :)
|
||||
public inline fun <in T> Iterable<T>.toSortedList(transform: fun(T) : java.lang.Comparable<*>) : List<T> {
|
||||
@@ -272,3 +265,20 @@ public inline fun <in T> Iterable<T>.toSortedList(transform: fun(T) : java.lang.
|
||||
return answer
|
||||
}
|
||||
*/
|
||||
|
||||
//
|
||||
// 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
|
||||
//
|
||||
|
||||
|
||||
import java.util.*
|
||||
|
||||
/** Copies all elements into a [[Set]] */
|
||||
public inline fun <in T> Iterable<T>.toSet() : Set<T> = toCollection(HashSet<T>())
|
||||
|
||||
/** Copies all elements into a [[SortedSet]] */
|
||||
public inline fun <in T> Iterable<T>.toSortedSet() : SortedSet<T> = toCollection(TreeSet<T>())
|
||||
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
package kotlin
|
||||
|
||||
import kotlin.util.*
|
||||
|
||||
//
|
||||
// NOTE THIS FILE IS AUTO-GENERATED by the GenerateStandardLib.kt
|
||||
@@ -6,9 +9,6 @@
|
||||
// Generated from input file: src/kotlin/JLangIterablesLazy.kt
|
||||
//
|
||||
|
||||
package kotlin
|
||||
|
||||
import kotlin.util.*
|
||||
|
||||
import java.util.ArrayList
|
||||
import java.util.Collection
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
package kotlin
|
||||
|
||||
//
|
||||
// NOTE THIS FILE IS AUTO-GENERATED by the GenerateStandardLib.kt
|
||||
@@ -6,7 +7,33 @@
|
||||
// Generated from input file: src/kotlin/JUtilCollections.kt
|
||||
//
|
||||
|
||||
package kotlin
|
||||
|
||||
import java.util.*
|
||||
|
||||
//
|
||||
// This file contains methods which are optimised for working on Collection / Array collections where the size
|
||||
// could be used to implement a more optimal solution
|
||||
//
|
||||
// See [[GenerateStandardLib.kt]] for more details
|
||||
//
|
||||
|
||||
/**
|
||||
* 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 {
|
||||
for (item in this)
|
||||
result.add(transform(item))
|
||||
return result
|
||||
}
|
||||
|
||||
//
|
||||
// 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
|
||||
//
|
||||
|
||||
|
||||
import java.util.*
|
||||
|
||||
@@ -25,13 +52,3 @@ import java.util.*
|
||||
public inline fun <T, R> Iterable<T>.map(transform : (T) -> R) : java.util.List<R> {
|
||||
return mapTo(java.util.ArrayList<R>(), transform)
|
||||
}
|
||||
|
||||
/**
|
||||
* 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 {
|
||||
for (item in this)
|
||||
result.add(transform(item))
|
||||
return result
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user