Standard library documentation updates.
This commit is contained in:
@@ -218,7 +218,7 @@ public fun String.any(): Boolean {
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns *true* if any element matches the given *predicate*
|
||||
* Returns *true* if any element matches the given [predicate]
|
||||
*/
|
||||
public inline fun <T> Array<out T>.any(predicate: (T) -> Boolean): Boolean {
|
||||
for (element in this) if (predicate(element)) return true
|
||||
@@ -226,7 +226,7 @@ public inline fun <T> Array<out T>.any(predicate: (T) -> Boolean): Boolean {
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns *true* if any element matches the given *predicate*
|
||||
* Returns *true* if any element matches the given [predicate]
|
||||
*/
|
||||
public inline fun BooleanArray.any(predicate: (Boolean) -> Boolean): Boolean {
|
||||
for (element in this) if (predicate(element)) return true
|
||||
@@ -234,7 +234,7 @@ public inline fun BooleanArray.any(predicate: (Boolean) -> Boolean): Boolean {
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns *true* if any element matches the given *predicate*
|
||||
* Returns *true* if any element matches the given [predicate]
|
||||
*/
|
||||
public inline fun ByteArray.any(predicate: (Byte) -> Boolean): Boolean {
|
||||
for (element in this) if (predicate(element)) return true
|
||||
@@ -242,7 +242,7 @@ public inline fun ByteArray.any(predicate: (Byte) -> Boolean): Boolean {
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns *true* if any element matches the given *predicate*
|
||||
* Returns *true* if any element matches the given [predicate]
|
||||
*/
|
||||
public inline fun CharArray.any(predicate: (Char) -> Boolean): Boolean {
|
||||
for (element in this) if (predicate(element)) return true
|
||||
@@ -250,7 +250,7 @@ public inline fun CharArray.any(predicate: (Char) -> Boolean): Boolean {
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns *true* if any element matches the given *predicate*
|
||||
* Returns *true* if any element matches the given [predicate]
|
||||
*/
|
||||
public inline fun DoubleArray.any(predicate: (Double) -> Boolean): Boolean {
|
||||
for (element in this) if (predicate(element)) return true
|
||||
@@ -258,7 +258,7 @@ public inline fun DoubleArray.any(predicate: (Double) -> Boolean): Boolean {
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns *true* if any element matches the given *predicate*
|
||||
* Returns *true* if any element matches the given [predicate]
|
||||
*/
|
||||
public inline fun FloatArray.any(predicate: (Float) -> Boolean): Boolean {
|
||||
for (element in this) if (predicate(element)) return true
|
||||
@@ -266,7 +266,7 @@ public inline fun FloatArray.any(predicate: (Float) -> Boolean): Boolean {
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns *true* if any element matches the given *predicate*
|
||||
* Returns *true* if any element matches the given [predicate]
|
||||
*/
|
||||
public inline fun IntArray.any(predicate: (Int) -> Boolean): Boolean {
|
||||
for (element in this) if (predicate(element)) return true
|
||||
@@ -274,7 +274,7 @@ public inline fun IntArray.any(predicate: (Int) -> Boolean): Boolean {
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns *true* if any element matches the given *predicate*
|
||||
* Returns *true* if any element matches the given [predicate]
|
||||
*/
|
||||
public inline fun LongArray.any(predicate: (Long) -> Boolean): Boolean {
|
||||
for (element in this) if (predicate(element)) return true
|
||||
@@ -282,7 +282,7 @@ public inline fun LongArray.any(predicate: (Long) -> Boolean): Boolean {
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns *true* if any element matches the given *predicate*
|
||||
* Returns *true* if any element matches the given [predicate]
|
||||
*/
|
||||
public inline fun ShortArray.any(predicate: (Short) -> Boolean): Boolean {
|
||||
for (element in this) if (predicate(element)) return true
|
||||
@@ -290,7 +290,7 @@ public inline fun ShortArray.any(predicate: (Short) -> Boolean): Boolean {
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns *true* if any element matches the given *predicate*
|
||||
* Returns *true* if any element matches the given [predicate]
|
||||
*/
|
||||
public inline fun <T> Iterable<T>.any(predicate: (T) -> Boolean): Boolean {
|
||||
for (element in this) if (predicate(element)) return true
|
||||
@@ -298,7 +298,7 @@ public inline fun <T> Iterable<T>.any(predicate: (T) -> Boolean): Boolean {
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns *true* if any element matches the given *predicate*
|
||||
* Returns *true* if any element matches the given [predicate]
|
||||
*/
|
||||
public inline fun <K, V> Map<K, V>.any(predicate: (Map.Entry<K, V>) -> Boolean): Boolean {
|
||||
for (element in this) if (predicate(element)) return true
|
||||
@@ -306,7 +306,7 @@ public inline fun <K, V> Map<K, V>.any(predicate: (Map.Entry<K, V>) -> Boolean):
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns *true* if any element matches the given *predicate*
|
||||
* Returns *true* if any element matches the given [predicate]
|
||||
*/
|
||||
public inline fun <T> Stream<T>.any(predicate: (T) -> Boolean): Boolean {
|
||||
for (element in this) if (predicate(element)) return true
|
||||
@@ -314,7 +314,7 @@ public inline fun <T> Stream<T>.any(predicate: (T) -> Boolean): Boolean {
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns *true* if any element matches the given *predicate*
|
||||
* Returns *true* if any element matches the given [predicate]
|
||||
*/
|
||||
public inline fun String.any(predicate: (Char) -> Boolean): Boolean {
|
||||
for (element in this) if (predicate(element)) return true
|
||||
@@ -424,7 +424,7 @@ public fun String.count(): Int {
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the number of elements matching the given *predicate*
|
||||
* Returns the number of elements matching the given [predicate]
|
||||
*/
|
||||
public inline fun <T> Array<out T>.count(predicate: (T) -> Boolean): Int {
|
||||
var count = 0
|
||||
@@ -433,7 +433,7 @@ public inline fun <T> Array<out T>.count(predicate: (T) -> Boolean): Int {
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the number of elements matching the given *predicate*
|
||||
* Returns the number of elements matching the given [predicate]
|
||||
*/
|
||||
public inline fun BooleanArray.count(predicate: (Boolean) -> Boolean): Int {
|
||||
var count = 0
|
||||
@@ -442,7 +442,7 @@ public inline fun BooleanArray.count(predicate: (Boolean) -> Boolean): Int {
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the number of elements matching the given *predicate*
|
||||
* Returns the number of elements matching the given [predicate]
|
||||
*/
|
||||
public inline fun ByteArray.count(predicate: (Byte) -> Boolean): Int {
|
||||
var count = 0
|
||||
@@ -451,7 +451,7 @@ public inline fun ByteArray.count(predicate: (Byte) -> Boolean): Int {
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the number of elements matching the given *predicate*
|
||||
* Returns the number of elements matching the given [predicate]
|
||||
*/
|
||||
public inline fun CharArray.count(predicate: (Char) -> Boolean): Int {
|
||||
var count = 0
|
||||
@@ -460,7 +460,7 @@ public inline fun CharArray.count(predicate: (Char) -> Boolean): Int {
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the number of elements matching the given *predicate*
|
||||
* Returns the number of elements matching the given [predicate]
|
||||
*/
|
||||
public inline fun DoubleArray.count(predicate: (Double) -> Boolean): Int {
|
||||
var count = 0
|
||||
@@ -469,7 +469,7 @@ public inline fun DoubleArray.count(predicate: (Double) -> Boolean): Int {
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the number of elements matching the given *predicate*
|
||||
* Returns the number of elements matching the given [predicate]
|
||||
*/
|
||||
public inline fun FloatArray.count(predicate: (Float) -> Boolean): Int {
|
||||
var count = 0
|
||||
@@ -478,7 +478,7 @@ public inline fun FloatArray.count(predicate: (Float) -> Boolean): Int {
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the number of elements matching the given *predicate*
|
||||
* Returns the number of elements matching the given [predicate]
|
||||
*/
|
||||
public inline fun IntArray.count(predicate: (Int) -> Boolean): Int {
|
||||
var count = 0
|
||||
@@ -487,7 +487,7 @@ public inline fun IntArray.count(predicate: (Int) -> Boolean): Int {
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the number of elements matching the given *predicate*
|
||||
* Returns the number of elements matching the given [predicate]
|
||||
*/
|
||||
public inline fun LongArray.count(predicate: (Long) -> Boolean): Int {
|
||||
var count = 0
|
||||
@@ -496,7 +496,7 @@ public inline fun LongArray.count(predicate: (Long) -> Boolean): Int {
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the number of elements matching the given *predicate*
|
||||
* Returns the number of elements matching the given [predicate]
|
||||
*/
|
||||
public inline fun ShortArray.count(predicate: (Short) -> Boolean): Int {
|
||||
var count = 0
|
||||
@@ -505,7 +505,7 @@ public inline fun ShortArray.count(predicate: (Short) -> Boolean): Int {
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the number of elements matching the given *predicate*
|
||||
* Returns the number of elements matching the given [predicate]
|
||||
*/
|
||||
public inline fun <T> Iterable<T>.count(predicate: (T) -> Boolean): Int {
|
||||
var count = 0
|
||||
@@ -514,7 +514,7 @@ public inline fun <T> Iterable<T>.count(predicate: (T) -> Boolean): Int {
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the number of elements matching the given *predicate*
|
||||
* Returns the number of elements matching the given [predicate]
|
||||
*/
|
||||
public inline fun <K, V> Map<K, V>.count(predicate: (Map.Entry<K, V>) -> Boolean): Int {
|
||||
var count = 0
|
||||
@@ -523,7 +523,7 @@ public inline fun <K, V> Map<K, V>.count(predicate: (Map.Entry<K, V>) -> Boolean
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the number of elements matching the given *predicate*
|
||||
* Returns the number of elements matching the given [predicate]
|
||||
*/
|
||||
public inline fun <T> Stream<T>.count(predicate: (T) -> Boolean): Int {
|
||||
var count = 0
|
||||
@@ -532,7 +532,7 @@ public inline fun <T> Stream<T>.count(predicate: (T) -> Boolean): Int {
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the number of elements matching the given *predicate*
|
||||
* Returns the number of elements matching the given [predicate]
|
||||
*/
|
||||
public inline fun String.count(predicate: (Char) -> Boolean): Int {
|
||||
var count = 0
|
||||
@@ -2243,7 +2243,7 @@ public inline fun String.reduceRight(operation: (Char, Char) -> Char): Char {
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the sum of all values produced by `transform` function from elements in the collection
|
||||
* Returns the sum of all values produced by [transform] function from elements in the collection
|
||||
*/
|
||||
public inline fun <T> Array<out T>.sumBy(transform: (T) -> Int): Int {
|
||||
var sum: Int = 0
|
||||
@@ -2254,7 +2254,7 @@ public inline fun <T> Array<out T>.sumBy(transform: (T) -> Int): Int {
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the sum of all values produced by `transform` function from elements in the collection
|
||||
* Returns the sum of all values produced by [transform] function from elements in the collection
|
||||
*/
|
||||
public inline fun BooleanArray.sumBy(transform: (Boolean) -> Int): Int {
|
||||
var sum: Int = 0
|
||||
@@ -2265,7 +2265,7 @@ public inline fun BooleanArray.sumBy(transform: (Boolean) -> Int): Int {
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the sum of all values produced by `transform` function from elements in the collection
|
||||
* Returns the sum of all values produced by [transform] function from elements in the collection
|
||||
*/
|
||||
public inline fun ByteArray.sumBy(transform: (Byte) -> Int): Int {
|
||||
var sum: Int = 0
|
||||
@@ -2276,7 +2276,7 @@ public inline fun ByteArray.sumBy(transform: (Byte) -> Int): Int {
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the sum of all values produced by `transform` function from elements in the collection
|
||||
* Returns the sum of all values produced by [transform] function from elements in the collection
|
||||
*/
|
||||
public inline fun CharArray.sumBy(transform: (Char) -> Int): Int {
|
||||
var sum: Int = 0
|
||||
@@ -2287,7 +2287,7 @@ public inline fun CharArray.sumBy(transform: (Char) -> Int): Int {
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the sum of all values produced by `transform` function from elements in the collection
|
||||
* Returns the sum of all values produced by [transform] function from elements in the collection
|
||||
*/
|
||||
public inline fun DoubleArray.sumBy(transform: (Double) -> Int): Int {
|
||||
var sum: Int = 0
|
||||
@@ -2298,7 +2298,7 @@ public inline fun DoubleArray.sumBy(transform: (Double) -> Int): Int {
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the sum of all values produced by `transform` function from elements in the collection
|
||||
* Returns the sum of all values produced by [transform] function from elements in the collection
|
||||
*/
|
||||
public inline fun FloatArray.sumBy(transform: (Float) -> Int): Int {
|
||||
var sum: Int = 0
|
||||
@@ -2309,7 +2309,7 @@ public inline fun FloatArray.sumBy(transform: (Float) -> Int): Int {
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the sum of all values produced by `transform` function from elements in the collection
|
||||
* Returns the sum of all values produced by [transform] function from elements in the collection
|
||||
*/
|
||||
public inline fun IntArray.sumBy(transform: (Int) -> Int): Int {
|
||||
var sum: Int = 0
|
||||
@@ -2320,7 +2320,7 @@ public inline fun IntArray.sumBy(transform: (Int) -> Int): Int {
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the sum of all values produced by `transform` function from elements in the collection
|
||||
* Returns the sum of all values produced by [transform] function from elements in the collection
|
||||
*/
|
||||
public inline fun LongArray.sumBy(transform: (Long) -> Int): Int {
|
||||
var sum: Int = 0
|
||||
@@ -2331,7 +2331,7 @@ public inline fun LongArray.sumBy(transform: (Long) -> Int): Int {
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the sum of all values produced by `transform` function from elements in the collection
|
||||
* Returns the sum of all values produced by [transform] function from elements in the collection
|
||||
*/
|
||||
public inline fun ShortArray.sumBy(transform: (Short) -> Int): Int {
|
||||
var sum: Int = 0
|
||||
@@ -2342,7 +2342,7 @@ public inline fun ShortArray.sumBy(transform: (Short) -> Int): Int {
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the sum of all values produced by `transform` function from elements in the collection
|
||||
* Returns the sum of all values produced by [transform] function from elements in the collection
|
||||
*/
|
||||
public inline fun <T> Iterable<T>.sumBy(transform: (T) -> Int): Int {
|
||||
var sum: Int = 0
|
||||
@@ -2353,7 +2353,7 @@ public inline fun <T> Iterable<T>.sumBy(transform: (T) -> Int): Int {
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the sum of all values produced by `transform` function from elements in the collection
|
||||
* Returns the sum of all values produced by [transform] function from elements in the collection
|
||||
*/
|
||||
public inline fun <T> Stream<T>.sumBy(transform: (T) -> Int): Int {
|
||||
var sum: Int = 0
|
||||
@@ -2364,7 +2364,7 @@ public inline fun <T> Stream<T>.sumBy(transform: (T) -> Int): Int {
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the sum of all values produced by `transform` function from elements in the collection
|
||||
* Returns the sum of all values produced by [transform] function from characters in the string
|
||||
*/
|
||||
public inline fun String.sumBy(transform: (Char) -> Int): Int {
|
||||
var sum: Int = 0
|
||||
@@ -2375,7 +2375,7 @@ public inline fun String.sumBy(transform: (Char) -> Int): Int {
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the sum of all values produced by `transform` function from elements in the collection
|
||||
* Returns the sum of all values produced by [transform] function from elements in the collection
|
||||
*/
|
||||
public inline fun <T> Array<out T>.sumByDouble(transform: (T) -> Double): Double {
|
||||
var sum: Double = 0.0
|
||||
@@ -2386,7 +2386,7 @@ public inline fun <T> Array<out T>.sumByDouble(transform: (T) -> Double): Double
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the sum of all values produced by `transform` function from elements in the collection
|
||||
* Returns the sum of all values produced by [transform] function from elements in the collection
|
||||
*/
|
||||
public inline fun BooleanArray.sumByDouble(transform: (Boolean) -> Double): Double {
|
||||
var sum: Double = 0.0
|
||||
@@ -2397,7 +2397,7 @@ public inline fun BooleanArray.sumByDouble(transform: (Boolean) -> Double): Doub
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the sum of all values produced by `transform` function from elements in the collection
|
||||
* Returns the sum of all values produced by [transform] function from elements in the collection
|
||||
*/
|
||||
public inline fun ByteArray.sumByDouble(transform: (Byte) -> Double): Double {
|
||||
var sum: Double = 0.0
|
||||
@@ -2408,7 +2408,7 @@ public inline fun ByteArray.sumByDouble(transform: (Byte) -> Double): Double {
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the sum of all values produced by `transform` function from elements in the collection
|
||||
* Returns the sum of all values produced by [transform] function from elements in the collection
|
||||
*/
|
||||
public inline fun CharArray.sumByDouble(transform: (Char) -> Double): Double {
|
||||
var sum: Double = 0.0
|
||||
@@ -2419,7 +2419,7 @@ public inline fun CharArray.sumByDouble(transform: (Char) -> Double): Double {
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the sum of all values produced by `transform` function from elements in the collection
|
||||
* Returns the sum of all values produced by [transform] function from elements in the collection
|
||||
*/
|
||||
public inline fun DoubleArray.sumByDouble(transform: (Double) -> Double): Double {
|
||||
var sum: Double = 0.0
|
||||
@@ -2430,7 +2430,7 @@ public inline fun DoubleArray.sumByDouble(transform: (Double) -> Double): Double
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the sum of all values produced by `transform` function from elements in the collection
|
||||
* Returns the sum of all values produced by [transform] function from elements in the collection
|
||||
*/
|
||||
public inline fun FloatArray.sumByDouble(transform: (Float) -> Double): Double {
|
||||
var sum: Double = 0.0
|
||||
@@ -2441,7 +2441,7 @@ public inline fun FloatArray.sumByDouble(transform: (Float) -> Double): Double {
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the sum of all values produced by `transform` function from elements in the collection
|
||||
* Returns the sum of all values produced by [transform] function from elements in the collection
|
||||
*/
|
||||
public inline fun IntArray.sumByDouble(transform: (Int) -> Double): Double {
|
||||
var sum: Double = 0.0
|
||||
@@ -2452,7 +2452,7 @@ public inline fun IntArray.sumByDouble(transform: (Int) -> Double): Double {
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the sum of all values produced by `transform` function from elements in the collection
|
||||
* Returns the sum of all values produced by [transform] function from elements in the collection
|
||||
*/
|
||||
public inline fun LongArray.sumByDouble(transform: (Long) -> Double): Double {
|
||||
var sum: Double = 0.0
|
||||
@@ -2463,7 +2463,7 @@ public inline fun LongArray.sumByDouble(transform: (Long) -> Double): Double {
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the sum of all values produced by `transform` function from elements in the collection
|
||||
* Returns the sum of all values produced by [transform] function from elements in the collection
|
||||
*/
|
||||
public inline fun ShortArray.sumByDouble(transform: (Short) -> Double): Double {
|
||||
var sum: Double = 0.0
|
||||
@@ -2474,7 +2474,7 @@ public inline fun ShortArray.sumByDouble(transform: (Short) -> Double): Double {
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the sum of all values produced by `transform` function from elements in the collection
|
||||
* Returns the sum of all values produced by [transform] function from elements in the collection
|
||||
*/
|
||||
public inline fun <T> Iterable<T>.sumByDouble(transform: (T) -> Double): Double {
|
||||
var sum: Double = 0.0
|
||||
@@ -2485,7 +2485,7 @@ public inline fun <T> Iterable<T>.sumByDouble(transform: (T) -> Double): Double
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the sum of all values produced by `transform` function from elements in the collection
|
||||
* Returns the sum of all values produced by [transform] function from elements in the collection
|
||||
*/
|
||||
public inline fun <T> Stream<T>.sumByDouble(transform: (T) -> Double): Double {
|
||||
var sum: Double = 0.0
|
||||
@@ -2496,7 +2496,7 @@ public inline fun <T> Stream<T>.sumByDouble(transform: (T) -> Double): Double {
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the sum of all values produced by `transform` function from elements in the collection
|
||||
* Returns the sum of all values produced by [transform] function from characters in the string
|
||||
*/
|
||||
public inline fun String.sumByDouble(transform: (Char) -> Double): Double {
|
||||
var sum: Double = 0.0
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -10,7 +10,7 @@ import java.util.*
|
||||
import java.util.Collections // TODO: it's temporary while we have java.util.Collections in js
|
||||
|
||||
/**
|
||||
* Returns a list containing all elements except first *n* elements
|
||||
* Returns a list containing all elements except first [n] elements
|
||||
*/
|
||||
public fun <T> Array<out T>.drop(n: Int): List<T> {
|
||||
if (n >= size())
|
||||
@@ -24,7 +24,7 @@ public fun <T> Array<out T>.drop(n: Int): List<T> {
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a list containing all elements except first *n* elements
|
||||
* Returns a list containing all elements except first [n] elements
|
||||
*/
|
||||
public fun BooleanArray.drop(n: Int): List<Boolean> {
|
||||
if (n >= size())
|
||||
@@ -38,7 +38,7 @@ public fun BooleanArray.drop(n: Int): List<Boolean> {
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a list containing all elements except first *n* elements
|
||||
* Returns a list containing all elements except first [n] elements
|
||||
*/
|
||||
public fun ByteArray.drop(n: Int): List<Byte> {
|
||||
if (n >= size())
|
||||
@@ -52,7 +52,7 @@ public fun ByteArray.drop(n: Int): List<Byte> {
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a list containing all elements except first *n* elements
|
||||
* Returns a list containing all elements except first [n] elements
|
||||
*/
|
||||
public fun CharArray.drop(n: Int): List<Char> {
|
||||
if (n >= size())
|
||||
@@ -66,7 +66,7 @@ public fun CharArray.drop(n: Int): List<Char> {
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a list containing all elements except first *n* elements
|
||||
* Returns a list containing all elements except first [n] elements
|
||||
*/
|
||||
public fun DoubleArray.drop(n: Int): List<Double> {
|
||||
if (n >= size())
|
||||
@@ -80,7 +80,7 @@ public fun DoubleArray.drop(n: Int): List<Double> {
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a list containing all elements except first *n* elements
|
||||
* Returns a list containing all elements except first [n] elements
|
||||
*/
|
||||
public fun FloatArray.drop(n: Int): List<Float> {
|
||||
if (n >= size())
|
||||
@@ -94,7 +94,7 @@ public fun FloatArray.drop(n: Int): List<Float> {
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a list containing all elements except first *n* elements
|
||||
* Returns a list containing all elements except first [n] elements
|
||||
*/
|
||||
public fun IntArray.drop(n: Int): List<Int> {
|
||||
if (n >= size())
|
||||
@@ -108,7 +108,7 @@ public fun IntArray.drop(n: Int): List<Int> {
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a list containing all elements except first *n* elements
|
||||
* Returns a list containing all elements except first [n] elements
|
||||
*/
|
||||
public fun LongArray.drop(n: Int): List<Long> {
|
||||
if (n >= size())
|
||||
@@ -122,7 +122,7 @@ public fun LongArray.drop(n: Int): List<Long> {
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a list containing all elements except first *n* elements
|
||||
* Returns a list containing all elements except first [n] elements
|
||||
*/
|
||||
public fun ShortArray.drop(n: Int): List<Short> {
|
||||
if (n >= size())
|
||||
@@ -136,7 +136,7 @@ public fun ShortArray.drop(n: Int): List<Short> {
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a list containing all elements except first *n* elements
|
||||
* Returns a list containing all elements except first [n] elements
|
||||
*/
|
||||
public fun <T> Collection<T>.drop(n: Int): List<T> {
|
||||
if (n >= size())
|
||||
@@ -150,7 +150,7 @@ public fun <T> Collection<T>.drop(n: Int): List<T> {
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a list containing all elements except first *n* elements
|
||||
* Returns a list containing all elements except first [n] elements
|
||||
*/
|
||||
public fun <T> Iterable<T>.drop(n: Int): List<T> {
|
||||
var count = 0
|
||||
@@ -162,21 +162,21 @@ public fun <T> Iterable<T>.drop(n: Int): List<T> {
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a stream containing all elements except first *n* elements
|
||||
* Returns a stream containing all elements except first [n] elements
|
||||
*/
|
||||
public fun <T> Stream<T>.drop(n: Int): Stream<T> {
|
||||
return DropStream(this, n)
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a list containing all elements except first *n* elements
|
||||
* Returns a string with the first [n] characters removed
|
||||
*/
|
||||
public fun String.drop(n: Int): String {
|
||||
return substring(Math.min(n, length()))
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a list containing all elements except first elements that satisfy the given *predicate*
|
||||
* Returns a list containing all elements except first elements that satisfy the given [predicate]
|
||||
*/
|
||||
public inline fun <T> Array<out T>.dropWhile(predicate: (T) -> Boolean): List<T> {
|
||||
var yielding = false
|
||||
@@ -192,7 +192,7 @@ public inline fun <T> Array<out T>.dropWhile(predicate: (T) -> Boolean): List<T>
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a list containing all elements except first elements that satisfy the given *predicate*
|
||||
* Returns a list containing all elements except first elements that satisfy the given [predicate]
|
||||
*/
|
||||
public inline fun BooleanArray.dropWhile(predicate: (Boolean) -> Boolean): List<Boolean> {
|
||||
var yielding = false
|
||||
@@ -208,7 +208,7 @@ public inline fun BooleanArray.dropWhile(predicate: (Boolean) -> Boolean): List<
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a list containing all elements except first elements that satisfy the given *predicate*
|
||||
* Returns a list containing all elements except first elements that satisfy the given [predicate]
|
||||
*/
|
||||
public inline fun ByteArray.dropWhile(predicate: (Byte) -> Boolean): List<Byte> {
|
||||
var yielding = false
|
||||
@@ -224,7 +224,7 @@ public inline fun ByteArray.dropWhile(predicate: (Byte) -> Boolean): List<Byte>
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a list containing all elements except first elements that satisfy the given *predicate*
|
||||
* Returns a list containing all elements except first elements that satisfy the given [predicate]
|
||||
*/
|
||||
public inline fun CharArray.dropWhile(predicate: (Char) -> Boolean): List<Char> {
|
||||
var yielding = false
|
||||
@@ -240,7 +240,7 @@ public inline fun CharArray.dropWhile(predicate: (Char) -> Boolean): List<Char>
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a list containing all elements except first elements that satisfy the given *predicate*
|
||||
* Returns a list containing all elements except first elements that satisfy the given [predicate]
|
||||
*/
|
||||
public inline fun DoubleArray.dropWhile(predicate: (Double) -> Boolean): List<Double> {
|
||||
var yielding = false
|
||||
@@ -256,7 +256,7 @@ public inline fun DoubleArray.dropWhile(predicate: (Double) -> Boolean): List<Do
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a list containing all elements except first elements that satisfy the given *predicate*
|
||||
* Returns a list containing all elements except first elements that satisfy the given [predicate]
|
||||
*/
|
||||
public inline fun FloatArray.dropWhile(predicate: (Float) -> Boolean): List<Float> {
|
||||
var yielding = false
|
||||
@@ -272,7 +272,7 @@ public inline fun FloatArray.dropWhile(predicate: (Float) -> Boolean): List<Floa
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a list containing all elements except first elements that satisfy the given *predicate*
|
||||
* Returns a list containing all elements except first elements that satisfy the given [predicate]
|
||||
*/
|
||||
public inline fun IntArray.dropWhile(predicate: (Int) -> Boolean): List<Int> {
|
||||
var yielding = false
|
||||
@@ -288,7 +288,7 @@ public inline fun IntArray.dropWhile(predicate: (Int) -> Boolean): List<Int> {
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a list containing all elements except first elements that satisfy the given *predicate*
|
||||
* Returns a list containing all elements except first elements that satisfy the given [predicate]
|
||||
*/
|
||||
public inline fun LongArray.dropWhile(predicate: (Long) -> Boolean): List<Long> {
|
||||
var yielding = false
|
||||
@@ -304,7 +304,7 @@ public inline fun LongArray.dropWhile(predicate: (Long) -> Boolean): List<Long>
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a list containing all elements except first elements that satisfy the given *predicate*
|
||||
* Returns a list containing all elements except first elements that satisfy the given [predicate]
|
||||
*/
|
||||
public inline fun ShortArray.dropWhile(predicate: (Short) -> Boolean): List<Short> {
|
||||
var yielding = false
|
||||
@@ -320,7 +320,7 @@ public inline fun ShortArray.dropWhile(predicate: (Short) -> Boolean): List<Shor
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a list containing all elements except first elements that satisfy the given *predicate*
|
||||
* Returns a list containing all elements except first elements that satisfy the given [predicate]
|
||||
*/
|
||||
public inline fun <T> Iterable<T>.dropWhile(predicate: (T) -> Boolean): List<T> {
|
||||
var yielding = false
|
||||
@@ -336,14 +336,14 @@ public inline fun <T> Iterable<T>.dropWhile(predicate: (T) -> Boolean): List<T>
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a stream containing all elements except first elements that satisfy the given *predicate*
|
||||
* Returns a stream containing all elements except first elements that satisfy the given [predicate]
|
||||
*/
|
||||
public fun <T> Stream<T>.dropWhile(predicate: (T) -> Boolean): Stream<T> {
|
||||
return DropWhileStream(this, predicate)
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a list containing all elements except first elements that satisfy the given *predicate*
|
||||
* Returns a string containing all characters except first characters that satisfy the given [predicate]
|
||||
*/
|
||||
public inline fun String.dropWhile(predicate: (Char) -> Boolean): String {
|
||||
for (index in 0..length - 1)
|
||||
@@ -354,168 +354,168 @@ public inline fun String.dropWhile(predicate: (Char) -> Boolean): String {
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a list containing all elements matching the given *predicate*
|
||||
* Returns a list containing all elements matching the given [predicate]
|
||||
*/
|
||||
public inline fun <T> Array<out T>.filter(predicate: (T) -> Boolean): List<T> {
|
||||
return filterTo(ArrayList<T>(), predicate)
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a list containing all elements matching the given *predicate*
|
||||
* Returns a list containing all elements matching the given [predicate]
|
||||
*/
|
||||
public inline fun BooleanArray.filter(predicate: (Boolean) -> Boolean): List<Boolean> {
|
||||
return filterTo(ArrayList<Boolean>(), predicate)
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a list containing all elements matching the given *predicate*
|
||||
* Returns a list containing all elements matching the given [predicate]
|
||||
*/
|
||||
public inline fun ByteArray.filter(predicate: (Byte) -> Boolean): List<Byte> {
|
||||
return filterTo(ArrayList<Byte>(), predicate)
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a list containing all elements matching the given *predicate*
|
||||
* Returns a list containing all elements matching the given [predicate]
|
||||
*/
|
||||
public inline fun CharArray.filter(predicate: (Char) -> Boolean): List<Char> {
|
||||
return filterTo(ArrayList<Char>(), predicate)
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a list containing all elements matching the given *predicate*
|
||||
* Returns a list containing all elements matching the given [predicate]
|
||||
*/
|
||||
public inline fun DoubleArray.filter(predicate: (Double) -> Boolean): List<Double> {
|
||||
return filterTo(ArrayList<Double>(), predicate)
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a list containing all elements matching the given *predicate*
|
||||
* Returns a list containing all elements matching the given [predicate]
|
||||
*/
|
||||
public inline fun FloatArray.filter(predicate: (Float) -> Boolean): List<Float> {
|
||||
return filterTo(ArrayList<Float>(), predicate)
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a list containing all elements matching the given *predicate*
|
||||
* Returns a list containing all elements matching the given [predicate]
|
||||
*/
|
||||
public inline fun IntArray.filter(predicate: (Int) -> Boolean): List<Int> {
|
||||
return filterTo(ArrayList<Int>(), predicate)
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a list containing all elements matching the given *predicate*
|
||||
* Returns a list containing all elements matching the given [predicate]
|
||||
*/
|
||||
public inline fun LongArray.filter(predicate: (Long) -> Boolean): List<Long> {
|
||||
return filterTo(ArrayList<Long>(), predicate)
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a list containing all elements matching the given *predicate*
|
||||
* Returns a list containing all elements matching the given [predicate]
|
||||
*/
|
||||
public inline fun ShortArray.filter(predicate: (Short) -> Boolean): List<Short> {
|
||||
return filterTo(ArrayList<Short>(), predicate)
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a list containing all elements matching the given *predicate*
|
||||
* Returns a list containing all elements matching the given [predicate]
|
||||
*/
|
||||
public inline fun <T> Iterable<T>.filter(predicate: (T) -> Boolean): List<T> {
|
||||
return filterTo(ArrayList<T>(), predicate)
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a stream containing all elements matching the given *predicate*
|
||||
* Returns a stream containing all elements matching the given [predicate]
|
||||
*/
|
||||
public fun <T> Stream<T>.filter(predicate: (T) -> Boolean): Stream<T> {
|
||||
return FilteringStream(this, true, predicate)
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a list containing all elements matching the given *predicate*
|
||||
* Returns a string containing only those characters from the original string that match the given [predicate]
|
||||
*/
|
||||
public inline fun String.filter(predicate: (Char) -> Boolean): String {
|
||||
return filterTo(StringBuilder(), predicate).toString()
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a list containing all elements not matching the given *predicate*
|
||||
* Returns a list containing all elements not matching the given [predicate]
|
||||
*/
|
||||
public inline fun <T> Array<out T>.filterNot(predicate: (T) -> Boolean): List<T> {
|
||||
return filterNotTo(ArrayList<T>(), predicate)
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a list containing all elements not matching the given *predicate*
|
||||
* Returns a list containing all elements not matching the given [predicate]
|
||||
*/
|
||||
public inline fun BooleanArray.filterNot(predicate: (Boolean) -> Boolean): List<Boolean> {
|
||||
return filterNotTo(ArrayList<Boolean>(), predicate)
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a list containing all elements not matching the given *predicate*
|
||||
* Returns a list containing all elements not matching the given [predicate]
|
||||
*/
|
||||
public inline fun ByteArray.filterNot(predicate: (Byte) -> Boolean): List<Byte> {
|
||||
return filterNotTo(ArrayList<Byte>(), predicate)
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a list containing all elements not matching the given *predicate*
|
||||
* Returns a list containing all elements not matching the given [predicate]
|
||||
*/
|
||||
public inline fun CharArray.filterNot(predicate: (Char) -> Boolean): List<Char> {
|
||||
return filterNotTo(ArrayList<Char>(), predicate)
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a list containing all elements not matching the given *predicate*
|
||||
* Returns a list containing all elements not matching the given [predicate]
|
||||
*/
|
||||
public inline fun DoubleArray.filterNot(predicate: (Double) -> Boolean): List<Double> {
|
||||
return filterNotTo(ArrayList<Double>(), predicate)
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a list containing all elements not matching the given *predicate*
|
||||
* Returns a list containing all elements not matching the given [predicate]
|
||||
*/
|
||||
public inline fun FloatArray.filterNot(predicate: (Float) -> Boolean): List<Float> {
|
||||
return filterNotTo(ArrayList<Float>(), predicate)
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a list containing all elements not matching the given *predicate*
|
||||
* Returns a list containing all elements not matching the given [predicate]
|
||||
*/
|
||||
public inline fun IntArray.filterNot(predicate: (Int) -> Boolean): List<Int> {
|
||||
return filterNotTo(ArrayList<Int>(), predicate)
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a list containing all elements not matching the given *predicate*
|
||||
* Returns a list containing all elements not matching the given [predicate]
|
||||
*/
|
||||
public inline fun LongArray.filterNot(predicate: (Long) -> Boolean): List<Long> {
|
||||
return filterNotTo(ArrayList<Long>(), predicate)
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a list containing all elements not matching the given *predicate*
|
||||
* Returns a list containing all elements not matching the given [predicate]
|
||||
*/
|
||||
public inline fun ShortArray.filterNot(predicate: (Short) -> Boolean): List<Short> {
|
||||
return filterNotTo(ArrayList<Short>(), predicate)
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a list containing all elements not matching the given *predicate*
|
||||
* Returns a list containing all elements not matching the given [predicate]
|
||||
*/
|
||||
public inline fun <T> Iterable<T>.filterNot(predicate: (T) -> Boolean): List<T> {
|
||||
return filterNotTo(ArrayList<T>(), predicate)
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a stream containing all elements not matching the given *predicate*
|
||||
* Returns a stream containing all elements not matching the given [predicate]
|
||||
*/
|
||||
public fun <T> Stream<T>.filterNot(predicate: (T) -> Boolean): Stream<T> {
|
||||
return FilteringStream(this, false, predicate)
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a list containing all elements not matching the given *predicate*
|
||||
* Returns a string containing only those characters from the original string that do not match the given [predicate]
|
||||
*/
|
||||
public inline fun String.filterNot(predicate: (Char) -> Boolean): String {
|
||||
return filterNotTo(StringBuilder(), predicate).toString()
|
||||
@@ -543,7 +543,7 @@ public fun <T : Any> Stream<T?>.filterNotNull(): Stream<T> {
|
||||
}
|
||||
|
||||
/**
|
||||
* Appends all elements that are not null to the given *destination*
|
||||
* Appends all elements that are not null to the given [destination]
|
||||
*/
|
||||
public fun <C : MutableCollection<in T>, T : Any> Array<out T?>.filterNotNullTo(destination: C): C {
|
||||
for (element in this) if (element != null) destination.add(element)
|
||||
@@ -551,7 +551,7 @@ public fun <C : MutableCollection<in T>, T : Any> Array<out T?>.filterNotNullTo(
|
||||
}
|
||||
|
||||
/**
|
||||
* Appends all elements that are not null to the given *destination*
|
||||
* Appends all elements that are not null to the given [destination]
|
||||
*/
|
||||
public fun <C : MutableCollection<in T>, T : Any> Iterable<T?>.filterNotNullTo(destination: C): C {
|
||||
for (element in this) if (element != null) destination.add(element)
|
||||
@@ -559,7 +559,7 @@ public fun <C : MutableCollection<in T>, T : Any> Iterable<T?>.filterNotNullTo(d
|
||||
}
|
||||
|
||||
/**
|
||||
* Appends all elements that are not null to the given *destination*
|
||||
* Appends all elements that are not null to the given [destination]
|
||||
*/
|
||||
public fun <C : MutableCollection<in T>, T : Any> Stream<T?>.filterNotNullTo(destination: C): C {
|
||||
for (element in this) if (element != null) destination.add(element)
|
||||
@@ -567,7 +567,7 @@ public fun <C : MutableCollection<in T>, T : Any> Stream<T?>.filterNotNullTo(des
|
||||
}
|
||||
|
||||
/**
|
||||
* Appends all elements not matching the given *predicate* to the given *destination*
|
||||
* Appends all elements not matching the given [predicate] to the given [destination]
|
||||
*/
|
||||
public inline fun <T, C : MutableCollection<in T>> Array<out T>.filterNotTo(destination: C, predicate: (T) -> Boolean): C {
|
||||
for (element in this) if (!predicate(element)) destination.add(element)
|
||||
@@ -575,7 +575,7 @@ public inline fun <T, C : MutableCollection<in T>> Array<out T>.filterNotTo(dest
|
||||
}
|
||||
|
||||
/**
|
||||
* Appends all elements not matching the given *predicate* to the given *destination*
|
||||
* Appends all elements not matching the given [predicate] to the given [destination]
|
||||
*/
|
||||
public inline fun <C : MutableCollection<in Boolean>> BooleanArray.filterNotTo(destination: C, predicate: (Boolean) -> Boolean): C {
|
||||
for (element in this) if (!predicate(element)) destination.add(element)
|
||||
@@ -583,7 +583,7 @@ public inline fun <C : MutableCollection<in Boolean>> BooleanArray.filterNotTo(d
|
||||
}
|
||||
|
||||
/**
|
||||
* Appends all elements not matching the given *predicate* to the given *destination*
|
||||
* Appends all elements not matching the given [predicate] to the given [destination]
|
||||
*/
|
||||
public inline fun <C : MutableCollection<in Byte>> ByteArray.filterNotTo(destination: C, predicate: (Byte) -> Boolean): C {
|
||||
for (element in this) if (!predicate(element)) destination.add(element)
|
||||
@@ -591,7 +591,7 @@ public inline fun <C : MutableCollection<in Byte>> ByteArray.filterNotTo(destina
|
||||
}
|
||||
|
||||
/**
|
||||
* Appends all elements not matching the given *predicate* to the given *destination*
|
||||
* Appends all elements not matching the given [predicate] to the given [destination]
|
||||
*/
|
||||
public inline fun <C : MutableCollection<in Char>> CharArray.filterNotTo(destination: C, predicate: (Char) -> Boolean): C {
|
||||
for (element in this) if (!predicate(element)) destination.add(element)
|
||||
@@ -599,7 +599,7 @@ public inline fun <C : MutableCollection<in Char>> CharArray.filterNotTo(destina
|
||||
}
|
||||
|
||||
/**
|
||||
* Appends all elements not matching the given *predicate* to the given *destination*
|
||||
* Appends all elements not matching the given [predicate] to the given [destination]
|
||||
*/
|
||||
public inline fun <C : MutableCollection<in Double>> DoubleArray.filterNotTo(destination: C, predicate: (Double) -> Boolean): C {
|
||||
for (element in this) if (!predicate(element)) destination.add(element)
|
||||
@@ -607,7 +607,7 @@ public inline fun <C : MutableCollection<in Double>> DoubleArray.filterNotTo(des
|
||||
}
|
||||
|
||||
/**
|
||||
* Appends all elements not matching the given *predicate* to the given *destination*
|
||||
* Appends all elements not matching the given [predicate] to the given [destination]
|
||||
*/
|
||||
public inline fun <C : MutableCollection<in Float>> FloatArray.filterNotTo(destination: C, predicate: (Float) -> Boolean): C {
|
||||
for (element in this) if (!predicate(element)) destination.add(element)
|
||||
@@ -615,7 +615,7 @@ public inline fun <C : MutableCollection<in Float>> FloatArray.filterNotTo(desti
|
||||
}
|
||||
|
||||
/**
|
||||
* Appends all elements not matching the given *predicate* to the given *destination*
|
||||
* Appends all elements not matching the given [predicate] to the given [destination]
|
||||
*/
|
||||
public inline fun <C : MutableCollection<in Int>> IntArray.filterNotTo(destination: C, predicate: (Int) -> Boolean): C {
|
||||
for (element in this) if (!predicate(element)) destination.add(element)
|
||||
@@ -623,7 +623,7 @@ public inline fun <C : MutableCollection<in Int>> IntArray.filterNotTo(destinati
|
||||
}
|
||||
|
||||
/**
|
||||
* Appends all elements not matching the given *predicate* to the given *destination*
|
||||
* Appends all elements not matching the given [predicate] to the given [destination]
|
||||
*/
|
||||
public inline fun <C : MutableCollection<in Long>> LongArray.filterNotTo(destination: C, predicate: (Long) -> Boolean): C {
|
||||
for (element in this) if (!predicate(element)) destination.add(element)
|
||||
@@ -631,7 +631,7 @@ public inline fun <C : MutableCollection<in Long>> LongArray.filterNotTo(destina
|
||||
}
|
||||
|
||||
/**
|
||||
* Appends all elements not matching the given *predicate* to the given *destination*
|
||||
* Appends all elements not matching the given [predicate] to the given [destination]
|
||||
*/
|
||||
public inline fun <C : MutableCollection<in Short>> ShortArray.filterNotTo(destination: C, predicate: (Short) -> Boolean): C {
|
||||
for (element in this) if (!predicate(element)) destination.add(element)
|
||||
@@ -639,7 +639,7 @@ public inline fun <C : MutableCollection<in Short>> ShortArray.filterNotTo(desti
|
||||
}
|
||||
|
||||
/**
|
||||
* Appends all elements not matching the given *predicate* to the given *destination*
|
||||
* Appends all elements not matching the given [predicate] to the given [destination]
|
||||
*/
|
||||
public inline fun <T, C : MutableCollection<in T>> Iterable<T>.filterNotTo(destination: C, predicate: (T) -> Boolean): C {
|
||||
for (element in this) if (!predicate(element)) destination.add(element)
|
||||
@@ -647,7 +647,7 @@ public inline fun <T, C : MutableCollection<in T>> Iterable<T>.filterNotTo(desti
|
||||
}
|
||||
|
||||
/**
|
||||
* Appends all elements not matching the given *predicate* to the given *destination*
|
||||
* Appends all elements not matching the given [predicate] to the given [destination]
|
||||
*/
|
||||
public inline fun <T, C : MutableCollection<in T>> Stream<T>.filterNotTo(destination: C, predicate: (T) -> Boolean): C {
|
||||
for (element in this) if (!predicate(element)) destination.add(element)
|
||||
@@ -655,7 +655,7 @@ public inline fun <T, C : MutableCollection<in T>> Stream<T>.filterNotTo(destina
|
||||
}
|
||||
|
||||
/**
|
||||
* Appends all characters not matching the given *predicate* to the given *destination*
|
||||
* Appends all characters not matching the given [predicate] to the given [destination]
|
||||
*/
|
||||
public inline fun <C : Appendable> String.filterNotTo(destination: C, predicate: (Char) -> Boolean): C {
|
||||
for (element in this) if (!predicate(element)) destination.append(element)
|
||||
@@ -663,7 +663,7 @@ public inline fun <C : Appendable> String.filterNotTo(destination: C, predicate:
|
||||
}
|
||||
|
||||
/**
|
||||
* Appends all elements matching the given *predicate* into the given *destination*
|
||||
* Appends all elements matching the given [predicate] into the given [destination]
|
||||
*/
|
||||
public inline fun <T, C : MutableCollection<in T>> Array<out T>.filterTo(destination: C, predicate: (T) -> Boolean): C {
|
||||
for (element in this) if (predicate(element)) destination.add(element)
|
||||
@@ -671,7 +671,7 @@ public inline fun <T, C : MutableCollection<in T>> Array<out T>.filterTo(destina
|
||||
}
|
||||
|
||||
/**
|
||||
* Appends all elements matching the given *predicate* into the given *destination*
|
||||
* Appends all elements matching the given [predicate] into the given [destination]
|
||||
*/
|
||||
public inline fun <C : MutableCollection<in Boolean>> BooleanArray.filterTo(destination: C, predicate: (Boolean) -> Boolean): C {
|
||||
for (element in this) if (predicate(element)) destination.add(element)
|
||||
@@ -679,7 +679,7 @@ public inline fun <C : MutableCollection<in Boolean>> BooleanArray.filterTo(dest
|
||||
}
|
||||
|
||||
/**
|
||||
* Appends all elements matching the given *predicate* into the given *destination*
|
||||
* Appends all elements matching the given [predicate] into the given [destination]
|
||||
*/
|
||||
public inline fun <C : MutableCollection<in Byte>> ByteArray.filterTo(destination: C, predicate: (Byte) -> Boolean): C {
|
||||
for (element in this) if (predicate(element)) destination.add(element)
|
||||
@@ -687,7 +687,7 @@ public inline fun <C : MutableCollection<in Byte>> ByteArray.filterTo(destinatio
|
||||
}
|
||||
|
||||
/**
|
||||
* Appends all elements matching the given *predicate* into the given *destination*
|
||||
* Appends all elements matching the given [predicate] into the given [destination]
|
||||
*/
|
||||
public inline fun <C : MutableCollection<in Char>> CharArray.filterTo(destination: C, predicate: (Char) -> Boolean): C {
|
||||
for (element in this) if (predicate(element)) destination.add(element)
|
||||
@@ -695,7 +695,7 @@ public inline fun <C : MutableCollection<in Char>> CharArray.filterTo(destinatio
|
||||
}
|
||||
|
||||
/**
|
||||
* Appends all elements matching the given *predicate* into the given *destination*
|
||||
* Appends all elements matching the given [predicate] into the given [destination]
|
||||
*/
|
||||
public inline fun <C : MutableCollection<in Double>> DoubleArray.filterTo(destination: C, predicate: (Double) -> Boolean): C {
|
||||
for (element in this) if (predicate(element)) destination.add(element)
|
||||
@@ -703,7 +703,7 @@ public inline fun <C : MutableCollection<in Double>> DoubleArray.filterTo(destin
|
||||
}
|
||||
|
||||
/**
|
||||
* Appends all elements matching the given *predicate* into the given *destination*
|
||||
* Appends all elements matching the given [predicate] into the given [destination]
|
||||
*/
|
||||
public inline fun <C : MutableCollection<in Float>> FloatArray.filterTo(destination: C, predicate: (Float) -> Boolean): C {
|
||||
for (element in this) if (predicate(element)) destination.add(element)
|
||||
@@ -711,7 +711,7 @@ public inline fun <C : MutableCollection<in Float>> FloatArray.filterTo(destinat
|
||||
}
|
||||
|
||||
/**
|
||||
* Appends all elements matching the given *predicate* into the given *destination*
|
||||
* Appends all elements matching the given [predicate] into the given [destination]
|
||||
*/
|
||||
public inline fun <C : MutableCollection<in Int>> IntArray.filterTo(destination: C, predicate: (Int) -> Boolean): C {
|
||||
for (element in this) if (predicate(element)) destination.add(element)
|
||||
@@ -719,7 +719,7 @@ public inline fun <C : MutableCollection<in Int>> IntArray.filterTo(destination:
|
||||
}
|
||||
|
||||
/**
|
||||
* Appends all elements matching the given *predicate* into the given *destination*
|
||||
* Appends all elements matching the given [predicate] into the given [destination]
|
||||
*/
|
||||
public inline fun <C : MutableCollection<in Long>> LongArray.filterTo(destination: C, predicate: (Long) -> Boolean): C {
|
||||
for (element in this) if (predicate(element)) destination.add(element)
|
||||
@@ -727,7 +727,7 @@ public inline fun <C : MutableCollection<in Long>> LongArray.filterTo(destinatio
|
||||
}
|
||||
|
||||
/**
|
||||
* Appends all elements matching the given *predicate* into the given *destination*
|
||||
* Appends all elements matching the given [predicate] into the given [destination]
|
||||
*/
|
||||
public inline fun <C : MutableCollection<in Short>> ShortArray.filterTo(destination: C, predicate: (Short) -> Boolean): C {
|
||||
for (element in this) if (predicate(element)) destination.add(element)
|
||||
@@ -735,7 +735,7 @@ public inline fun <C : MutableCollection<in Short>> ShortArray.filterTo(destinat
|
||||
}
|
||||
|
||||
/**
|
||||
* Appends all elements matching the given *predicate* into the given *destination*
|
||||
* Appends all elements matching the given [predicate] into the given [destination]
|
||||
*/
|
||||
public inline fun <T, C : MutableCollection<in T>> Iterable<T>.filterTo(destination: C, predicate: (T) -> Boolean): C {
|
||||
for (element in this) if (predicate(element)) destination.add(element)
|
||||
@@ -743,7 +743,7 @@ public inline fun <T, C : MutableCollection<in T>> Iterable<T>.filterTo(destinat
|
||||
}
|
||||
|
||||
/**
|
||||
* Appends all elements matching the given *predicate* into the given *destination*
|
||||
* Appends all elements matching the given [predicate] into the given [destination]
|
||||
*/
|
||||
public inline fun <T, C : MutableCollection<in T>> Stream<T>.filterTo(destination: C, predicate: (T) -> Boolean): C {
|
||||
for (element in this) if (predicate(element)) destination.add(element)
|
||||
@@ -751,7 +751,7 @@ public inline fun <T, C : MutableCollection<in T>> Stream<T>.filterTo(destinatio
|
||||
}
|
||||
|
||||
/**
|
||||
* Appends all characters matching the given *predicate* to the given *destination*
|
||||
* Appends all characters matching the given [predicate] to the given [destination]
|
||||
*/
|
||||
public inline fun <C : Appendable> String.filterTo(destination: C, predicate: (Char) -> Boolean): C {
|
||||
for (index in 0..length - 1) {
|
||||
@@ -872,7 +872,7 @@ public fun <T> List<T>.slice(indices: Iterable<Int>): List<T> {
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a list containing elements at specified positions
|
||||
* Returns a string containing characters at specified positions
|
||||
*/
|
||||
public fun String.slice(indices: Iterable<Int>): String {
|
||||
val result = StringBuilder()
|
||||
@@ -883,7 +883,7 @@ public fun String.slice(indices: Iterable<Int>): String {
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a list containing first *n* elements
|
||||
* Returns a list containing first [n] elements
|
||||
*/
|
||||
public fun <T> Array<out T>.take(n: Int): List<T> {
|
||||
var count = 0
|
||||
@@ -898,7 +898,7 @@ public fun <T> Array<out T>.take(n: Int): List<T> {
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a list containing first *n* elements
|
||||
* Returns a list containing first [n] elements
|
||||
*/
|
||||
public fun BooleanArray.take(n: Int): List<Boolean> {
|
||||
var count = 0
|
||||
@@ -913,7 +913,7 @@ public fun BooleanArray.take(n: Int): List<Boolean> {
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a list containing first *n* elements
|
||||
* Returns a list containing first [n] elements
|
||||
*/
|
||||
public fun ByteArray.take(n: Int): List<Byte> {
|
||||
var count = 0
|
||||
@@ -928,7 +928,7 @@ public fun ByteArray.take(n: Int): List<Byte> {
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a list containing first *n* elements
|
||||
* Returns a list containing first [n] elements
|
||||
*/
|
||||
public fun CharArray.take(n: Int): List<Char> {
|
||||
var count = 0
|
||||
@@ -943,7 +943,7 @@ public fun CharArray.take(n: Int): List<Char> {
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a list containing first *n* elements
|
||||
* Returns a list containing first [n] elements
|
||||
*/
|
||||
public fun DoubleArray.take(n: Int): List<Double> {
|
||||
var count = 0
|
||||
@@ -958,7 +958,7 @@ public fun DoubleArray.take(n: Int): List<Double> {
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a list containing first *n* elements
|
||||
* Returns a list containing first [n] elements
|
||||
*/
|
||||
public fun FloatArray.take(n: Int): List<Float> {
|
||||
var count = 0
|
||||
@@ -973,7 +973,7 @@ public fun FloatArray.take(n: Int): List<Float> {
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a list containing first *n* elements
|
||||
* Returns a list containing first [n] elements
|
||||
*/
|
||||
public fun IntArray.take(n: Int): List<Int> {
|
||||
var count = 0
|
||||
@@ -988,7 +988,7 @@ public fun IntArray.take(n: Int): List<Int> {
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a list containing first *n* elements
|
||||
* Returns a list containing first [n] elements
|
||||
*/
|
||||
public fun LongArray.take(n: Int): List<Long> {
|
||||
var count = 0
|
||||
@@ -1003,7 +1003,7 @@ public fun LongArray.take(n: Int): List<Long> {
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a list containing first *n* elements
|
||||
* Returns a list containing first [n] elements
|
||||
*/
|
||||
public fun ShortArray.take(n: Int): List<Short> {
|
||||
var count = 0
|
||||
@@ -1018,7 +1018,7 @@ public fun ShortArray.take(n: Int): List<Short> {
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a list containing first *n* elements
|
||||
* Returns a list containing first [n] elements
|
||||
*/
|
||||
public fun <T> Collection<T>.take(n: Int): List<T> {
|
||||
var count = 0
|
||||
@@ -1033,7 +1033,7 @@ public fun <T> Collection<T>.take(n: Int): List<T> {
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a list containing first *n* elements
|
||||
* Returns a list containing first [n] elements
|
||||
*/
|
||||
public fun <T> Iterable<T>.take(n: Int): List<T> {
|
||||
var count = 0
|
||||
@@ -1054,14 +1054,14 @@ public fun <T> Stream<T>.take(n: Int): Stream<T> {
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a list containing first *n* elements
|
||||
* Returns a string containing the first [n] characters from this string, or the entire string if this string is shorter
|
||||
*/
|
||||
public fun String.take(n: Int): String {
|
||||
return substring(0, Math.min(n, length()))
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a list containing first elements satisfying the given *predicate*
|
||||
* Returns a list containing first elements satisfying the given [predicate]
|
||||
*/
|
||||
public inline fun <T> Array<out T>.takeWhile(predicate: (T) -> Boolean): List<T> {
|
||||
val list = ArrayList<T>()
|
||||
@@ -1074,7 +1074,7 @@ public inline fun <T> Array<out T>.takeWhile(predicate: (T) -> Boolean): List<T>
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a list containing first elements satisfying the given *predicate*
|
||||
* Returns a list containing first elements satisfying the given [predicate]
|
||||
*/
|
||||
public inline fun BooleanArray.takeWhile(predicate: (Boolean) -> Boolean): List<Boolean> {
|
||||
val list = ArrayList<Boolean>()
|
||||
@@ -1087,7 +1087,7 @@ public inline fun BooleanArray.takeWhile(predicate: (Boolean) -> Boolean): List<
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a list containing first elements satisfying the given *predicate*
|
||||
* Returns a list containing first elements satisfying the given [predicate]
|
||||
*/
|
||||
public inline fun ByteArray.takeWhile(predicate: (Byte) -> Boolean): List<Byte> {
|
||||
val list = ArrayList<Byte>()
|
||||
@@ -1100,7 +1100,7 @@ public inline fun ByteArray.takeWhile(predicate: (Byte) -> Boolean): List<Byte>
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a list containing first elements satisfying the given *predicate*
|
||||
* Returns a list containing first elements satisfying the given [predicate]
|
||||
*/
|
||||
public inline fun CharArray.takeWhile(predicate: (Char) -> Boolean): List<Char> {
|
||||
val list = ArrayList<Char>()
|
||||
@@ -1113,7 +1113,7 @@ public inline fun CharArray.takeWhile(predicate: (Char) -> Boolean): List<Char>
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a list containing first elements satisfying the given *predicate*
|
||||
* Returns a list containing first elements satisfying the given [predicate]
|
||||
*/
|
||||
public inline fun DoubleArray.takeWhile(predicate: (Double) -> Boolean): List<Double> {
|
||||
val list = ArrayList<Double>()
|
||||
@@ -1126,7 +1126,7 @@ public inline fun DoubleArray.takeWhile(predicate: (Double) -> Boolean): List<Do
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a list containing first elements satisfying the given *predicate*
|
||||
* Returns a list containing first elements satisfying the given [predicate]
|
||||
*/
|
||||
public inline fun FloatArray.takeWhile(predicate: (Float) -> Boolean): List<Float> {
|
||||
val list = ArrayList<Float>()
|
||||
@@ -1139,7 +1139,7 @@ public inline fun FloatArray.takeWhile(predicate: (Float) -> Boolean): List<Floa
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a list containing first elements satisfying the given *predicate*
|
||||
* Returns a list containing first elements satisfying the given [predicate]
|
||||
*/
|
||||
public inline fun IntArray.takeWhile(predicate: (Int) -> Boolean): List<Int> {
|
||||
val list = ArrayList<Int>()
|
||||
@@ -1152,7 +1152,7 @@ public inline fun IntArray.takeWhile(predicate: (Int) -> Boolean): List<Int> {
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a list containing first elements satisfying the given *predicate*
|
||||
* Returns a list containing first elements satisfying the given [predicate]
|
||||
*/
|
||||
public inline fun LongArray.takeWhile(predicate: (Long) -> Boolean): List<Long> {
|
||||
val list = ArrayList<Long>()
|
||||
@@ -1165,7 +1165,7 @@ public inline fun LongArray.takeWhile(predicate: (Long) -> Boolean): List<Long>
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a list containing first elements satisfying the given *predicate*
|
||||
* Returns a list containing first elements satisfying the given [predicate]
|
||||
*/
|
||||
public inline fun ShortArray.takeWhile(predicate: (Short) -> Boolean): List<Short> {
|
||||
val list = ArrayList<Short>()
|
||||
@@ -1178,7 +1178,7 @@ public inline fun ShortArray.takeWhile(predicate: (Short) -> Boolean): List<Shor
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a list containing first elements satisfying the given *predicate*
|
||||
* Returns a list containing first elements satisfying the given [predicate]
|
||||
*/
|
||||
public inline fun <T> Iterable<T>.takeWhile(predicate: (T) -> Boolean): List<T> {
|
||||
val list = ArrayList<T>()
|
||||
@@ -1191,14 +1191,14 @@ public inline fun <T> Iterable<T>.takeWhile(predicate: (T) -> Boolean): List<T>
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a stream containing first elements satisfying the given *predicate*
|
||||
* Returns a stream containing first elements satisfying the given [predicate]
|
||||
*/
|
||||
public fun <T> Stream<T>.takeWhile(predicate: (T) -> Boolean): Stream<T> {
|
||||
return TakeWhileStream(this, predicate)
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a list containing first elements satisfying the given *predicate*
|
||||
* Returns a string containing the first characters that satisfy the given [predicate]
|
||||
*/
|
||||
public inline fun String.takeWhile(predicate: (Char) -> Boolean): String {
|
||||
for (index in 0..length - 1)
|
||||
|
||||
@@ -10,9 +10,9 @@ import java.util.*
|
||||
import java.util.Collections // TODO: it's temporary while we have java.util.Collections in js
|
||||
|
||||
/**
|
||||
* Appends the 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 "...")
|
||||
* Appends the string from all the elements separated using [separator] and using the given [prefix] and [postfix] if supplied.
|
||||
* If the collection could be huge, you can specify a non-negative value of [limit], in which case only the first [limit]
|
||||
* elements will be appended, followed by the [truncated] string (which defaults to "...").
|
||||
*/
|
||||
public fun <T, A : Appendable> Array<out T>.joinTo(buffer: A, separator: String = ", ", prefix: String = "", postfix: String = "", limit: Int = -1, truncated: String = "..."): A {
|
||||
buffer.append(prefix)
|
||||
@@ -30,9 +30,9 @@ public fun <T, A : Appendable> Array<out T>.joinTo(buffer: A, separator: String
|
||||
}
|
||||
|
||||
/**
|
||||
* Appends the 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 "...")
|
||||
* Appends the string from all the elements separated using [separator] and using the given [prefix] and [postfix] if supplied.
|
||||
* If the collection could be huge, you can specify a non-negative value of [limit], in which case only the first [limit]
|
||||
* elements will be appended, followed by the [truncated] string (which defaults to "...").
|
||||
*/
|
||||
public fun <A : Appendable> BooleanArray.joinTo(buffer: A, separator: String = ", ", prefix: String = "", postfix: String = "", limit: Int = -1, truncated: String = "..."): A {
|
||||
buffer.append(prefix)
|
||||
@@ -50,9 +50,9 @@ public fun <A : Appendable> BooleanArray.joinTo(buffer: A, separator: String = "
|
||||
}
|
||||
|
||||
/**
|
||||
* Appends the 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 "...")
|
||||
* Appends the string from all the elements separated using [separator] and using the given [prefix] and [postfix] if supplied.
|
||||
* If the collection could be huge, you can specify a non-negative value of [limit], in which case only the first [limit]
|
||||
* elements will be appended, followed by the [truncated] string (which defaults to "...").
|
||||
*/
|
||||
public fun <A : Appendable> ByteArray.joinTo(buffer: A, separator: String = ", ", prefix: String = "", postfix: String = "", limit: Int = -1, truncated: String = "..."): A {
|
||||
buffer.append(prefix)
|
||||
@@ -70,9 +70,9 @@ public fun <A : Appendable> ByteArray.joinTo(buffer: A, separator: String = ", "
|
||||
}
|
||||
|
||||
/**
|
||||
* Appends the 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 "...")
|
||||
* Appends the string from all the elements separated using [separator] and using the given [prefix] and [postfix] if supplied.
|
||||
* If the collection could be huge, you can specify a non-negative value of [limit], in which case only the first [limit]
|
||||
* elements will be appended, followed by the [truncated] string (which defaults to "...").
|
||||
*/
|
||||
public fun <A : Appendable> CharArray.joinTo(buffer: A, separator: String = ", ", prefix: String = "", postfix: String = "", limit: Int = -1, truncated: String = "..."): A {
|
||||
buffer.append(prefix)
|
||||
@@ -90,9 +90,9 @@ public fun <A : Appendable> CharArray.joinTo(buffer: A, separator: String = ", "
|
||||
}
|
||||
|
||||
/**
|
||||
* Appends the 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 "...")
|
||||
* Appends the string from all the elements separated using [separator] and using the given [prefix] and [postfix] if supplied.
|
||||
* If the collection could be huge, you can specify a non-negative value of [limit], in which case only the first [limit]
|
||||
* elements will be appended, followed by the [truncated] string (which defaults to "...").
|
||||
*/
|
||||
public fun <A : Appendable> DoubleArray.joinTo(buffer: A, separator: String = ", ", prefix: String = "", postfix: String = "", limit: Int = -1, truncated: String = "..."): A {
|
||||
buffer.append(prefix)
|
||||
@@ -110,9 +110,9 @@ public fun <A : Appendable> DoubleArray.joinTo(buffer: A, separator: String = ",
|
||||
}
|
||||
|
||||
/**
|
||||
* Appends the 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 "...")
|
||||
* Appends the string from all the elements separated using [separator] and using the given [prefix] and [postfix] if supplied.
|
||||
* If the collection could be huge, you can specify a non-negative value of [limit], in which case only the first [limit]
|
||||
* elements will be appended, followed by the [truncated] string (which defaults to "...").
|
||||
*/
|
||||
public fun <A : Appendable> FloatArray.joinTo(buffer: A, separator: String = ", ", prefix: String = "", postfix: String = "", limit: Int = -1, truncated: String = "..."): A {
|
||||
buffer.append(prefix)
|
||||
@@ -130,9 +130,9 @@ public fun <A : Appendable> FloatArray.joinTo(buffer: A, separator: String = ",
|
||||
}
|
||||
|
||||
/**
|
||||
* Appends the 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 "...")
|
||||
* Appends the string from all the elements separated using [separator] and using the given [prefix] and [postfix] if supplied.
|
||||
* If the collection could be huge, you can specify a non-negative value of [limit], in which case only the first [limit]
|
||||
* elements will be appended, followed by the [truncated] string (which defaults to "...").
|
||||
*/
|
||||
public fun <A : Appendable> IntArray.joinTo(buffer: A, separator: String = ", ", prefix: String = "", postfix: String = "", limit: Int = -1, truncated: String = "..."): A {
|
||||
buffer.append(prefix)
|
||||
@@ -150,9 +150,9 @@ public fun <A : Appendable> IntArray.joinTo(buffer: A, separator: String = ", ",
|
||||
}
|
||||
|
||||
/**
|
||||
* Appends the 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 "...")
|
||||
* Appends the string from all the elements separated using [separator] and using the given [prefix] and [postfix] if supplied.
|
||||
* If the collection could be huge, you can specify a non-negative value of [limit], in which case only the first [limit]
|
||||
* elements will be appended, followed by the [truncated] string (which defaults to "...").
|
||||
*/
|
||||
public fun <A : Appendable> LongArray.joinTo(buffer: A, separator: String = ", ", prefix: String = "", postfix: String = "", limit: Int = -1, truncated: String = "..."): A {
|
||||
buffer.append(prefix)
|
||||
@@ -170,9 +170,9 @@ public fun <A : Appendable> LongArray.joinTo(buffer: A, separator: String = ", "
|
||||
}
|
||||
|
||||
/**
|
||||
* Appends the 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 "...")
|
||||
* Appends the string from all the elements separated using [separator] and using the given [prefix] and [postfix] if supplied.
|
||||
* If the collection could be huge, you can specify a non-negative value of [limit], in which case only the first [limit]
|
||||
* elements will be appended, followed by the [truncated] string (which defaults to "...").
|
||||
*/
|
||||
public fun <A : Appendable> ShortArray.joinTo(buffer: A, separator: String = ", ", prefix: String = "", postfix: String = "", limit: Int = -1, truncated: String = "..."): A {
|
||||
buffer.append(prefix)
|
||||
@@ -190,9 +190,9 @@ public fun <A : Appendable> ShortArray.joinTo(buffer: A, separator: String = ",
|
||||
}
|
||||
|
||||
/**
|
||||
* Appends the 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 "...")
|
||||
* Appends the string from all the elements separated using [separator] and using the given [prefix] and [postfix] if supplied.
|
||||
* If the collection could be huge, you can specify a non-negative value of [limit], in which case only the first [limit]
|
||||
* elements will be appended, followed by the [truncated] string (which defaults to "...").
|
||||
*/
|
||||
public fun <T, A : Appendable> Iterable<T>.joinTo(buffer: A, separator: String = ", ", prefix: String = "", postfix: String = "", limit: Int = -1, truncated: String = "..."): A {
|
||||
buffer.append(prefix)
|
||||
@@ -210,9 +210,9 @@ public fun <T, A : Appendable> Iterable<T>.joinTo(buffer: A, separator: String =
|
||||
}
|
||||
|
||||
/**
|
||||
* Appends the 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 "...")
|
||||
* Appends the string from all the elements separated using [separator] and using the given [prefix] and [postfix] if supplied.
|
||||
* If the collection could be huge, you can specify a non-negative value of [limit], in which case only the first [limit]
|
||||
* elements will be appended, followed by the [truncated] string (which defaults to "...").
|
||||
*/
|
||||
public fun <T, A : Appendable> Stream<T>.joinTo(buffer: A, separator: String = ", ", prefix: String = "", postfix: String = "", limit: Int = -1, truncated: String = "..."): A {
|
||||
buffer.append(prefix)
|
||||
@@ -230,99 +230,99 @@ public fun <T, A : Appendable> Stream<T>.joinTo(buffer: A, separator: String = "
|
||||
}
|
||||
|
||||
/**
|
||||
* 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 "..."
|
||||
* Creates a string from all the elements separated using [separator] and using the given [prefix] and [postfix] if supplied.
|
||||
* If the collection could be huge, you can specify a non-negative value of [limit], in which case only the first [limit]
|
||||
* elements will be appended, followed by the [truncated] string (which defaults to "...").
|
||||
*/
|
||||
public fun <T> Array<out T>.joinToString(separator: String = ", ", prefix: String = "", postfix: String = "", limit: Int = -1, truncated: String = "..."): String {
|
||||
return joinTo(StringBuilder(), separator, prefix, postfix, limit, truncated).toString()
|
||||
}
|
||||
|
||||
/**
|
||||
* 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 "..."
|
||||
* Creates a string from all the elements separated using [separator] and using the given [prefix] and [postfix] if supplied.
|
||||
* If the collection could be huge, you can specify a non-negative value of [limit], in which case only the first [limit]
|
||||
* elements will be appended, followed by the [truncated] string (which defaults to "...").
|
||||
*/
|
||||
public fun BooleanArray.joinToString(separator: String = ", ", prefix: String = "", postfix: String = "", limit: Int = -1, truncated: String = "..."): String {
|
||||
return joinTo(StringBuilder(), separator, prefix, postfix, limit, truncated).toString()
|
||||
}
|
||||
|
||||
/**
|
||||
* 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 "..."
|
||||
* Creates a string from all the elements separated using [separator] and using the given [prefix] and [postfix] if supplied.
|
||||
* If the collection could be huge, you can specify a non-negative value of [limit], in which case only the first [limit]
|
||||
* elements will be appended, followed by the [truncated] string (which defaults to "...").
|
||||
*/
|
||||
public fun ByteArray.joinToString(separator: String = ", ", prefix: String = "", postfix: String = "", limit: Int = -1, truncated: String = "..."): String {
|
||||
return joinTo(StringBuilder(), separator, prefix, postfix, limit, truncated).toString()
|
||||
}
|
||||
|
||||
/**
|
||||
* 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 "..."
|
||||
* Creates a string from all the elements separated using [separator] and using the given [prefix] and [postfix] if supplied.
|
||||
* If the collection could be huge, you can specify a non-negative value of [limit], in which case only the first [limit]
|
||||
* elements will be appended, followed by the [truncated] string (which defaults to "...").
|
||||
*/
|
||||
public fun CharArray.joinToString(separator: String = ", ", prefix: String = "", postfix: String = "", limit: Int = -1, truncated: String = "..."): String {
|
||||
return joinTo(StringBuilder(), separator, prefix, postfix, limit, truncated).toString()
|
||||
}
|
||||
|
||||
/**
|
||||
* 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 "..."
|
||||
* Creates a string from all the elements separated using [separator] and using the given [prefix] and [postfix] if supplied.
|
||||
* If the collection could be huge, you can specify a non-negative value of [limit], in which case only the first [limit]
|
||||
* elements will be appended, followed by the [truncated] string (which defaults to "...").
|
||||
*/
|
||||
public fun DoubleArray.joinToString(separator: String = ", ", prefix: String = "", postfix: String = "", limit: Int = -1, truncated: String = "..."): String {
|
||||
return joinTo(StringBuilder(), separator, prefix, postfix, limit, truncated).toString()
|
||||
}
|
||||
|
||||
/**
|
||||
* 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 "..."
|
||||
* Creates a string from all the elements separated using [separator] and using the given [prefix] and [postfix] if supplied.
|
||||
* If the collection could be huge, you can specify a non-negative value of [limit], in which case only the first [limit]
|
||||
* elements will be appended, followed by the [truncated] string (which defaults to "...").
|
||||
*/
|
||||
public fun FloatArray.joinToString(separator: String = ", ", prefix: String = "", postfix: String = "", limit: Int = -1, truncated: String = "..."): String {
|
||||
return joinTo(StringBuilder(), separator, prefix, postfix, limit, truncated).toString()
|
||||
}
|
||||
|
||||
/**
|
||||
* 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 "..."
|
||||
* Creates a string from all the elements separated using [separator] and using the given [prefix] and [postfix] if supplied.
|
||||
* If the collection could be huge, you can specify a non-negative value of [limit], in which case only the first [limit]
|
||||
* elements will be appended, followed by the [truncated] string (which defaults to "...").
|
||||
*/
|
||||
public fun IntArray.joinToString(separator: String = ", ", prefix: String = "", postfix: String = "", limit: Int = -1, truncated: String = "..."): String {
|
||||
return joinTo(StringBuilder(), separator, prefix, postfix, limit, truncated).toString()
|
||||
}
|
||||
|
||||
/**
|
||||
* 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 "..."
|
||||
* Creates a string from all the elements separated using [separator] and using the given [prefix] and [postfix] if supplied.
|
||||
* If the collection could be huge, you can specify a non-negative value of [limit], in which case only the first [limit]
|
||||
* elements will be appended, followed by the [truncated] string (which defaults to "...").
|
||||
*/
|
||||
public fun LongArray.joinToString(separator: String = ", ", prefix: String = "", postfix: String = "", limit: Int = -1, truncated: String = "..."): String {
|
||||
return joinTo(StringBuilder(), separator, prefix, postfix, limit, truncated).toString()
|
||||
}
|
||||
|
||||
/**
|
||||
* 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 "..."
|
||||
* Creates a string from all the elements separated using [separator] and using the given [prefix] and [postfix] if supplied.
|
||||
* If the collection could be huge, you can specify a non-negative value of [limit], in which case only the first [limit]
|
||||
* elements will be appended, followed by the [truncated] string (which defaults to "...").
|
||||
*/
|
||||
public fun ShortArray.joinToString(separator: String = ", ", prefix: String = "", postfix: String = "", limit: Int = -1, truncated: String = "..."): String {
|
||||
return joinTo(StringBuilder(), separator, prefix, postfix, limit, truncated).toString()
|
||||
}
|
||||
|
||||
/**
|
||||
* 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 "..."
|
||||
* Creates a string from all the elements separated using [separator] and using the given [prefix] and [postfix] if supplied.
|
||||
* If the collection could be huge, you can specify a non-negative value of [limit], in which case only the first [limit]
|
||||
* elements will be appended, followed by the [truncated] string (which defaults to "...").
|
||||
*/
|
||||
public fun <T> Iterable<T>.joinToString(separator: String = ", ", prefix: String = "", postfix: String = "", limit: Int = -1, truncated: String = "..."): String {
|
||||
return joinTo(StringBuilder(), separator, prefix, postfix, limit, truncated).toString()
|
||||
}
|
||||
|
||||
/**
|
||||
* 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 "..."
|
||||
* Creates a string from all the elements separated using [separator] and using the given [prefix] and [postfix] if supplied.
|
||||
* If the collection could be huge, you can specify a non-negative value of [limit], in which case only the first [limit]
|
||||
* elements will be appended, followed by the [truncated] string (which defaults to "...").
|
||||
*/
|
||||
public fun <T> Stream<T>.joinToString(separator: String = ", ", prefix: String = "", postfix: String = "", limit: Int = -1, truncated: String = "..."): String {
|
||||
return joinTo(StringBuilder(), separator, prefix, postfix, limit, truncated).toString()
|
||||
|
||||
Reference in New Issue
Block a user