latest code generated standard library apis
This commit is contained in:
@@ -184,27 +184,21 @@ public inline fun <T> Array<T>.reduceRight(operation: (T, T) -> T): T = reverse(
|
||||
*/
|
||||
public inline fun <T, K> Array<T>.groupBy(toKey: (T) -> K) : Map<K, List<T>> = groupByTo<T,K>(HashMap<K, List<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>> {
|
||||
for (element in this) {
|
||||
val key = toKey(element)
|
||||
val list = result.getOrPut(key) { ArrayList<T>() }
|
||||
list.add(element)
|
||||
|
||||
val some = key
|
||||
val more = some
|
||||
val onceMore = more
|
||||
val again = println(more)
|
||||
}
|
||||
return result
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a string from all the elements separated using the *separator* and using the given *prefix* and *postfix* if supplied.
|
||||
*
|
||||
* If a collection could be huge you can specify a non-negative value of *limit* which will only show a subset of the collection then it will
|
||||
* a special *truncated* separator (which defaults to "..."
|
||||
*
|
||||
* @includeFunctionBody ../../test/CollectionTest.kt makeString
|
||||
*/
|
||||
public inline fun <T> Array<T>.makeString(separator: String = ", ", prefix: String = "", postfix: String = "", limit: Int = -1, truncated: String = "..."): String {
|
||||
val buffer = StringBuilder()
|
||||
|
||||
@@ -184,27 +184,21 @@ public inline fun BooleanArray.reduceRight(operation: (Boolean, Boolean) -> Bool
|
||||
*/
|
||||
public inline fun <K> BooleanArray.groupBy(toKey: (Boolean) -> K) : Map<K, List<Boolean>> = groupByTo<K>(HashMap<K, List<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>> {
|
||||
for (element in this) {
|
||||
val key = toKey(element)
|
||||
val list = result.getOrPut(key) { ArrayList<Boolean>() }
|
||||
list.add(element)
|
||||
|
||||
val some = key
|
||||
val more = some
|
||||
val onceMore = more
|
||||
val again = println(more)
|
||||
}
|
||||
return result
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a string from all the elements separated using the *separator* and using the given *prefix* and *postfix* if supplied.
|
||||
*
|
||||
* If a collection could be huge you can specify a non-negative value of *limit* which will only show a subset of the collection then it will
|
||||
* a special *truncated* separator (which defaults to "..."
|
||||
*
|
||||
* @includeFunctionBody ../../test/CollectionTest.kt makeString
|
||||
*/
|
||||
public inline fun BooleanArray.makeString(separator: String = ", ", prefix: String = "", postfix: String = "", limit: Int = -1, truncated: String = "..."): String {
|
||||
val buffer = StringBuilder()
|
||||
|
||||
@@ -184,27 +184,21 @@ public inline fun ByteArray.reduceRight(operation: (Byte, Byte) -> Byte): Byte =
|
||||
*/
|
||||
public inline fun <K> ByteArray.groupBy(toKey: (Byte) -> K) : Map<K, List<Byte>> = groupByTo<K>(HashMap<K, List<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>> {
|
||||
for (element in this) {
|
||||
val key = toKey(element)
|
||||
val list = result.getOrPut(key) { ArrayList<Byte>() }
|
||||
list.add(element)
|
||||
|
||||
val some = key
|
||||
val more = some
|
||||
val onceMore = more
|
||||
val again = println(more)
|
||||
}
|
||||
return result
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a string from all the elements separated using the *separator* and using the given *prefix* and *postfix* if supplied.
|
||||
*
|
||||
* If a collection could be huge you can specify a non-negative value of *limit* which will only show a subset of the collection then it will
|
||||
* a special *truncated* separator (which defaults to "..."
|
||||
*
|
||||
* @includeFunctionBody ../../test/CollectionTest.kt makeString
|
||||
*/
|
||||
public inline fun ByteArray.makeString(separator: String = ", ", prefix: String = "", postfix: String = "", limit: Int = -1, truncated: String = "..."): String {
|
||||
val buffer = StringBuilder()
|
||||
|
||||
@@ -184,27 +184,21 @@ public inline fun CharArray.reduceRight(operation: (Char, Char) -> Char): Char =
|
||||
*/
|
||||
public inline fun <K> CharArray.groupBy(toKey: (Char) -> K) : Map<K, List<Char>> = groupByTo<K>(HashMap<K, List<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>> {
|
||||
for (element in this) {
|
||||
val key = toKey(element)
|
||||
val list = result.getOrPut(key) { ArrayList<Char>() }
|
||||
list.add(element)
|
||||
|
||||
val some = key
|
||||
val more = some
|
||||
val onceMore = more
|
||||
val again = println(more)
|
||||
}
|
||||
return result
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a string from all the elements separated using the *separator* and using the given *prefix* and *postfix* if supplied.
|
||||
*
|
||||
* If a collection could be huge you can specify a non-negative value of *limit* which will only show a subset of the collection then it will
|
||||
* a special *truncated* separator (which defaults to "..."
|
||||
*
|
||||
* @includeFunctionBody ../../test/CollectionTest.kt makeString
|
||||
*/
|
||||
public inline fun CharArray.makeString(separator: String = ", ", prefix: String = "", postfix: String = "", limit: Int = -1, truncated: String = "..."): String {
|
||||
val buffer = StringBuilder()
|
||||
|
||||
@@ -184,27 +184,21 @@ public inline fun DoubleArray.reduceRight(operation: (Double, Double) -> Double)
|
||||
*/
|
||||
public inline fun <K> DoubleArray.groupBy(toKey: (Double) -> K) : Map<K, List<Double>> = groupByTo<K>(HashMap<K, List<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>> {
|
||||
for (element in this) {
|
||||
val key = toKey(element)
|
||||
val list = result.getOrPut(key) { ArrayList<Double>() }
|
||||
list.add(element)
|
||||
|
||||
val some = key
|
||||
val more = some
|
||||
val onceMore = more
|
||||
val again = println(more)
|
||||
}
|
||||
return result
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a string from all the elements separated using the *separator* and using the given *prefix* and *postfix* if supplied.
|
||||
*
|
||||
* If a collection could be huge you can specify a non-negative value of *limit* which will only show a subset of the collection then it will
|
||||
* a special *truncated* separator (which defaults to "..."
|
||||
*
|
||||
* @includeFunctionBody ../../test/CollectionTest.kt makeString
|
||||
*/
|
||||
public inline fun DoubleArray.makeString(separator: String = ", ", prefix: String = "", postfix: String = "", limit: Int = -1, truncated: String = "..."): String {
|
||||
val buffer = StringBuilder()
|
||||
|
||||
@@ -184,27 +184,21 @@ public inline fun FloatArray.reduceRight(operation: (Float, Float) -> Float): Fl
|
||||
*/
|
||||
public inline fun <K> FloatArray.groupBy(toKey: (Float) -> K) : Map<K, List<Float>> = groupByTo<K>(HashMap<K, List<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>> {
|
||||
for (element in this) {
|
||||
val key = toKey(element)
|
||||
val list = result.getOrPut(key) { ArrayList<Float>() }
|
||||
list.add(element)
|
||||
|
||||
val some = key
|
||||
val more = some
|
||||
val onceMore = more
|
||||
val again = println(more)
|
||||
}
|
||||
return result
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a string from all the elements separated using the *separator* and using the given *prefix* and *postfix* if supplied.
|
||||
*
|
||||
* If a collection could be huge you can specify a non-negative value of *limit* which will only show a subset of the collection then it will
|
||||
* a special *truncated* separator (which defaults to "..."
|
||||
*
|
||||
* @includeFunctionBody ../../test/CollectionTest.kt makeString
|
||||
*/
|
||||
public inline fun FloatArray.makeString(separator: String = ", ", prefix: String = "", postfix: String = "", limit: Int = -1, truncated: String = "..."): String {
|
||||
val buffer = StringBuilder()
|
||||
|
||||
@@ -184,27 +184,21 @@ public inline fun IntArray.reduceRight(operation: (Int, Int) -> Int): Int = reve
|
||||
*/
|
||||
public inline fun <K> IntArray.groupBy(toKey: (Int) -> K) : Map<K, List<Int>> = groupByTo<K>(HashMap<K, List<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>> {
|
||||
for (element in this) {
|
||||
val key = toKey(element)
|
||||
val list = result.getOrPut(key) { ArrayList<Int>() }
|
||||
list.add(element)
|
||||
|
||||
val some = key
|
||||
val more = some
|
||||
val onceMore = more
|
||||
val again = println(more)
|
||||
}
|
||||
return result
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a string from all the elements separated using the *separator* and using the given *prefix* and *postfix* if supplied.
|
||||
*
|
||||
* If a collection could be huge you can specify a non-negative value of *limit* which will only show a subset of the collection then it will
|
||||
* a special *truncated* separator (which defaults to "..."
|
||||
*
|
||||
* @includeFunctionBody ../../test/CollectionTest.kt makeString
|
||||
*/
|
||||
public inline fun IntArray.makeString(separator: String = ", ", prefix: String = "", postfix: String = "", limit: Int = -1, truncated: String = "..."): String {
|
||||
val buffer = StringBuilder()
|
||||
|
||||
@@ -182,27 +182,21 @@ public inline fun <T> java.util.Iterator<T>.reduceRight(operation: (T, T) -> T):
|
||||
*/
|
||||
public inline fun <T, K> java.util.Iterator<T>.groupBy(toKey: (T) -> K) : Map<K, List<T>> = groupByTo<T,K>(HashMap<K, List<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> java.util.Iterator<T>.groupByTo(result: Map<K, List<T>>, toKey: (T) -> K) : Map<K, List<T>> {
|
||||
for (element in this) {
|
||||
val key = toKey(element)
|
||||
val list = result.getOrPut(key) { ArrayList<T>() }
|
||||
list.add(element)
|
||||
|
||||
val some = key
|
||||
val more = some
|
||||
val onceMore = more
|
||||
val again = println(more)
|
||||
}
|
||||
return result
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a string from all the elements separated using the *separator* and using the given *prefix* and *postfix* if supplied.
|
||||
*
|
||||
* If a collection could be huge you can specify a non-negative value of *limit* which will only show a subset of the collection then it will
|
||||
* a special *truncated* separator (which defaults to "..."
|
||||
*
|
||||
* @includeFunctionBody ../../test/CollectionTest.kt makeString
|
||||
*/
|
||||
public inline fun <T> java.util.Iterator<T>.makeString(separator: String = ", ", prefix: String = "", postfix: String = "", limit: Int = -1, truncated: String = "..."): String {
|
||||
val buffer = StringBuilder()
|
||||
|
||||
@@ -184,27 +184,21 @@ public inline fun LongArray.reduceRight(operation: (Long, Long) -> Long): Long =
|
||||
*/
|
||||
public inline fun <K> LongArray.groupBy(toKey: (Long) -> K) : Map<K, List<Long>> = groupByTo<K>(HashMap<K, List<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>> {
|
||||
for (element in this) {
|
||||
val key = toKey(element)
|
||||
val list = result.getOrPut(key) { ArrayList<Long>() }
|
||||
list.add(element)
|
||||
|
||||
val some = key
|
||||
val more = some
|
||||
val onceMore = more
|
||||
val again = println(more)
|
||||
}
|
||||
return result
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a string from all the elements separated using the *separator* and using the given *prefix* and *postfix* if supplied.
|
||||
*
|
||||
* If a collection could be huge you can specify a non-negative value of *limit* which will only show a subset of the collection then it will
|
||||
* a special *truncated* separator (which defaults to "..."
|
||||
*
|
||||
* @includeFunctionBody ../../test/CollectionTest.kt makeString
|
||||
*/
|
||||
public inline fun LongArray.makeString(separator: String = ", ", prefix: String = "", postfix: String = "", limit: Int = -1, truncated: String = "..."): String {
|
||||
val buffer = StringBuilder()
|
||||
|
||||
@@ -184,27 +184,21 @@ public inline fun ShortArray.reduceRight(operation: (Short, Short) -> Short): Sh
|
||||
*/
|
||||
public inline fun <K> ShortArray.groupBy(toKey: (Short) -> K) : Map<K, List<Short>> = groupByTo<K>(HashMap<K, List<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>> {
|
||||
for (element in this) {
|
||||
val key = toKey(element)
|
||||
val list = result.getOrPut(key) { ArrayList<Short>() }
|
||||
list.add(element)
|
||||
|
||||
val some = key
|
||||
val more = some
|
||||
val onceMore = more
|
||||
val again = println(more)
|
||||
}
|
||||
return result
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a string from all the elements separated using the *separator* and using the given *prefix* and *postfix* if supplied.
|
||||
*
|
||||
* If a collection could be huge you can specify a non-negative value of *limit* which will only show a subset of the collection then it will
|
||||
* a special *truncated* separator (which defaults to "..."
|
||||
*
|
||||
* @includeFunctionBody ../../test/CollectionTest.kt makeString
|
||||
*/
|
||||
public inline fun ShortArray.makeString(separator: String = ", ", prefix: String = "", postfix: String = "", limit: Int = -1, truncated: String = "..."): String {
|
||||
val buffer = StringBuilder()
|
||||
|
||||
@@ -184,27 +184,21 @@ public inline fun <T> Iterable<T>.reduceRight(operation: (T, T) -> T): T = rever
|
||||
*/
|
||||
public inline fun <T, K> Iterable<T>.groupBy(toKey: (T) -> K) : Map<K, List<T>> = groupByTo<T,K>(HashMap<K, List<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> Iterable<T>.groupByTo(result: Map<K, List<T>>, toKey: (T) -> K) : Map<K, List<T>> {
|
||||
for (element in this) {
|
||||
val key = toKey(element)
|
||||
val list = result.getOrPut(key) { ArrayList<T>() }
|
||||
list.add(element)
|
||||
|
||||
val some = key
|
||||
val more = some
|
||||
val onceMore = more
|
||||
val again = println(more)
|
||||
}
|
||||
return result
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a string from all the elements separated using the *separator* and using the given *prefix* and *postfix* if supplied.
|
||||
*
|
||||
* If a collection could be huge you can specify a non-negative value of *limit* which will only show a subset of the collection then it will
|
||||
* a special *truncated* separator (which defaults to "..."
|
||||
*
|
||||
* @includeFunctionBody ../../test/CollectionTest.kt makeString
|
||||
*/
|
||||
public inline fun <T> Iterable<T>.makeString(separator: String = ", ", prefix: String = "", postfix: String = "", limit: Int = -1, truncated: String = "..."): String {
|
||||
val buffer = StringBuilder()
|
||||
|
||||
Reference in New Issue
Block a user