Prettify kdocs and exception messages in the generated code.

This commit is contained in:
Ilya Gorbunov
2015-05-27 18:21:17 +03:00
parent fe49a2ee51
commit ae60f7a32f
28 changed files with 1523 additions and 1522 deletions
File diff suppressed because it is too large Load Diff
+45 -45
View File
@@ -11,7 +11,7 @@ import java.util.*
import java.util.Collections // TODO: it's temporary while we have java.util.Collections in js
/**
* Returns the Iterable that wraps the original array
* Returns the Iterable that wraps the original array.
*/
public fun <T> Array<out T>.asIterable(): Iterable<T> {
return object : Iterable<T> {
@@ -20,7 +20,7 @@ public fun <T> Array<out T>.asIterable(): Iterable<T> {
}
/**
* Returns the Iterable that wraps the original array
* Returns the Iterable that wraps the original array.
*/
public fun BooleanArray.asIterable(): Iterable<Boolean> {
return object : Iterable<Boolean> {
@@ -29,7 +29,7 @@ public fun BooleanArray.asIterable(): Iterable<Boolean> {
}
/**
* Returns the Iterable that wraps the original array
* Returns the Iterable that wraps the original array.
*/
public fun ByteArray.asIterable(): Iterable<Byte> {
return object : Iterable<Byte> {
@@ -38,7 +38,7 @@ public fun ByteArray.asIterable(): Iterable<Byte> {
}
/**
* Returns the Iterable that wraps the original array
* Returns the Iterable that wraps the original array.
*/
public fun CharArray.asIterable(): Iterable<Char> {
return object : Iterable<Char> {
@@ -47,7 +47,7 @@ public fun CharArray.asIterable(): Iterable<Char> {
}
/**
* Returns the Iterable that wraps the original array
* Returns the Iterable that wraps the original array.
*/
public fun DoubleArray.asIterable(): Iterable<Double> {
return object : Iterable<Double> {
@@ -56,7 +56,7 @@ public fun DoubleArray.asIterable(): Iterable<Double> {
}
/**
* Returns the Iterable that wraps the original array
* Returns the Iterable that wraps the original array.
*/
public fun FloatArray.asIterable(): Iterable<Float> {
return object : Iterable<Float> {
@@ -65,7 +65,7 @@ public fun FloatArray.asIterable(): Iterable<Float> {
}
/**
* Returns the Iterable that wraps the original array
* Returns the Iterable that wraps the original array.
*/
public fun IntArray.asIterable(): Iterable<Int> {
return object : Iterable<Int> {
@@ -74,7 +74,7 @@ public fun IntArray.asIterable(): Iterable<Int> {
}
/**
* Returns the Iterable that wraps the original array
* Returns the Iterable that wraps the original array.
*/
public fun LongArray.asIterable(): Iterable<Long> {
return object : Iterable<Long> {
@@ -83,7 +83,7 @@ public fun LongArray.asIterable(): Iterable<Long> {
}
/**
* Returns the Iterable that wraps the original array
* Returns the Iterable that wraps the original array.
*/
public fun ShortArray.asIterable(): Iterable<Short> {
return object : Iterable<Short> {
@@ -92,235 +92,235 @@ public fun ShortArray.asIterable(): Iterable<Short> {
}
/**
* Returns the range of valid indices for the array
* Returns the range of valid indices for the array.
*/
public val <T> Array<out T>.indices: IntRange
get() = IntRange(0, lastIndex)
/**
* Returns the range of valid indices for the array
* Returns the range of valid indices for the array.
*/
public val BooleanArray.indices: IntRange
get() = IntRange(0, lastIndex)
/**
* Returns the range of valid indices for the array
* Returns the range of valid indices for the array.
*/
public val ByteArray.indices: IntRange
get() = IntRange(0, lastIndex)
/**
* Returns the range of valid indices for the array
* Returns the range of valid indices for the array.
*/
public val CharArray.indices: IntRange
get() = IntRange(0, lastIndex)
/**
* Returns the range of valid indices for the array
* Returns the range of valid indices for the array.
*/
public val DoubleArray.indices: IntRange
get() = IntRange(0, lastIndex)
/**
* Returns the range of valid indices for the array
* Returns the range of valid indices for the array.
*/
public val FloatArray.indices: IntRange
get() = IntRange(0, lastIndex)
/**
* Returns the range of valid indices for the array
* Returns the range of valid indices for the array.
*/
public val IntArray.indices: IntRange
get() = IntRange(0, lastIndex)
/**
* Returns the range of valid indices for the array
* Returns the range of valid indices for the array.
*/
public val LongArray.indices: IntRange
get() = IntRange(0, lastIndex)
/**
* Returns the range of valid indices for the array
* Returns the range of valid indices for the array.
*/
public val ShortArray.indices: IntRange
get() = IntRange(0, lastIndex)
/**
* Returns true if the array is empty
* Returns `true` if the array is empty.
*/
public fun <T> Array<out T>.isEmpty(): Boolean {
return size() == 0
}
/**
* Returns true if the array is empty
* Returns `true` if the array is empty.
*/
public fun BooleanArray.isEmpty(): Boolean {
return size() == 0
}
/**
* Returns true if the array is empty
* Returns `true` if the array is empty.
*/
public fun ByteArray.isEmpty(): Boolean {
return size() == 0
}
/**
* Returns true if the array is empty
* Returns `true` if the array is empty.
*/
public fun CharArray.isEmpty(): Boolean {
return size() == 0
}
/**
* Returns true if the array is empty
* Returns `true` if the array is empty.
*/
public fun DoubleArray.isEmpty(): Boolean {
return size() == 0
}
/**
* Returns true if the array is empty
* Returns `true` if the array is empty.
*/
public fun FloatArray.isEmpty(): Boolean {
return size() == 0
}
/**
* Returns true if the array is empty
* Returns `true` if the array is empty.
*/
public fun IntArray.isEmpty(): Boolean {
return size() == 0
}
/**
* Returns true if the array is empty
* Returns `true` if the array is empty.
*/
public fun LongArray.isEmpty(): Boolean {
return size() == 0
}
/**
* Returns true if the array is empty
* Returns `true` if the array is empty.
*/
public fun ShortArray.isEmpty(): Boolean {
return size() == 0
}
/**
* Returns true if the array is not empty
* Returns `true` if the array is not empty.
*/
public fun <T> Array<out T>.isNotEmpty(): Boolean {
return !isEmpty()
}
/**
* Returns true if the array is not empty
* Returns `true` if the array is not empty.
*/
public fun BooleanArray.isNotEmpty(): Boolean {
return !isEmpty()
}
/**
* Returns true if the array is not empty
* Returns `true` if the array is not empty.
*/
public fun ByteArray.isNotEmpty(): Boolean {
return !isEmpty()
}
/**
* Returns true if the array is not empty
* Returns `true` if the array is not empty.
*/
public fun CharArray.isNotEmpty(): Boolean {
return !isEmpty()
}
/**
* Returns true if the array is not empty
* Returns `true` if the array is not empty.
*/
public fun DoubleArray.isNotEmpty(): Boolean {
return !isEmpty()
}
/**
* Returns true if the array is not empty
* Returns `true` if the array is not empty.
*/
public fun FloatArray.isNotEmpty(): Boolean {
return !isEmpty()
}
/**
* Returns true if the array is not empty
* Returns `true` if the array is not empty.
*/
public fun IntArray.isNotEmpty(): Boolean {
return !isEmpty()
}
/**
* Returns true if the array is not empty
* Returns `true` if the array is not empty.
*/
public fun LongArray.isNotEmpty(): Boolean {
return !isEmpty()
}
/**
* Returns true if the array is not empty
* Returns `true` if the array is not empty.
*/
public fun ShortArray.isNotEmpty(): Boolean {
return !isEmpty()
}
/**
* Returns the last valid index for the array
* Returns the last valid index for the array.
*/
public val <T> Array<out T>.lastIndex: Int
get() = size() - 1
/**
* Returns the last valid index for the array
* Returns the last valid index for the array.
*/
public val BooleanArray.lastIndex: Int
get() = size() - 1
/**
* Returns the last valid index for the array
* Returns the last valid index for the array.
*/
public val ByteArray.lastIndex: Int
get() = size() - 1
/**
* Returns the last valid index for the array
* Returns the last valid index for the array.
*/
public val CharArray.lastIndex: Int
get() = size() - 1
/**
* Returns the last valid index for the array
* Returns the last valid index for the array.
*/
public val DoubleArray.lastIndex: Int
get() = size() - 1
/**
* Returns the last valid index for the array
* Returns the last valid index for the array.
*/
public val FloatArray.lastIndex: Int
get() = size() - 1
/**
* Returns the last valid index for the array
* Returns the last valid index for the array.
*/
public val IntArray.lastIndex: Int
get() = size() - 1
/**
* Returns the last valid index for the array
* Returns the last valid index for the array.
*/
public val LongArray.lastIndex: Int
get() = size() - 1
/**
* Returns the last valid index for the array
* Returns the last valid index for the array.
*/
public val ShortArray.lastIndex: Int
get() = size() - 1
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+92 -92
View File
@@ -11,7 +11,7 @@ import java.util.*
import java.util.Collections // TODO: it's temporary while we have java.util.Collections in js
/**
* Returns a list of values built from elements of both collections with same indexes using provided *transform*. List has length of shortest collection.
* Returns a list of values built from elements of both collections with same indexes using provided [transform]. List has length of shortest collection.
*/
public inline fun <T, R, V> Array<out T>.merge(array: Array<out R>, transform: (T, R) -> V): List<V> {
val first = iterator()
@@ -24,7 +24,7 @@ public inline fun <T, R, V> Array<out T>.merge(array: Array<out R>, transform: (
}
/**
* Returns a list of values built from elements of both collections with same indexes using provided *transform*. List has length of shortest collection.
* Returns a list of values built from elements of both collections with same indexes using provided [transform]. List has length of shortest collection.
*/
public inline fun <R, V> BooleanArray.merge(array: Array<out R>, transform: (Boolean, R) -> V): List<V> {
val first = iterator()
@@ -37,7 +37,7 @@ public inline fun <R, V> BooleanArray.merge(array: Array<out R>, transform: (Boo
}
/**
* Returns a list of values built from elements of both collections with same indexes using provided *transform*. List has length of shortest collection.
* Returns a list of values built from elements of both collections with same indexes using provided [transform]. List has length of shortest collection.
*/
public inline fun <R, V> ByteArray.merge(array: Array<out R>, transform: (Byte, R) -> V): List<V> {
val first = iterator()
@@ -50,7 +50,7 @@ public inline fun <R, V> ByteArray.merge(array: Array<out R>, transform: (Byte,
}
/**
* Returns a list of values built from elements of both collections with same indexes using provided *transform*. List has length of shortest collection.
* Returns a list of values built from elements of both collections with same indexes using provided [transform]. List has length of shortest collection.
*/
public inline fun <R, V> CharArray.merge(array: Array<out R>, transform: (Char, R) -> V): List<V> {
val first = iterator()
@@ -63,7 +63,7 @@ public inline fun <R, V> CharArray.merge(array: Array<out R>, transform: (Char,
}
/**
* Returns a list of values built from elements of both collections with same indexes using provided *transform*. List has length of shortest collection.
* Returns a list of values built from elements of both collections with same indexes using provided [transform]. List has length of shortest collection.
*/
public inline fun <R, V> DoubleArray.merge(array: Array<out R>, transform: (Double, R) -> V): List<V> {
val first = iterator()
@@ -76,7 +76,7 @@ public inline fun <R, V> DoubleArray.merge(array: Array<out R>, transform: (Doub
}
/**
* Returns a list of values built from elements of both collections with same indexes using provided *transform*. List has length of shortest collection.
* Returns a list of values built from elements of both collections with same indexes using provided [transform]. List has length of shortest collection.
*/
public inline fun <R, V> FloatArray.merge(array: Array<out R>, transform: (Float, R) -> V): List<V> {
val first = iterator()
@@ -89,7 +89,7 @@ public inline fun <R, V> FloatArray.merge(array: Array<out R>, transform: (Float
}
/**
* Returns a list of values built from elements of both collections with same indexes using provided *transform*. List has length of shortest collection.
* Returns a list of values built from elements of both collections with same indexes using provided [transform]. List has length of shortest collection.
*/
public inline fun <R, V> IntArray.merge(array: Array<out R>, transform: (Int, R) -> V): List<V> {
val first = iterator()
@@ -102,7 +102,7 @@ public inline fun <R, V> IntArray.merge(array: Array<out R>, transform: (Int, R)
}
/**
* Returns a list of values built from elements of both collections with same indexes using provided *transform*. List has length of shortest collection.
* Returns a list of values built from elements of both collections with same indexes using provided [transform]. List has length of shortest collection.
*/
public inline fun <R, V> LongArray.merge(array: Array<out R>, transform: (Long, R) -> V): List<V> {
val first = iterator()
@@ -115,7 +115,7 @@ public inline fun <R, V> LongArray.merge(array: Array<out R>, transform: (Long,
}
/**
* Returns a list of values built from elements of both collections with same indexes using provided *transform*. List has length of shortest collection.
* Returns a list of values built from elements of both collections with same indexes using provided [transform]. List has length of shortest collection.
*/
public inline fun <R, V> ShortArray.merge(array: Array<out R>, transform: (Short, R) -> V): List<V> {
val first = iterator()
@@ -128,7 +128,7 @@ public inline fun <R, V> ShortArray.merge(array: Array<out R>, transform: (Short
}
/**
* Returns a list of values built from elements of both collections with same indexes using provided *transform*. List has length of shortest collection.
* Returns a list of values built from elements of both collections with same indexes using provided [transform]. List has length of shortest collection.
*/
public inline fun <T, R, V> Iterable<T>.merge(array: Array<out R>, transform: (T, R) -> V): List<V> {
val first = iterator()
@@ -141,7 +141,7 @@ public inline fun <T, R, V> Iterable<T>.merge(array: Array<out R>, transform: (T
}
/**
* Returns a list of values built from elements of both collections with same indexes using provided *transform*. List has length of shortest collection.
* Returns a list of values built from elements of both collections with same indexes using provided [transform]. List has length of shortest collection.
*/
public inline fun <V> BooleanArray.merge(array: BooleanArray, transform: (Boolean, Boolean) -> V): List<V> {
val first = iterator()
@@ -154,7 +154,7 @@ public inline fun <V> BooleanArray.merge(array: BooleanArray, transform: (Boolea
}
/**
* Returns a list of values built from elements of both collections with same indexes using provided *transform*. List has length of shortest collection.
* Returns a list of values built from elements of both collections with same indexes using provided [transform]. List has length of shortest collection.
*/
public inline fun <V> ByteArray.merge(array: ByteArray, transform: (Byte, Byte) -> V): List<V> {
val first = iterator()
@@ -167,7 +167,7 @@ public inline fun <V> ByteArray.merge(array: ByteArray, transform: (Byte, Byte)
}
/**
* Returns a list of values built from elements of both collections with same indexes using provided *transform*. List has length of shortest collection.
* Returns a list of values built from elements of both collections with same indexes using provided [transform]. List has length of shortest collection.
*/
public inline fun <V> CharArray.merge(array: CharArray, transform: (Char, Char) -> V): List<V> {
val first = iterator()
@@ -180,7 +180,7 @@ public inline fun <V> CharArray.merge(array: CharArray, transform: (Char, Char)
}
/**
* Returns a list of values built from elements of both collections with same indexes using provided *transform*. List has length of shortest collection.
* Returns a list of values built from elements of both collections with same indexes using provided [transform]. List has length of shortest collection.
*/
public inline fun <V> DoubleArray.merge(array: DoubleArray, transform: (Double, Double) -> V): List<V> {
val first = iterator()
@@ -193,7 +193,7 @@ public inline fun <V> DoubleArray.merge(array: DoubleArray, transform: (Double,
}
/**
* Returns a list of values built from elements of both collections with same indexes using provided *transform*. List has length of shortest collection.
* Returns a list of values built from elements of both collections with same indexes using provided [transform]. List has length of shortest collection.
*/
public inline fun <V> FloatArray.merge(array: FloatArray, transform: (Float, Float) -> V): List<V> {
val first = iterator()
@@ -206,7 +206,7 @@ public inline fun <V> FloatArray.merge(array: FloatArray, transform: (Float, Flo
}
/**
* Returns a list of values built from elements of both collections with same indexes using provided *transform*. List has length of shortest collection.
* Returns a list of values built from elements of both collections with same indexes using provided [transform]. List has length of shortest collection.
*/
public inline fun <V> IntArray.merge(array: IntArray, transform: (Int, Int) -> V): List<V> {
val first = iterator()
@@ -219,7 +219,7 @@ public inline fun <V> IntArray.merge(array: IntArray, transform: (Int, Int) -> V
}
/**
* Returns a list of values built from elements of both collections with same indexes using provided *transform*. List has length of shortest collection.
* Returns a list of values built from elements of both collections with same indexes using provided [transform]. List has length of shortest collection.
*/
public inline fun <V> LongArray.merge(array: LongArray, transform: (Long, Long) -> V): List<V> {
val first = iterator()
@@ -232,7 +232,7 @@ public inline fun <V> LongArray.merge(array: LongArray, transform: (Long, Long)
}
/**
* Returns a list of values built from elements of both collections with same indexes using provided *transform*. List has length of shortest collection.
* Returns a list of values built from elements of both collections with same indexes using provided [transform]. List has length of shortest collection.
*/
public inline fun <V> ShortArray.merge(array: ShortArray, transform: (Short, Short) -> V): List<V> {
val first = iterator()
@@ -245,7 +245,7 @@ public inline fun <V> ShortArray.merge(array: ShortArray, transform: (Short, Sho
}
/**
* Returns a list of values built from elements of both collections with same indexes using provided *transform*. List has length of shortest collection.
* Returns a list of values built from elements of both collections with same indexes using provided [transform]. List has length of shortest collection.
*/
public inline fun <T, R, V> Array<out T>.merge(other: Iterable<R>, transform: (T, R) -> V): List<V> {
val first = iterator()
@@ -258,7 +258,7 @@ public inline fun <T, R, V> Array<out T>.merge(other: Iterable<R>, transform: (T
}
/**
* Returns a list of values built from elements of both collections with same indexes using provided *transform*. List has length of shortest collection.
* Returns a list of values built from elements of both collections with same indexes using provided [transform]. List has length of shortest collection.
*/
public inline fun <R, V> BooleanArray.merge(other: Iterable<R>, transform: (Boolean, R) -> V): List<V> {
val first = iterator()
@@ -271,7 +271,7 @@ public inline fun <R, V> BooleanArray.merge(other: Iterable<R>, transform: (Bool
}
/**
* Returns a list of values built from elements of both collections with same indexes using provided *transform*. List has length of shortest collection.
* Returns a list of values built from elements of both collections with same indexes using provided [transform]. List has length of shortest collection.
*/
public inline fun <R, V> ByteArray.merge(other: Iterable<R>, transform: (Byte, R) -> V): List<V> {
val first = iterator()
@@ -284,7 +284,7 @@ public inline fun <R, V> ByteArray.merge(other: Iterable<R>, transform: (Byte, R
}
/**
* Returns a list of values built from elements of both collections with same indexes using provided *transform*. List has length of shortest collection.
* Returns a list of values built from elements of both collections with same indexes using provided [transform]. List has length of shortest collection.
*/
public inline fun <R, V> CharArray.merge(other: Iterable<R>, transform: (Char, R) -> V): List<V> {
val first = iterator()
@@ -297,7 +297,7 @@ public inline fun <R, V> CharArray.merge(other: Iterable<R>, transform: (Char, R
}
/**
* Returns a list of values built from elements of both collections with same indexes using provided *transform*. List has length of shortest collection.
* Returns a list of values built from elements of both collections with same indexes using provided [transform]. List has length of shortest collection.
*/
public inline fun <R, V> DoubleArray.merge(other: Iterable<R>, transform: (Double, R) -> V): List<V> {
val first = iterator()
@@ -310,7 +310,7 @@ public inline fun <R, V> DoubleArray.merge(other: Iterable<R>, transform: (Doubl
}
/**
* Returns a list of values built from elements of both collections with same indexes using provided *transform*. List has length of shortest collection.
* Returns a list of values built from elements of both collections with same indexes using provided [transform]. List has length of shortest collection.
*/
public inline fun <R, V> FloatArray.merge(other: Iterable<R>, transform: (Float, R) -> V): List<V> {
val first = iterator()
@@ -323,7 +323,7 @@ public inline fun <R, V> FloatArray.merge(other: Iterable<R>, transform: (Float,
}
/**
* Returns a list of values built from elements of both collections with same indexes using provided *transform*. List has length of shortest collection.
* Returns a list of values built from elements of both collections with same indexes using provided [transform]. List has length of shortest collection.
*/
public inline fun <R, V> IntArray.merge(other: Iterable<R>, transform: (Int, R) -> V): List<V> {
val first = iterator()
@@ -336,7 +336,7 @@ public inline fun <R, V> IntArray.merge(other: Iterable<R>, transform: (Int, R)
}
/**
* Returns a list of values built from elements of both collections with same indexes using provided *transform*. List has length of shortest collection.
* Returns a list of values built from elements of both collections with same indexes using provided [transform]. List has length of shortest collection.
*/
public inline fun <R, V> LongArray.merge(other: Iterable<R>, transform: (Long, R) -> V): List<V> {
val first = iterator()
@@ -349,7 +349,7 @@ public inline fun <R, V> LongArray.merge(other: Iterable<R>, transform: (Long, R
}
/**
* Returns a list of values built from elements of both collections with same indexes using provided *transform*. List has length of shortest collection.
* Returns a list of values built from elements of both collections with same indexes using provided [transform]. List has length of shortest collection.
*/
public inline fun <R, V> ShortArray.merge(other: Iterable<R>, transform: (Short, R) -> V): List<V> {
val first = iterator()
@@ -362,7 +362,7 @@ public inline fun <R, V> ShortArray.merge(other: Iterable<R>, transform: (Short,
}
/**
* Returns a list of values built from elements of both collections with same indexes using provided *transform*. List has length of shortest collection.
* Returns a list of values built from elements of both collections with same indexes using provided [transform]. List has length of shortest collection.
*/
public inline fun <T, R, V> Iterable<T>.merge(other: Iterable<R>, transform: (T, R) -> V): List<V> {
val first = iterator()
@@ -375,7 +375,7 @@ public inline fun <T, R, V> Iterable<T>.merge(other: Iterable<R>, transform: (T,
}
/**
* Returns a sequence of values built from elements of both collections with same indexes using provided *transform*. Resulting sequence has length of shortest input sequences.
* Returns a sequence of values built from elements of both collections with same indexes using provided [transform]. Resulting sequence has length of shortest input sequences.
*/
public fun <T, R, V> Sequence<T>.merge(sequence: Sequence<R>, transform: (T, R) -> V): Sequence<V> {
return MergingSequence(this, sequence, transform)
@@ -384,7 +384,7 @@ public fun <T, R, V> Sequence<T>.merge(sequence: Sequence<R>, transform: (T, R)
deprecated("Migrate to using Sequence<T> and respective functions")
/**
* Returns a stream of values built from elements of both collections with same indexes using provided *transform*. Resulting stream has length of shortest input streams.
* Returns a stream of values built from elements of both collections with same indexes using provided [transform]. Resulting stream has length of shortest input streams.
*/
public fun <T, R, V> Stream<T>.merge(stream: Stream<R>, transform: (T, R) -> V): Stream<V> {
return MergingStream(this, stream, transform)
@@ -392,8 +392,8 @@ public fun <T, R, V> Stream<T>.merge(stream: Stream<R>, transform: (T, R) -> V):
/**
* Splits original collection into pair of collections,
* where *first* collection contains elements for which predicate yielded *true*,
* while *second* collection contains elements for which predicate yielded *false*
* where *first* collection contains elements for which [predicate] yielded [true],
* while *second* collection contains elements for which [predicate] yielded [false].
*/
public inline fun <T> Array<out T>.partition(predicate: (T) -> Boolean): Pair<List<T>, List<T>> {
val first = ArrayList<T>()
@@ -410,8 +410,8 @@ public inline fun <T> Array<out T>.partition(predicate: (T) -> Boolean): Pair<Li
/**
* Splits original collection into pair of collections,
* where *first* collection contains elements for which predicate yielded *true*,
* while *second* collection contains elements for which predicate yielded *false*
* where *first* collection contains elements for which [predicate] yielded [true],
* while *second* collection contains elements for which [predicate] yielded [false].
*/
public inline fun BooleanArray.partition(predicate: (Boolean) -> Boolean): Pair<List<Boolean>, List<Boolean>> {
val first = ArrayList<Boolean>()
@@ -428,8 +428,8 @@ public inline fun BooleanArray.partition(predicate: (Boolean) -> Boolean): Pair<
/**
* Splits original collection into pair of collections,
* where *first* collection contains elements for which predicate yielded *true*,
* while *second* collection contains elements for which predicate yielded *false*
* where *first* collection contains elements for which [predicate] yielded [true],
* while *second* collection contains elements for which [predicate] yielded [false].
*/
public inline fun ByteArray.partition(predicate: (Byte) -> Boolean): Pair<List<Byte>, List<Byte>> {
val first = ArrayList<Byte>()
@@ -446,8 +446,8 @@ public inline fun ByteArray.partition(predicate: (Byte) -> Boolean): Pair<List<B
/**
* Splits original collection into pair of collections,
* where *first* collection contains elements for which predicate yielded *true*,
* while *second* collection contains elements for which predicate yielded *false*
* where *first* collection contains elements for which [predicate] yielded [true],
* while *second* collection contains elements for which [predicate] yielded [false].
*/
public inline fun CharArray.partition(predicate: (Char) -> Boolean): Pair<List<Char>, List<Char>> {
val first = ArrayList<Char>()
@@ -464,8 +464,8 @@ public inline fun CharArray.partition(predicate: (Char) -> Boolean): Pair<List<C
/**
* Splits original collection into pair of collections,
* where *first* collection contains elements for which predicate yielded *true*,
* while *second* collection contains elements for which predicate yielded *false*
* where *first* collection contains elements for which [predicate] yielded [true],
* while *second* collection contains elements for which [predicate] yielded [false].
*/
public inline fun DoubleArray.partition(predicate: (Double) -> Boolean): Pair<List<Double>, List<Double>> {
val first = ArrayList<Double>()
@@ -482,8 +482,8 @@ public inline fun DoubleArray.partition(predicate: (Double) -> Boolean): Pair<Li
/**
* Splits original collection into pair of collections,
* where *first* collection contains elements for which predicate yielded *true*,
* while *second* collection contains elements for which predicate yielded *false*
* where *first* collection contains elements for which [predicate] yielded [true],
* while *second* collection contains elements for which [predicate] yielded [false].
*/
public inline fun FloatArray.partition(predicate: (Float) -> Boolean): Pair<List<Float>, List<Float>> {
val first = ArrayList<Float>()
@@ -500,8 +500,8 @@ public inline fun FloatArray.partition(predicate: (Float) -> Boolean): Pair<List
/**
* Splits original collection into pair of collections,
* where *first* collection contains elements for which predicate yielded *true*,
* while *second* collection contains elements for which predicate yielded *false*
* where *first* collection contains elements for which [predicate] yielded [true],
* while *second* collection contains elements for which [predicate] yielded [false].
*/
public inline fun IntArray.partition(predicate: (Int) -> Boolean): Pair<List<Int>, List<Int>> {
val first = ArrayList<Int>()
@@ -518,8 +518,8 @@ public inline fun IntArray.partition(predicate: (Int) -> Boolean): Pair<List<Int
/**
* Splits original collection into pair of collections,
* where *first* collection contains elements for which predicate yielded *true*,
* while *second* collection contains elements for which predicate yielded *false*
* where *first* collection contains elements for which [predicate] yielded [true],
* while *second* collection contains elements for which [predicate] yielded [false].
*/
public inline fun LongArray.partition(predicate: (Long) -> Boolean): Pair<List<Long>, List<Long>> {
val first = ArrayList<Long>()
@@ -536,8 +536,8 @@ public inline fun LongArray.partition(predicate: (Long) -> Boolean): Pair<List<L
/**
* Splits original collection into pair of collections,
* where *first* collection contains elements for which predicate yielded *true*,
* while *second* collection contains elements for which predicate yielded *false*
* where *first* collection contains elements for which [predicate] yielded [true],
* while *second* collection contains elements for which [predicate] yielded [false].
*/
public inline fun ShortArray.partition(predicate: (Short) -> Boolean): Pair<List<Short>, List<Short>> {
val first = ArrayList<Short>()
@@ -554,8 +554,8 @@ public inline fun ShortArray.partition(predicate: (Short) -> Boolean): Pair<List
/**
* Splits original collection into pair of collections,
* where *first* collection contains elements for which predicate yielded *true*,
* while *second* collection contains elements for which predicate yielded *false*
* where *first* collection contains elements for which [predicate] yielded [true],
* while *second* collection contains elements for which [predicate] yielded [false].
*/
public inline fun <T> Iterable<T>.partition(predicate: (T) -> Boolean): Pair<List<T>, List<T>> {
val first = ArrayList<T>()
@@ -572,8 +572,8 @@ public inline fun <T> Iterable<T>.partition(predicate: (T) -> Boolean): Pair<Lis
/**
* Splits original collection into pair of collections,
* where *first* collection contains elements for which predicate yielded *true*,
* while *second* collection contains elements for which predicate yielded *false*
* where *first* collection contains elements for which [predicate] yielded [true],
* while *second* collection contains elements for which [predicate] yielded [false].
*/
public inline fun <T> Sequence<T>.partition(predicate: (T) -> Boolean): Pair<List<T>, List<T>> {
val first = ArrayList<T>()
@@ -592,8 +592,8 @@ public inline fun <T> Sequence<T>.partition(predicate: (T) -> Boolean): Pair<Lis
deprecated("Migrate to using Sequence<T> and respective functions")
/**
* Splits original collection into pair of collections,
* where *first* collection contains elements for which predicate yielded *true*,
* while *second* collection contains elements for which predicate yielded *false*
* where *first* collection contains elements for which [predicate] yielded [true],
* while *second* collection contains elements for which [predicate] yielded [false].
*/
public inline fun <T> Stream<T>.partition(predicate: (T) -> Boolean): Pair<List<T>, List<T>> {
val first = ArrayList<T>()
@@ -610,8 +610,8 @@ public inline fun <T> Stream<T>.partition(predicate: (T) -> Boolean): Pair<List<
/**
* Splits original collection into pair of collections,
* where *first* collection contains elements for which predicate yielded *true*,
* while *second* collection contains elements for which predicate yielded *false*
* where *first* collection contains elements for which [predicate] yielded [true],
* while *second* collection contains elements for which [predicate] yielded [false].
*/
public inline fun String.partition(predicate: (Char) -> Boolean): Pair<String, String> {
val first = StringBuilder()
@@ -627,7 +627,7 @@ public inline fun String.partition(predicate: (Char) -> Boolean): Pair<String, S
}
/**
* Returns a list containing all elements of original collection and then all elements of the given *collection*
* Returns a list containing all elements of original collection and then all elements of the given [collection].
*/
public fun <T> Array<out T>.plus(array: Array<out T>): List<T> {
val answer = ArrayList<T>(size() + array.size())
@@ -637,7 +637,7 @@ public fun <T> Array<out T>.plus(array: Array<out T>): List<T> {
}
/**
* Returns a list containing all elements of original collection and then all elements of the given *collection*
* Returns a list containing all elements of original collection and then all elements of the given [collection].
*/
public fun BooleanArray.plus(array: Array<out Boolean>): List<Boolean> {
val answer = ArrayList<Boolean>(size() + array.size())
@@ -647,7 +647,7 @@ public fun BooleanArray.plus(array: Array<out Boolean>): List<Boolean> {
}
/**
* Returns a list containing all elements of original collection and then all elements of the given *collection*
* Returns a list containing all elements of original collection and then all elements of the given [collection].
*/
public fun ByteArray.plus(array: Array<out Byte>): List<Byte> {
val answer = ArrayList<Byte>(size() + array.size())
@@ -657,7 +657,7 @@ public fun ByteArray.plus(array: Array<out Byte>): List<Byte> {
}
/**
* Returns a list containing all elements of original collection and then all elements of the given *collection*
* Returns a list containing all elements of original collection and then all elements of the given [collection].
*/
public fun CharArray.plus(array: Array<out Char>): List<Char> {
val answer = ArrayList<Char>(size() + array.size())
@@ -667,7 +667,7 @@ public fun CharArray.plus(array: Array<out Char>): List<Char> {
}
/**
* Returns a list containing all elements of original collection and then all elements of the given *collection*
* Returns a list containing all elements of original collection and then all elements of the given [collection].
*/
public fun DoubleArray.plus(array: Array<out Double>): List<Double> {
val answer = ArrayList<Double>(size() + array.size())
@@ -677,7 +677,7 @@ public fun DoubleArray.plus(array: Array<out Double>): List<Double> {
}
/**
* Returns a list containing all elements of original collection and then all elements of the given *collection*
* Returns a list containing all elements of original collection and then all elements of the given [collection].
*/
public fun FloatArray.plus(array: Array<out Float>): List<Float> {
val answer = ArrayList<Float>(size() + array.size())
@@ -687,7 +687,7 @@ public fun FloatArray.plus(array: Array<out Float>): List<Float> {
}
/**
* Returns a list containing all elements of original collection and then all elements of the given *collection*
* Returns a list containing all elements of original collection and then all elements of the given [collection].
*/
public fun IntArray.plus(array: Array<out Int>): List<Int> {
val answer = ArrayList<Int>(size() + array.size())
@@ -697,7 +697,7 @@ public fun IntArray.plus(array: Array<out Int>): List<Int> {
}
/**
* Returns a list containing all elements of original collection and then all elements of the given *collection*
* Returns a list containing all elements of original collection and then all elements of the given [collection].
*/
public fun LongArray.plus(array: Array<out Long>): List<Long> {
val answer = ArrayList<Long>(size() + array.size())
@@ -707,7 +707,7 @@ public fun LongArray.plus(array: Array<out Long>): List<Long> {
}
/**
* Returns a list containing all elements of original collection and then all elements of the given *collection*
* Returns a list containing all elements of original collection and then all elements of the given [collection].
*/
public fun ShortArray.plus(array: Array<out Short>): List<Short> {
val answer = ArrayList<Short>(size() + array.size())
@@ -717,7 +717,7 @@ public fun ShortArray.plus(array: Array<out Short>): List<Short> {
}
/**
* Returns a list containing all elements of original collection and then all elements of the given *collection*
* Returns a list containing all elements of original collection and then all elements of the given [collection].
*/
public fun <T> Iterable<T>.plus(array: Array<out T>): List<T> {
val answer = ArrayList<T>(collectionSizeOrDefault(10) + array.size())
@@ -727,7 +727,7 @@ public fun <T> Iterable<T>.plus(array: Array<out T>): List<T> {
}
/**
* Returns a list containing all elements of original collection and then all elements of the given *collection*
* Returns a list containing all elements of original collection and then all elements of the given [collection].
*/
public fun <T> Array<out T>.plus(collection: Iterable<T>): List<T> {
val answer = ArrayList<T>(size() + collection.collectionSizeOrDefault(10))
@@ -737,7 +737,7 @@ public fun <T> Array<out T>.plus(collection: Iterable<T>): List<T> {
}
/**
* Returns a list containing all elements of original collection and then all elements of the given *collection*
* Returns a list containing all elements of original collection and then all elements of the given [collection].
*/
public fun BooleanArray.plus(collection: Iterable<Boolean>): List<Boolean> {
val answer = ArrayList<Boolean>(size() + collection.collectionSizeOrDefault(10))
@@ -747,7 +747,7 @@ public fun BooleanArray.plus(collection: Iterable<Boolean>): List<Boolean> {
}
/**
* Returns a list containing all elements of original collection and then all elements of the given *collection*
* Returns a list containing all elements of original collection and then all elements of the given [collection].
*/
public fun ByteArray.plus(collection: Iterable<Byte>): List<Byte> {
val answer = ArrayList<Byte>(size() + collection.collectionSizeOrDefault(10))
@@ -757,7 +757,7 @@ public fun ByteArray.plus(collection: Iterable<Byte>): List<Byte> {
}
/**
* Returns a list containing all elements of original collection and then all elements of the given *collection*
* Returns a list containing all elements of original collection and then all elements of the given [collection].
*/
public fun CharArray.plus(collection: Iterable<Char>): List<Char> {
val answer = ArrayList<Char>(size() + collection.collectionSizeOrDefault(10))
@@ -767,7 +767,7 @@ public fun CharArray.plus(collection: Iterable<Char>): List<Char> {
}
/**
* Returns a list containing all elements of original collection and then all elements of the given *collection*
* Returns a list containing all elements of original collection and then all elements of the given [collection].
*/
public fun DoubleArray.plus(collection: Iterable<Double>): List<Double> {
val answer = ArrayList<Double>(size() + collection.collectionSizeOrDefault(10))
@@ -777,7 +777,7 @@ public fun DoubleArray.plus(collection: Iterable<Double>): List<Double> {
}
/**
* Returns a list containing all elements of original collection and then all elements of the given *collection*
* Returns a list containing all elements of original collection and then all elements of the given [collection].
*/
public fun FloatArray.plus(collection: Iterable<Float>): List<Float> {
val answer = ArrayList<Float>(size() + collection.collectionSizeOrDefault(10))
@@ -787,7 +787,7 @@ public fun FloatArray.plus(collection: Iterable<Float>): List<Float> {
}
/**
* Returns a list containing all elements of original collection and then all elements of the given *collection*
* Returns a list containing all elements of original collection and then all elements of the given [collection].
*/
public fun IntArray.plus(collection: Iterable<Int>): List<Int> {
val answer = ArrayList<Int>(size() + collection.collectionSizeOrDefault(10))
@@ -797,7 +797,7 @@ public fun IntArray.plus(collection: Iterable<Int>): List<Int> {
}
/**
* Returns a list containing all elements of original collection and then all elements of the given *collection*
* Returns a list containing all elements of original collection and then all elements of the given [collection].
*/
public fun LongArray.plus(collection: Iterable<Long>): List<Long> {
val answer = ArrayList<Long>(size() + collection.collectionSizeOrDefault(10))
@@ -807,7 +807,7 @@ public fun LongArray.plus(collection: Iterable<Long>): List<Long> {
}
/**
* Returns a list containing all elements of original collection and then all elements of the given *collection*
* Returns a list containing all elements of original collection and then all elements of the given [collection].
*/
public fun ShortArray.plus(collection: Iterable<Short>): List<Short> {
val answer = ArrayList<Short>(size() + collection.collectionSizeOrDefault(10))
@@ -817,7 +817,7 @@ public fun ShortArray.plus(collection: Iterable<Short>): List<Short> {
}
/**
* Returns a list containing all elements of original collection and then all elements of the given *collection*
* Returns a list containing all elements of original collection and then all elements of the given [collection].
*/
public fun <T> Iterable<T>.plus(collection: Iterable<T>): List<T> {
val answer = ArrayList<T>(collectionSizeOrDefault(10) + collection.collectionSizeOrDefault(10))
@@ -827,7 +827,7 @@ public fun <T> Iterable<T>.plus(collection: Iterable<T>): List<T> {
}
/**
* Returns a sequence containing all elements of original sequence and then all elements of the given [collection]
* Returns a sequence containing all elements of original sequence and then all elements of the given [collection].
*/
public fun <T> Sequence<T>.plus(collection: Iterable<T>): Sequence<T> {
return sequenceOf(this, collection.sequence()).flatten()
@@ -836,14 +836,14 @@ public fun <T> Sequence<T>.plus(collection: Iterable<T>): Sequence<T> {
deprecated("Migrate to using Sequence<T> and respective functions")
/**
* Returns a stream containing all elements of original stream and then all elements of the given [collection]
* Returns a stream containing all elements of original stream and then all elements of the given [collection].
*/
public fun <T> Stream<T>.plus(collection: Iterable<T>): Stream<T> {
return streamOf(this, collection.stream()).flatten()
}
/**
* Returns a list containing all elements of original collection and then the given element
* Returns a list containing all elements of original collection and then the given [element].
*/
public fun <T> Array<out T>.plus(element: T): List<T> {
val answer = ArrayList<T>(size()+1)
@@ -853,7 +853,7 @@ public fun <T> Array<out T>.plus(element: T): List<T> {
}
/**
* Returns a list containing all elements of original collection and then the given element
* Returns a list containing all elements of original collection and then the given [element].
*/
public fun BooleanArray.plus(element: Boolean): List<Boolean> {
val answer = ArrayList<Boolean>(size()+1)
@@ -863,7 +863,7 @@ public fun BooleanArray.plus(element: Boolean): List<Boolean> {
}
/**
* Returns a list containing all elements of original collection and then the given element
* Returns a list containing all elements of original collection and then the given [element].
*/
public fun ByteArray.plus(element: Byte): List<Byte> {
val answer = ArrayList<Byte>(size()+1)
@@ -873,7 +873,7 @@ public fun ByteArray.plus(element: Byte): List<Byte> {
}
/**
* Returns a list containing all elements of original collection and then the given element
* Returns a list containing all elements of original collection and then the given [element].
*/
public fun CharArray.plus(element: Char): List<Char> {
val answer = ArrayList<Char>(size()+1)
@@ -883,7 +883,7 @@ public fun CharArray.plus(element: Char): List<Char> {
}
/**
* Returns a list containing all elements of original collection and then the given element
* Returns a list containing all elements of original collection and then the given [element].
*/
public fun DoubleArray.plus(element: Double): List<Double> {
val answer = ArrayList<Double>(size()+1)
@@ -893,7 +893,7 @@ public fun DoubleArray.plus(element: Double): List<Double> {
}
/**
* Returns a list containing all elements of original collection and then the given element
* Returns a list containing all elements of original collection and then the given [element].
*/
public fun FloatArray.plus(element: Float): List<Float> {
val answer = ArrayList<Float>(size()+1)
@@ -903,7 +903,7 @@ public fun FloatArray.plus(element: Float): List<Float> {
}
/**
* Returns a list containing all elements of original collection and then the given element
* Returns a list containing all elements of original collection and then the given [element].
*/
public fun IntArray.plus(element: Int): List<Int> {
val answer = ArrayList<Int>(size()+1)
@@ -913,7 +913,7 @@ public fun IntArray.plus(element: Int): List<Int> {
}
/**
* Returns a list containing all elements of original collection and then the given element
* Returns a list containing all elements of original collection and then the given [element].
*/
public fun LongArray.plus(element: Long): List<Long> {
val answer = ArrayList<Long>(size()+1)
@@ -923,7 +923,7 @@ public fun LongArray.plus(element: Long): List<Long> {
}
/**
* Returns a list containing all elements of original collection and then the given element
* Returns a list containing all elements of original collection and then the given [element].
*/
public fun ShortArray.plus(element: Short): List<Short> {
val answer = ArrayList<Short>(size()+1)
@@ -933,7 +933,7 @@ public fun ShortArray.plus(element: Short): List<Short> {
}
/**
* Returns a list containing all elements of original collection and then the given element
* Returns a list containing all elements of original collection and then the given [element].
*/
public fun <T> Iterable<T>.plus(element: T): List<T> {
val answer = ArrayList<T>(collectionSizeOrNull()?.let { it + 1 } ?: 10)
@@ -943,7 +943,7 @@ public fun <T> Iterable<T>.plus(element: T): List<T> {
}
/**
* Returns a sequence containing all elements of original sequence and then the given element
* Returns a sequence containing all elements of original sequence and then the given [element].
*/
public fun <T> Sequence<T>.plus(element: T): Sequence<T> {
return sequenceOf(this, sequenceOf(element)).flatten()
@@ -952,14 +952,14 @@ public fun <T> Sequence<T>.plus(element: T): Sequence<T> {
deprecated("Migrate to using Sequence<T> and respective functions")
/**
* Returns a stream containing all elements of original stream and then the given element
* Returns a stream containing all elements of original stream and then the given [element].
*/
public fun <T> Stream<T>.plus(element: T): Stream<T> {
return streamOf(this, streamOf(element)).flatten()
}
/**
* Returns a sequence containing all elements of original sequence and then all elements of the given [sequence]
* Returns a sequence containing all elements of original sequence and then all elements of the given [sequence].
*/
public fun <T> Sequence<T>.plus(sequence: Sequence<T>): Sequence<T> {
return sequenceOf(this, sequence).flatten()
@@ -968,7 +968,7 @@ public fun <T> Sequence<T>.plus(sequence: Sequence<T>): Sequence<T> {
deprecated("Migrate to using Sequence<T> and respective functions")
/**
* Returns a stream containing all elements of original stream and then all elements of the given [stream]
* Returns a stream containing all elements of original stream and then all elements of the given [stream].
*/
public fun <T> Stream<T>.plus(stream: Stream<T>): Stream<T> {
return streamOf(this, stream).flatten()
+10 -10
View File
@@ -11,54 +11,54 @@ import java.util.*
import java.util.Collections // TODO: it's temporary while we have java.util.Collections in js
/**
* Returns an original collection containing all the non-*null* elements, throwing an [[IllegalArgumentException]] if there are any null elements
* Returns an original collection containing all the non-`null` elements, throwing an [IllegalArgumentException] if there are any `null` elements.
*/
public fun <T : Any> Array<out T?>.requireNoNulls(): Array<out T> {
for (element in this) {
if (element == null) {
throw IllegalArgumentException("null element found in $this")
throw IllegalArgumentException("null element found in $this.")
}
}
return this as Array<out T>
}
/**
* Returns an original collection containing all the non-*null* elements, throwing an [[IllegalArgumentException]] if there are any null elements
* Returns an original collection containing all the non-`null` elements, throwing an [IllegalArgumentException] if there are any `null` elements.
*/
public fun <T : Any> Iterable<T?>.requireNoNulls(): Iterable<T> {
for (element in this) {
if (element == null) {
throw IllegalArgumentException("null element found in $this")
throw IllegalArgumentException("null element found in $this.")
}
}
return this as Iterable<T>
}
/**
* Returns an original collection containing all the non-*null* elements, throwing an [[IllegalArgumentException]] if there are any null elements
* Returns an original collection containing all the non-`null` elements, throwing an [IllegalArgumentException] if there are any `null` elements.
*/
public fun <T : Any> List<T?>.requireNoNulls(): List<T> {
for (element in this) {
if (element == null) {
throw IllegalArgumentException("null element found in $this")
throw IllegalArgumentException("null element found in $this.")
}
}
return this as List<T>
}
/**
* Returns an original collection containing all the non-*null* elements, throwing an [[IllegalArgumentException]] if there are any null elements
* Returns an original collection containing all the non-`null` elements, throwing an [IllegalArgumentException] if there are any `null` elements.
*/
public fun <T : Any> Sequence<T?>.requireNoNulls(): Sequence<T> {
return map { it ?: throw IllegalArgumentException("null element found in $this") }
return map { it ?: throw IllegalArgumentException("null element found in $this.") }
}
deprecated("Migrate to using Sequence<T> and respective functions")
/**
* Returns an original collection containing all the non-*null* elements, throwing an [[IllegalArgumentException]] if there are any null elements
* Returns an original collection containing all the non-`null` elements, throwing an [IllegalArgumentException] if there are any `null` elements.
*/
public fun <T : Any> Stream<T?>.requireNoNulls(): Stream<T> {
return map { it ?: throw IllegalArgumentException("null element found in $this") }
return map { it ?: throw IllegalArgumentException("null element found in $this.") }
}
File diff suppressed because it is too large Load Diff
+30 -30
View File
@@ -11,7 +11,7 @@ import java.util.*
import java.util.Collections // TODO: it's temporary while we have java.util.Collections in js
/**
* Returns an average value of elements in the collection
* Returns an average value of elements in the collection.
*/
platformName("averageOfInt")
public fun Iterable<Int>.average(): Double {
@@ -26,7 +26,7 @@ public fun Iterable<Int>.average(): Double {
}
/**
* Returns an average value of elements in the collection
* Returns an average value of elements in the collection.
*/
platformName("averageOfInt")
public fun Sequence<Int>.average(): Double {
@@ -43,7 +43,7 @@ public fun Sequence<Int>.average(): Double {
deprecated("Migrate to using Sequence<T> and respective functions")
/**
* Returns an average value of elements in the collection
* Returns an average value of elements in the collection.
*/
platformName("averageOfInt")
public fun Stream<Int>.average(): Double {
@@ -58,7 +58,7 @@ public fun Stream<Int>.average(): Double {
}
/**
* Returns an average value of elements in the collection
* Returns an average value of elements in the collection.
*/
platformName("averageOfInt")
public fun Array<out Int>.average(): Double {
@@ -73,7 +73,7 @@ public fun Array<out Int>.average(): Double {
}
/**
* Returns an average value of elements in the collection
* Returns an average value of elements in the collection.
*/
public fun IntArray.average(): Double {
val iterator = iterator()
@@ -87,7 +87,7 @@ public fun IntArray.average(): Double {
}
/**
* Returns an average value of elements in the collection
* Returns an average value of elements in the collection.
*/
platformName("averageOfLong")
public fun Iterable<Long>.average(): Double {
@@ -102,7 +102,7 @@ public fun Iterable<Long>.average(): Double {
}
/**
* Returns an average value of elements in the collection
* Returns an average value of elements in the collection.
*/
platformName("averageOfLong")
public fun Sequence<Long>.average(): Double {
@@ -119,7 +119,7 @@ public fun Sequence<Long>.average(): Double {
deprecated("Migrate to using Sequence<T> and respective functions")
/**
* Returns an average value of elements in the collection
* Returns an average value of elements in the collection.
*/
platformName("averageOfLong")
public fun Stream<Long>.average(): Double {
@@ -134,7 +134,7 @@ public fun Stream<Long>.average(): Double {
}
/**
* Returns an average value of elements in the collection
* Returns an average value of elements in the collection.
*/
platformName("averageOfLong")
public fun Array<out Long>.average(): Double {
@@ -149,7 +149,7 @@ public fun Array<out Long>.average(): Double {
}
/**
* Returns an average value of elements in the collection
* Returns an average value of elements in the collection.
*/
public fun LongArray.average(): Double {
val iterator = iterator()
@@ -163,7 +163,7 @@ public fun LongArray.average(): Double {
}
/**
* Returns an average value of elements in the collection
* Returns an average value of elements in the collection.
*/
platformName("averageOfByte")
public fun Iterable<Byte>.average(): Double {
@@ -178,7 +178,7 @@ public fun Iterable<Byte>.average(): Double {
}
/**
* Returns an average value of elements in the collection
* Returns an average value of elements in the collection.
*/
platformName("averageOfByte")
public fun Sequence<Byte>.average(): Double {
@@ -195,7 +195,7 @@ public fun Sequence<Byte>.average(): Double {
deprecated("Migrate to using Sequence<T> and respective functions")
/**
* Returns an average value of elements in the collection
* Returns an average value of elements in the collection.
*/
platformName("averageOfByte")
public fun Stream<Byte>.average(): Double {
@@ -210,7 +210,7 @@ public fun Stream<Byte>.average(): Double {
}
/**
* Returns an average value of elements in the collection
* Returns an average value of elements in the collection.
*/
platformName("averageOfByte")
public fun Array<out Byte>.average(): Double {
@@ -225,7 +225,7 @@ public fun Array<out Byte>.average(): Double {
}
/**
* Returns an average value of elements in the collection
* Returns an average value of elements in the collection.
*/
public fun ByteArray.average(): Double {
val iterator = iterator()
@@ -239,7 +239,7 @@ public fun ByteArray.average(): Double {
}
/**
* Returns an average value of elements in the collection
* Returns an average value of elements in the collection.
*/
platformName("averageOfShort")
public fun Iterable<Short>.average(): Double {
@@ -254,7 +254,7 @@ public fun Iterable<Short>.average(): Double {
}
/**
* Returns an average value of elements in the collection
* Returns an average value of elements in the collection.
*/
platformName("averageOfShort")
public fun Sequence<Short>.average(): Double {
@@ -271,7 +271,7 @@ public fun Sequence<Short>.average(): Double {
deprecated("Migrate to using Sequence<T> and respective functions")
/**
* Returns an average value of elements in the collection
* Returns an average value of elements in the collection.
*/
platformName("averageOfShort")
public fun Stream<Short>.average(): Double {
@@ -286,7 +286,7 @@ public fun Stream<Short>.average(): Double {
}
/**
* Returns an average value of elements in the collection
* Returns an average value of elements in the collection.
*/
platformName("averageOfShort")
public fun Array<out Short>.average(): Double {
@@ -301,7 +301,7 @@ public fun Array<out Short>.average(): Double {
}
/**
* Returns an average value of elements in the collection
* Returns an average value of elements in the collection.
*/
public fun ShortArray.average(): Double {
val iterator = iterator()
@@ -315,7 +315,7 @@ public fun ShortArray.average(): Double {
}
/**
* Returns an average value of elements in the collection
* Returns an average value of elements in the collection.
*/
platformName("averageOfDouble")
public fun Iterable<Double>.average(): Double {
@@ -330,7 +330,7 @@ public fun Iterable<Double>.average(): Double {
}
/**
* Returns an average value of elements in the collection
* Returns an average value of elements in the collection.
*/
platformName("averageOfDouble")
public fun Sequence<Double>.average(): Double {
@@ -347,7 +347,7 @@ public fun Sequence<Double>.average(): Double {
deprecated("Migrate to using Sequence<T> and respective functions")
/**
* Returns an average value of elements in the collection
* Returns an average value of elements in the collection.
*/
platformName("averageOfDouble")
public fun Stream<Double>.average(): Double {
@@ -362,7 +362,7 @@ public fun Stream<Double>.average(): Double {
}
/**
* Returns an average value of elements in the collection
* Returns an average value of elements in the collection.
*/
platformName("averageOfDouble")
public fun Array<out Double>.average(): Double {
@@ -377,7 +377,7 @@ public fun Array<out Double>.average(): Double {
}
/**
* Returns an average value of elements in the collection
* Returns an average value of elements in the collection.
*/
public fun DoubleArray.average(): Double {
val iterator = iterator()
@@ -391,7 +391,7 @@ public fun DoubleArray.average(): Double {
}
/**
* Returns an average value of elements in the collection
* Returns an average value of elements in the collection.
*/
platformName("averageOfFloat")
public fun Iterable<Float>.average(): Double {
@@ -406,7 +406,7 @@ public fun Iterable<Float>.average(): Double {
}
/**
* Returns an average value of elements in the collection
* Returns an average value of elements in the collection.
*/
platformName("averageOfFloat")
public fun Sequence<Float>.average(): Double {
@@ -423,7 +423,7 @@ public fun Sequence<Float>.average(): Double {
deprecated("Migrate to using Sequence<T> and respective functions")
/**
* Returns an average value of elements in the collection
* Returns an average value of elements in the collection.
*/
platformName("averageOfFloat")
public fun Stream<Float>.average(): Double {
@@ -438,7 +438,7 @@ public fun Stream<Float>.average(): Double {
}
/**
* Returns an average value of elements in the collection
* Returns an average value of elements in the collection.
*/
platformName("averageOfFloat")
public fun Array<out Float>.average(): Double {
@@ -453,7 +453,7 @@ public fun Array<out Float>.average(): Double {
}
/**
* Returns an average value of elements in the collection
* Returns an average value of elements in the collection.
*/
public fun FloatArray.average(): Double {
val iterator = iterator()
+43 -43
View File
@@ -11,7 +11,7 @@ import java.util.*
import java.util.Collections // TODO: it's temporary while we have java.util.Collections in js
/**
* Returns a list with elements in reversed order
* Returns a list with elements in reversed order.
*/
public fun <T> Array<out T>.reverse(): List<T> {
val list = toArrayList()
@@ -20,7 +20,7 @@ public fun <T> Array<out T>.reverse(): List<T> {
}
/**
* Returns a list with elements in reversed order
* Returns a list with elements in reversed order.
*/
public fun BooleanArray.reverse(): List<Boolean> {
val list = toArrayList()
@@ -29,7 +29,7 @@ public fun BooleanArray.reverse(): List<Boolean> {
}
/**
* Returns a list with elements in reversed order
* Returns a list with elements in reversed order.
*/
public fun ByteArray.reverse(): List<Byte> {
val list = toArrayList()
@@ -38,7 +38,7 @@ public fun ByteArray.reverse(): List<Byte> {
}
/**
* Returns a list with elements in reversed order
* Returns a list with elements in reversed order.
*/
public fun CharArray.reverse(): List<Char> {
val list = toArrayList()
@@ -47,7 +47,7 @@ public fun CharArray.reverse(): List<Char> {
}
/**
* Returns a list with elements in reversed order
* Returns a list with elements in reversed order.
*/
public fun DoubleArray.reverse(): List<Double> {
val list = toArrayList()
@@ -56,7 +56,7 @@ public fun DoubleArray.reverse(): List<Double> {
}
/**
* Returns a list with elements in reversed order
* Returns a list with elements in reversed order.
*/
public fun FloatArray.reverse(): List<Float> {
val list = toArrayList()
@@ -65,7 +65,7 @@ public fun FloatArray.reverse(): List<Float> {
}
/**
* Returns a list with elements in reversed order
* Returns a list with elements in reversed order.
*/
public fun IntArray.reverse(): List<Int> {
val list = toArrayList()
@@ -74,7 +74,7 @@ public fun IntArray.reverse(): List<Int> {
}
/**
* Returns a list with elements in reversed order
* Returns a list with elements in reversed order.
*/
public fun LongArray.reverse(): List<Long> {
val list = toArrayList()
@@ -83,7 +83,7 @@ public fun LongArray.reverse(): List<Long> {
}
/**
* Returns a list with elements in reversed order
* Returns a list with elements in reversed order.
*/
public fun ShortArray.reverse(): List<Short> {
val list = toArrayList()
@@ -92,7 +92,7 @@ public fun ShortArray.reverse(): List<Short> {
}
/**
* Returns a list with elements in reversed order
* Returns a list with elements in reversed order.
*/
public fun <T> Iterable<T>.reverse(): List<T> {
val list = toArrayList()
@@ -101,14 +101,14 @@ public fun <T> Iterable<T>.reverse(): List<T> {
}
/**
* Returns a string with characters in reversed order
* Returns a string with characters in reversed order.
*/
public fun String.reverse(): String {
return StringBuilder().append(this).reverse().toString()
}
/**
* Returns a sorted list of all elements
* Returns a sorted list of all elements.
*/
public fun <T : Comparable<T>> Iterable<T>.sort(): List<T> {
val sortedList = toArrayList()
@@ -117,7 +117,7 @@ public fun <T : Comparable<T>> Iterable<T>.sort(): List<T> {
}
/**
* Returns a list of all elements, sorted by the specified *comparator*
* Returns a list of all elements, sorted by the specified [comparator].
*/
public fun <T> Array<out T>.sortBy(comparator: Comparator<in T>): List<T> {
val sortedList = toArrayList()
@@ -126,7 +126,7 @@ public fun <T> Array<out T>.sortBy(comparator: Comparator<in T>): List<T> {
}
/**
* Returns a list of all elements, sorted by the specified *comparator*
* Returns a list of all elements, sorted by the specified [comparator].
*/
public fun <T> Iterable<T>.sortBy(comparator: Comparator<in T>): List<T> {
val sortedList = toArrayList()
@@ -135,7 +135,7 @@ public fun <T> Iterable<T>.sortBy(comparator: Comparator<in T>): List<T> {
}
/**
* Returns a sorted list of all elements, ordered by results of specified *order* function.
* Returns a sorted list of all elements, ordered by results of specified [order] function.
*/
public inline fun <T, R : Comparable<R>> Array<out T>.sortBy(inlineOptions(InlineOption.ONLY_LOCAL_RETURN) order: (T) -> R): List<T> {
val sortedList = toArrayList()
@@ -145,7 +145,7 @@ public inline fun <T, R : Comparable<R>> Array<out T>.sortBy(inlineOptions(Inlin
}
/**
* Returns a sorted list of all elements, ordered by results of specified *order* function.
* Returns a sorted list of all elements, ordered by results of specified [order] function.
*/
public inline fun <T, R : Comparable<R>> Iterable<T>.sortBy(inlineOptions(InlineOption.ONLY_LOCAL_RETURN) order: (T) -> R): List<T> {
val sortedList = toArrayList()
@@ -155,7 +155,7 @@ public inline fun <T, R : Comparable<R>> Iterable<T>.sortBy(inlineOptions(Inline
}
/**
* Returns a sorted list of all elements, in descending order
* Returns a sorted list of all elements, in descending order.
*/
public fun <T : Comparable<T>> Iterable<T>.sortDescending(): List<T> {
val sortedList = toArrayList()
@@ -164,7 +164,7 @@ public fun <T : Comparable<T>> Iterable<T>.sortDescending(): List<T> {
}
/**
* Returns a sorted list of all elements, in descending order by results of specified *order* function.
* Returns a sorted list of all elements, in descending order by results of specified [order] function.
*/
public inline fun <T, R : Comparable<R>> Array<out T>.sortDescendingBy(inlineOptions(InlineOption.ONLY_LOCAL_RETURN) order: (T) -> R): List<T> {
val sortedList = toArrayList()
@@ -174,7 +174,7 @@ public inline fun <T, R : Comparable<R>> Array<out T>.sortDescendingBy(inlineOpt
}
/**
* Returns a sorted list of all elements, in descending order by results of specified *order* function.
* Returns a sorted list of all elements, in descending order by results of specified [order] function.
*/
public inline fun <T, R : Comparable<R>> Iterable<T>.sortDescendingBy(inlineOptions(InlineOption.ONLY_LOCAL_RETURN) order: (T) -> R): List<T> {
val sortedList = toArrayList()
@@ -184,7 +184,7 @@ public inline fun <T, R : Comparable<R>> Iterable<T>.sortDescendingBy(inlineOpti
}
/**
* Returns a sorted list of all elements
* Returns a sorted list of all elements.
*/
public fun <T : Comparable<T>> Array<out T>.toSortedList(): List<T> {
val sortedList = toArrayList()
@@ -193,7 +193,7 @@ public fun <T : Comparable<T>> Array<out T>.toSortedList(): List<T> {
}
/**
* Returns a sorted list of all elements
* Returns a sorted list of all elements.
*/
public fun BooleanArray.toSortedList(): List<Boolean> {
val sortedList = toArrayList()
@@ -202,7 +202,7 @@ public fun BooleanArray.toSortedList(): List<Boolean> {
}
/**
* Returns a sorted list of all elements
* Returns a sorted list of all elements.
*/
public fun ByteArray.toSortedList(): List<Byte> {
val sortedList = toArrayList()
@@ -211,7 +211,7 @@ public fun ByteArray.toSortedList(): List<Byte> {
}
/**
* Returns a sorted list of all elements
* Returns a sorted list of all elements.
*/
public fun CharArray.toSortedList(): List<Char> {
val sortedList = toArrayList()
@@ -220,7 +220,7 @@ public fun CharArray.toSortedList(): List<Char> {
}
/**
* Returns a sorted list of all elements
* Returns a sorted list of all elements.
*/
public fun DoubleArray.toSortedList(): List<Double> {
val sortedList = toArrayList()
@@ -229,7 +229,7 @@ public fun DoubleArray.toSortedList(): List<Double> {
}
/**
* Returns a sorted list of all elements
* Returns a sorted list of all elements.
*/
public fun FloatArray.toSortedList(): List<Float> {
val sortedList = toArrayList()
@@ -238,7 +238,7 @@ public fun FloatArray.toSortedList(): List<Float> {
}
/**
* Returns a sorted list of all elements
* Returns a sorted list of all elements.
*/
public fun IntArray.toSortedList(): List<Int> {
val sortedList = toArrayList()
@@ -247,7 +247,7 @@ public fun IntArray.toSortedList(): List<Int> {
}
/**
* Returns a sorted list of all elements
* Returns a sorted list of all elements.
*/
public fun LongArray.toSortedList(): List<Long> {
val sortedList = toArrayList()
@@ -256,7 +256,7 @@ public fun LongArray.toSortedList(): List<Long> {
}
/**
* Returns a sorted list of all elements
* Returns a sorted list of all elements.
*/
public fun ShortArray.toSortedList(): List<Short> {
val sortedList = toArrayList()
@@ -265,7 +265,7 @@ public fun ShortArray.toSortedList(): List<Short> {
}
/**
* Returns a sorted list of all elements
* Returns a sorted list of all elements.
*/
public fun <T : Comparable<T>> Iterable<T>.toSortedList(): List<T> {
val sortedList = toArrayList()
@@ -274,7 +274,7 @@ public fun <T : Comparable<T>> Iterable<T>.toSortedList(): List<T> {
}
/**
* Returns a sorted list of all elements
* Returns a sorted list of all elements.
*/
public fun <T : Comparable<T>> Sequence<T>.toSortedList(): List<T> {
val sortedList = toArrayList()
@@ -285,7 +285,7 @@ public fun <T : Comparable<T>> Sequence<T>.toSortedList(): List<T> {
deprecated("Migrate to using Sequence<T> and respective functions")
/**
* Returns a sorted list of all elements
* Returns a sorted list of all elements.
*/
public fun <T : Comparable<T>> Stream<T>.toSortedList(): List<T> {
val sortedList = toArrayList()
@@ -294,7 +294,7 @@ public fun <T : Comparable<T>> Stream<T>.toSortedList(): List<T> {
}
/**
* Returns a sorted list of all elements, ordered by results of specified *order* function.
* Returns a sorted list of all elements, ordered by results of specified [order] function.
*/
public fun <T, V : Comparable<V>> Array<out T>.toSortedListBy(order: (T) -> V): List<T> {
val sortedList = toArrayList()
@@ -304,7 +304,7 @@ public fun <T, V : Comparable<V>> Array<out T>.toSortedListBy(order: (T) -> V):
}
/**
* Returns a sorted list of all elements, ordered by results of specified *order* function.
* Returns a sorted list of all elements, ordered by results of specified [order] function.
*/
public fun <V : Comparable<V>> BooleanArray.toSortedListBy(order: (Boolean) -> V): List<Boolean> {
val sortedList = toArrayList()
@@ -314,7 +314,7 @@ public fun <V : Comparable<V>> BooleanArray.toSortedListBy(order: (Boolean) -> V
}
/**
* Returns a sorted list of all elements, ordered by results of specified *order* function.
* Returns a sorted list of all elements, ordered by results of specified [order] function.
*/
public fun <V : Comparable<V>> ByteArray.toSortedListBy(order: (Byte) -> V): List<Byte> {
val sortedList = toArrayList()
@@ -324,7 +324,7 @@ public fun <V : Comparable<V>> ByteArray.toSortedListBy(order: (Byte) -> V): Lis
}
/**
* Returns a sorted list of all elements, ordered by results of specified *order* function.
* Returns a sorted list of all elements, ordered by results of specified [order] function.
*/
public fun <V : Comparable<V>> CharArray.toSortedListBy(order: (Char) -> V): List<Char> {
val sortedList = toArrayList()
@@ -334,7 +334,7 @@ public fun <V : Comparable<V>> CharArray.toSortedListBy(order: (Char) -> V): Lis
}
/**
* Returns a sorted list of all elements, ordered by results of specified *order* function.
* Returns a sorted list of all elements, ordered by results of specified [order] function.
*/
public fun <V : Comparable<V>> DoubleArray.toSortedListBy(order: (Double) -> V): List<Double> {
val sortedList = toArrayList()
@@ -344,7 +344,7 @@ public fun <V : Comparable<V>> DoubleArray.toSortedListBy(order: (Double) -> V):
}
/**
* Returns a sorted list of all elements, ordered by results of specified *order* function.
* Returns a sorted list of all elements, ordered by results of specified [order] function.
*/
public fun <V : Comparable<V>> FloatArray.toSortedListBy(order: (Float) -> V): List<Float> {
val sortedList = toArrayList()
@@ -354,7 +354,7 @@ public fun <V : Comparable<V>> FloatArray.toSortedListBy(order: (Float) -> V): L
}
/**
* Returns a sorted list of all elements, ordered by results of specified *order* function.
* Returns a sorted list of all elements, ordered by results of specified [order] function.
*/
public fun <V : Comparable<V>> IntArray.toSortedListBy(order: (Int) -> V): List<Int> {
val sortedList = toArrayList()
@@ -364,7 +364,7 @@ public fun <V : Comparable<V>> IntArray.toSortedListBy(order: (Int) -> V): List<
}
/**
* Returns a sorted list of all elements, ordered by results of specified *order* function.
* Returns a sorted list of all elements, ordered by results of specified [order] function.
*/
public fun <V : Comparable<V>> LongArray.toSortedListBy(order: (Long) -> V): List<Long> {
val sortedList = toArrayList()
@@ -374,7 +374,7 @@ public fun <V : Comparable<V>> LongArray.toSortedListBy(order: (Long) -> V): Lis
}
/**
* Returns a sorted list of all elements, ordered by results of specified *order* function.
* Returns a sorted list of all elements, ordered by results of specified [order] function.
*/
public fun <V : Comparable<V>> ShortArray.toSortedListBy(order: (Short) -> V): List<Short> {
val sortedList = toArrayList()
@@ -384,7 +384,7 @@ public fun <V : Comparable<V>> ShortArray.toSortedListBy(order: (Short) -> V): L
}
/**
* Returns a sorted list of all elements, ordered by results of specified *order* function.
* Returns a sorted list of all elements, ordered by results of specified [order] function.
*/
public fun <T, V : Comparable<V>> Iterable<T>.toSortedListBy(order: (T) -> V): List<T> {
val sortedList = toArrayList()
@@ -394,7 +394,7 @@ public fun <T, V : Comparable<V>> Iterable<T>.toSortedListBy(order: (T) -> V): L
}
/**
* Returns a sorted list of all elements, ordered by results of specified *order* function.
* Returns a sorted list of all elements, ordered by results of specified [order] function.
*/
public fun <T, V : Comparable<V>> Sequence<T>.toSortedListBy(order: (T) -> V): List<T> {
val sortedList = toArrayList()
@@ -406,7 +406,7 @@ public fun <T, V : Comparable<V>> Sequence<T>.toSortedListBy(order: (T) -> V): L
deprecated("Migrate to using Sequence<T> and respective functions")
/**
* Returns a sorted list of all elements, ordered by results of specified *order* function.
* Returns a sorted list of all elements, ordered by results of specified [order] function.
*/
public fun <T, V : Comparable<V>> Stream<T>.toSortedListBy(order: (T) -> V): List<T> {
val sortedList = toArrayList()
+30 -30
View File
@@ -11,105 +11,105 @@ import java.util.*
import java.util.Collections // TODO: it's temporary while we have java.util.Collections in js
/**
* Returns a progression that goes over the same range in the opposite direction with the same step
* Returns a progression that goes over the same range in the opposite direction with the same step.
*/
public fun ByteProgression.reversed(): ByteProgression {
return ByteProgression(end, start, -increment)
}
/**
* Returns a progression that goes over the same range in the opposite direction with the same step
* Returns a progression that goes over the same range in the opposite direction with the same step.
*/
public fun CharProgression.reversed(): CharProgression {
return CharProgression(end, start, -increment)
}
/**
* Returns a progression that goes over the same range in the opposite direction with the same step
* Returns a progression that goes over the same range in the opposite direction with the same step.
*/
public fun DoubleProgression.reversed(): DoubleProgression {
return DoubleProgression(end, start, -increment)
}
/**
* Returns a progression that goes over the same range in the opposite direction with the same step
* Returns a progression that goes over the same range in the opposite direction with the same step.
*/
public fun FloatProgression.reversed(): FloatProgression {
return FloatProgression(end, start, -increment)
}
/**
* Returns a progression that goes over the same range in the opposite direction with the same step
* Returns a progression that goes over the same range in the opposite direction with the same step.
*/
public fun IntProgression.reversed(): IntProgression {
return IntProgression(end, start, -increment)
}
/**
* Returns a progression that goes over the same range in the opposite direction with the same step
* Returns a progression that goes over the same range in the opposite direction with the same step.
*/
public fun LongProgression.reversed(): LongProgression {
return LongProgression(end, start, -increment)
}
/**
* Returns a progression that goes over the same range in the opposite direction with the same step
* Returns a progression that goes over the same range in the opposite direction with the same step.
*/
public fun ShortProgression.reversed(): ShortProgression {
return ShortProgression(end, start, -increment)
}
/**
* Returns a progression that goes over this range in reverse direction
* Returns a progression that goes over this range in reverse direction.
*/
public fun ByteRange.reversed(): ByteProgression {
return ByteProgression(end, start, -1)
}
/**
* Returns a progression that goes over this range in reverse direction
* Returns a progression that goes over this range in reverse direction.
*/
public fun CharRange.reversed(): CharProgression {
return CharProgression(end, start, -1)
}
/**
* Returns a progression that goes over this range in reverse direction
* Returns a progression that goes over this range in reverse direction.
*/
public fun DoubleRange.reversed(): DoubleProgression {
return DoubleProgression(end, start, -1.0)
}
/**
* Returns a progression that goes over this range in reverse direction
* Returns a progression that goes over this range in reverse direction.
*/
public fun FloatRange.reversed(): FloatProgression {
return FloatProgression(end, start, -1.0f)
}
/**
* Returns a progression that goes over this range in reverse direction
* Returns a progression that goes over this range in reverse direction.
*/
public fun IntRange.reversed(): IntProgression {
return IntProgression(end, start, -1)
}
/**
* Returns a progression that goes over this range in reverse direction
* Returns a progression that goes over this range in reverse direction.
*/
public fun LongRange.reversed(): LongProgression {
return LongProgression(end, start, -1.toLong())
}
/**
* Returns a progression that goes over this range in reverse direction
* Returns a progression that goes over this range in reverse direction.
*/
public fun ShortRange.reversed(): ShortProgression {
return ShortProgression(end, start, -1)
}
/**
* Returns a progression that goes over the same range with the given step
* Returns a progression that goes over the same range with the given step.
*/
public fun ByteProgression.step(step: Int): ByteProgression {
checkStepIsPositive(step > 0, step)
@@ -117,7 +117,7 @@ public fun ByteProgression.step(step: Int): ByteProgression {
}
/**
* Returns a progression that goes over the same range with the given step
* Returns a progression that goes over the same range with the given step.
*/
public fun CharProgression.step(step: Int): CharProgression {
checkStepIsPositive(step > 0, step)
@@ -125,7 +125,7 @@ public fun CharProgression.step(step: Int): CharProgression {
}
/**
* Returns a progression that goes over the same range with the given step
* Returns a progression that goes over the same range with the given step.
*/
public fun DoubleProgression.step(step: Double): DoubleProgression {
checkStepIsPositive(step > 0, step)
@@ -133,7 +133,7 @@ public fun DoubleProgression.step(step: Double): DoubleProgression {
}
/**
* Returns a progression that goes over the same range with the given step
* Returns a progression that goes over the same range with the given step.
*/
public fun FloatProgression.step(step: Float): FloatProgression {
checkStepIsPositive(step > 0, step)
@@ -141,7 +141,7 @@ public fun FloatProgression.step(step: Float): FloatProgression {
}
/**
* Returns a progression that goes over the same range with the given step
* Returns a progression that goes over the same range with the given step.
*/
public fun IntProgression.step(step: Int): IntProgression {
checkStepIsPositive(step > 0, step)
@@ -149,7 +149,7 @@ public fun IntProgression.step(step: Int): IntProgression {
}
/**
* Returns a progression that goes over the same range with the given step
* Returns a progression that goes over the same range with the given step.
*/
public fun LongProgression.step(step: Long): LongProgression {
checkStepIsPositive(step > 0, step)
@@ -157,7 +157,7 @@ public fun LongProgression.step(step: Long): LongProgression {
}
/**
* Returns a progression that goes over the same range with the given step
* Returns a progression that goes over the same range with the given step.
*/
public fun ShortProgression.step(step: Int): ShortProgression {
checkStepIsPositive(step > 0, step)
@@ -165,7 +165,7 @@ public fun ShortProgression.step(step: Int): ShortProgression {
}
/**
* Returns a progression that goes over this range with given step
* Returns a progression that goes over this range with given step.
*/
public fun ByteRange.step(step: Int): ByteProgression {
checkStepIsPositive(step > 0, step)
@@ -173,7 +173,7 @@ public fun ByteRange.step(step: Int): ByteProgression {
}
/**
* Returns a progression that goes over this range with given step
* Returns a progression that goes over this range with given step.
*/
public fun CharRange.step(step: Int): CharProgression {
checkStepIsPositive(step > 0, step)
@@ -181,25 +181,25 @@ public fun CharRange.step(step: Int): CharProgression {
}
/**
* Returns a progression that goes over this range with given step
* Returns a progression that goes over this range with given step.
*/
public fun DoubleRange.step(step: Double): DoubleProgression {
if (step.isNaN()) throw IllegalArgumentException("Step must not be NaN")
if (step.isNaN()) throw IllegalArgumentException("Step must not be NaN.")
checkStepIsPositive(step > 0, step)
return DoubleProgression(start, end, step)
}
/**
* Returns a progression that goes over this range with given step
* Returns a progression that goes over this range with given step.
*/
public fun FloatRange.step(step: Float): FloatProgression {
if (step.isNaN()) throw IllegalArgumentException("Step must not be NaN")
if (step.isNaN()) throw IllegalArgumentException("Step must not be NaN.")
checkStepIsPositive(step > 0, step)
return FloatProgression(start, end, step)
}
/**
* Returns a progression that goes over this range with given step
* Returns a progression that goes over this range with given step.
*/
public fun IntRange.step(step: Int): IntProgression {
checkStepIsPositive(step > 0, step)
@@ -207,7 +207,7 @@ public fun IntRange.step(step: Int): IntProgression {
}
/**
* Returns a progression that goes over this range with given step
* Returns a progression that goes over this range with given step.
*/
public fun LongRange.step(step: Long): LongProgression {
checkStepIsPositive(step > 0, step)
@@ -215,7 +215,7 @@ public fun LongRange.step(step: Long): LongProgression {
}
/**
* Returns a progression that goes over this range with given step
* Returns a progression that goes over this range with given step.
*/
public fun ShortRange.step(step: Int): ShortProgression {
checkStepIsPositive(step > 0, step)
+14 -14
View File
@@ -11,7 +11,7 @@ import java.util.*
import java.util.Collections // TODO: it's temporary while we have java.util.Collections in js
/**
* Returns a sequence from the given collection
* Returns a sequence from the given collection.
*/
public fun <T> Array<out T>.asSequence(): Sequence<T> {
return object : Sequence<T> {
@@ -22,7 +22,7 @@ public fun <T> Array<out T>.asSequence(): Sequence<T> {
}
/**
* Returns a sequence from the given collection
* Returns a sequence from the given collection.
*/
public fun BooleanArray.asSequence(): Sequence<Boolean> {
return object : Sequence<Boolean> {
@@ -33,7 +33,7 @@ public fun BooleanArray.asSequence(): Sequence<Boolean> {
}
/**
* Returns a sequence from the given collection
* Returns a sequence from the given collection.
*/
public fun ByteArray.asSequence(): Sequence<Byte> {
return object : Sequence<Byte> {
@@ -44,7 +44,7 @@ public fun ByteArray.asSequence(): Sequence<Byte> {
}
/**
* Returns a sequence from the given collection
* Returns a sequence from the given collection.
*/
public fun CharArray.asSequence(): Sequence<Char> {
return object : Sequence<Char> {
@@ -55,7 +55,7 @@ public fun CharArray.asSequence(): Sequence<Char> {
}
/**
* Returns a sequence from the given collection
* Returns a sequence from the given collection.
*/
public fun DoubleArray.asSequence(): Sequence<Double> {
return object : Sequence<Double> {
@@ -66,7 +66,7 @@ public fun DoubleArray.asSequence(): Sequence<Double> {
}
/**
* Returns a sequence from the given collection
* Returns a sequence from the given collection.
*/
public fun FloatArray.asSequence(): Sequence<Float> {
return object : Sequence<Float> {
@@ -77,7 +77,7 @@ public fun FloatArray.asSequence(): Sequence<Float> {
}
/**
* Returns a sequence from the given collection
* Returns a sequence from the given collection.
*/
public fun IntArray.asSequence(): Sequence<Int> {
return object : Sequence<Int> {
@@ -88,7 +88,7 @@ public fun IntArray.asSequence(): Sequence<Int> {
}
/**
* Returns a sequence from the given collection
* Returns a sequence from the given collection.
*/
public fun LongArray.asSequence(): Sequence<Long> {
return object : Sequence<Long> {
@@ -99,7 +99,7 @@ public fun LongArray.asSequence(): Sequence<Long> {
}
/**
* Returns a sequence from the given collection
* Returns a sequence from the given collection.
*/
public fun ShortArray.asSequence(): Sequence<Short> {
return object : Sequence<Short> {
@@ -110,7 +110,7 @@ public fun ShortArray.asSequence(): Sequence<Short> {
}
/**
* Returns a sequence from the given collection
* Returns a sequence from the given collection.
*/
public fun <T> Iterable<T>.asSequence(): Sequence<T> {
return object : Sequence<T> {
@@ -121,7 +121,7 @@ public fun <T> Iterable<T>.asSequence(): Sequence<T> {
}
/**
* Returns a sequence from the given collection
* Returns a sequence from the given collection.
*/
public fun <K, V> Map<K, V>.asSequence(): Sequence<Map.Entry<K, V>> {
return object : Sequence<Map.Entry<K, V>> {
@@ -132,7 +132,7 @@ public fun <K, V> Map<K, V>.asSequence(): Sequence<Map.Entry<K, V>> {
}
/**
* Returns a sequence from the given collection
* Returns a sequence from the given collection.
*/
public fun <T> Sequence<T>.asSequence(): Sequence<T> {
return this
@@ -141,14 +141,14 @@ public fun <T> Sequence<T>.asSequence(): Sequence<T> {
deprecated("Migrate to using Sequence<T> and respective functions")
/**
* Returns a stream from the given collection
* Returns a stream from the given collection.
*/
public fun <T> Stream<T>.asStream(): Stream<T> {
return this
}
/**
* Returns a sequence from the given collection
* Returns a sequence from the given collection.
*/
public fun String.asSequence(): Sequence<Char> {
return object : Sequence<Char> {
+119 -119
View File
@@ -11,14 +11,14 @@ import java.util.*
import java.util.Collections // TODO: it's temporary while we have java.util.Collections in js
/**
* Returns an ArrayList of all elements
* Returns an [ArrayList] of all elements.
*/
public fun <T> Array<out T>.toArrayList(): ArrayList<T> {
return this.asList().toArrayList()
}
/**
* Returns an ArrayList of all elements
* Returns an [ArrayList] of all elements.
*/
public fun BooleanArray.toArrayList(): ArrayList<Boolean> {
val list = ArrayList<Boolean>(size())
@@ -27,7 +27,7 @@ public fun BooleanArray.toArrayList(): ArrayList<Boolean> {
}
/**
* Returns an ArrayList of all elements
* Returns an [ArrayList] of all elements.
*/
public fun ByteArray.toArrayList(): ArrayList<Byte> {
val list = ArrayList<Byte>(size())
@@ -36,7 +36,7 @@ public fun ByteArray.toArrayList(): ArrayList<Byte> {
}
/**
* Returns an ArrayList of all elements
* Returns an [ArrayList] of all elements.
*/
public fun CharArray.toArrayList(): ArrayList<Char> {
val list = ArrayList<Char>(size())
@@ -45,7 +45,7 @@ public fun CharArray.toArrayList(): ArrayList<Char> {
}
/**
* Returns an ArrayList of all elements
* Returns an [ArrayList] of all elements.
*/
public fun DoubleArray.toArrayList(): ArrayList<Double> {
val list = ArrayList<Double>(size())
@@ -54,7 +54,7 @@ public fun DoubleArray.toArrayList(): ArrayList<Double> {
}
/**
* Returns an ArrayList of all elements
* Returns an [ArrayList] of all elements.
*/
public fun FloatArray.toArrayList(): ArrayList<Float> {
val list = ArrayList<Float>(size())
@@ -63,7 +63,7 @@ public fun FloatArray.toArrayList(): ArrayList<Float> {
}
/**
* Returns an ArrayList of all elements
* Returns an [ArrayList] of all elements.
*/
public fun IntArray.toArrayList(): ArrayList<Int> {
val list = ArrayList<Int>(size())
@@ -72,7 +72,7 @@ public fun IntArray.toArrayList(): ArrayList<Int> {
}
/**
* Returns an ArrayList of all elements
* Returns an [ArrayList] of all elements.
*/
public fun LongArray.toArrayList(): ArrayList<Long> {
val list = ArrayList<Long>(size())
@@ -81,7 +81,7 @@ public fun LongArray.toArrayList(): ArrayList<Long> {
}
/**
* Returns an ArrayList of all elements
* Returns an [ArrayList] of all elements.
*/
public fun ShortArray.toArrayList(): ArrayList<Short> {
val list = ArrayList<Short>(size())
@@ -90,14 +90,14 @@ public fun ShortArray.toArrayList(): ArrayList<Short> {
}
/**
* Returns an ArrayList of all elements
* Returns an [ArrayList] of all elements.
*/
public fun <T> Collection<T>.toArrayList(): ArrayList<T> {
return ArrayList(this)
}
/**
* Returns an ArrayList of all elements
* Returns an [ArrayList] of all elements.
*/
public fun <T> Iterable<T>.toArrayList(): ArrayList<T> {
if (this is Collection<T>)
@@ -106,7 +106,7 @@ public fun <T> Iterable<T>.toArrayList(): ArrayList<T> {
}
/**
* Returns an ArrayList of all elements
* Returns an [ArrayList] of all elements.
*/
public fun <T> Sequence<T>.toArrayList(): ArrayList<T> {
return toCollection(ArrayList<T>())
@@ -115,21 +115,21 @@ public fun <T> Sequence<T>.toArrayList(): ArrayList<T> {
deprecated("Migrate to using Sequence<T> and respective functions")
/**
* Returns an ArrayList of all elements
* Returns an [ArrayList] of all elements.
*/
public fun <T> Stream<T>.toArrayList(): ArrayList<T> {
return toCollection(ArrayList<T>())
}
/**
* Returns an ArrayList of all elements
* Returns an [ArrayList] of all elements.
*/
public fun String.toArrayList(): ArrayList<Char> {
return toCollection(ArrayList<Char>(length()))
}
/**
* Appends all elements to the given *collection*
* Appends all elements to the given [collection].
*/
public fun <T, C : MutableCollection<in T>> Array<out T>.toCollection(collection: C): C {
for (item in this) {
@@ -139,7 +139,7 @@ public fun <T, C : MutableCollection<in T>> Array<out T>.toCollection(collection
}
/**
* Appends all elements to the given *collection*
* Appends all elements to the given [collection].
*/
public fun <C : MutableCollection<in Boolean>> BooleanArray.toCollection(collection: C): C {
for (item in this) {
@@ -149,7 +149,7 @@ public fun <C : MutableCollection<in Boolean>> BooleanArray.toCollection(collect
}
/**
* Appends all elements to the given *collection*
* Appends all elements to the given [collection].
*/
public fun <C : MutableCollection<in Byte>> ByteArray.toCollection(collection: C): C {
for (item in this) {
@@ -159,7 +159,7 @@ public fun <C : MutableCollection<in Byte>> ByteArray.toCollection(collection: C
}
/**
* Appends all elements to the given *collection*
* Appends all elements to the given [collection].
*/
public fun <C : MutableCollection<in Char>> CharArray.toCollection(collection: C): C {
for (item in this) {
@@ -169,7 +169,7 @@ public fun <C : MutableCollection<in Char>> CharArray.toCollection(collection: C
}
/**
* Appends all elements to the given *collection*
* Appends all elements to the given [collection].
*/
public fun <C : MutableCollection<in Double>> DoubleArray.toCollection(collection: C): C {
for (item in this) {
@@ -179,7 +179,7 @@ public fun <C : MutableCollection<in Double>> DoubleArray.toCollection(collectio
}
/**
* Appends all elements to the given *collection*
* Appends all elements to the given [collection].
*/
public fun <C : MutableCollection<in Float>> FloatArray.toCollection(collection: C): C {
for (item in this) {
@@ -189,7 +189,7 @@ public fun <C : MutableCollection<in Float>> FloatArray.toCollection(collection:
}
/**
* Appends all elements to the given *collection*
* Appends all elements to the given [collection].
*/
public fun <C : MutableCollection<in Int>> IntArray.toCollection(collection: C): C {
for (item in this) {
@@ -199,7 +199,7 @@ public fun <C : MutableCollection<in Int>> IntArray.toCollection(collection: C):
}
/**
* Appends all elements to the given *collection*
* Appends all elements to the given [collection].
*/
public fun <C : MutableCollection<in Long>> LongArray.toCollection(collection: C): C {
for (item in this) {
@@ -209,7 +209,7 @@ public fun <C : MutableCollection<in Long>> LongArray.toCollection(collection: C
}
/**
* Appends all elements to the given *collection*
* Appends all elements to the given [collection].
*/
public fun <C : MutableCollection<in Short>> ShortArray.toCollection(collection: C): C {
for (item in this) {
@@ -219,7 +219,7 @@ public fun <C : MutableCollection<in Short>> ShortArray.toCollection(collection:
}
/**
* Appends all elements to the given *collection*
* Appends all elements to the given [collection].
*/
public fun <T, C : MutableCollection<in T>> Iterable<T>.toCollection(collection: C): C {
for (item in this) {
@@ -229,7 +229,7 @@ public fun <T, C : MutableCollection<in T>> Iterable<T>.toCollection(collection:
}
/**
* Appends all elements to the given *collection*
* Appends all elements to the given [collection].
*/
public fun <T, C : MutableCollection<in T>> Sequence<T>.toCollection(collection: C): C {
for (item in this) {
@@ -241,7 +241,7 @@ public fun <T, C : MutableCollection<in T>> Sequence<T>.toCollection(collection:
deprecated("Migrate to using Sequence<T> and respective functions")
/**
* Appends all elements to the given *collection*
* Appends all elements to the given [collection].
*/
public fun <T, C : MutableCollection<in T>> Stream<T>.toCollection(collection: C): C {
for (item in this) {
@@ -251,7 +251,7 @@ public fun <T, C : MutableCollection<in T>> Stream<T>.toCollection(collection: C
}
/**
* Appends all elements to the given *collection*
* Appends all elements to the given [collection].
*/
public fun <C : MutableCollection<in Char>> String.toCollection(collection: C): C {
for (item in this) {
@@ -261,77 +261,77 @@ public fun <C : MutableCollection<in Char>> String.toCollection(collection: C):
}
/**
* Returns a HashSet of all elements
* Returns a [HashSet] of all elements.
*/
public fun <T> Array<out T>.toHashSet(): HashSet<T> {
return toCollection(HashSet<T>(mapCapacity(size())))
}
/**
* Returns a HashSet of all elements
* Returns a [HashSet] of all elements.
*/
public fun BooleanArray.toHashSet(): HashSet<Boolean> {
return toCollection(HashSet<Boolean>(mapCapacity(size())))
}
/**
* Returns a HashSet of all elements
* Returns a [HashSet] of all elements.
*/
public fun ByteArray.toHashSet(): HashSet<Byte> {
return toCollection(HashSet<Byte>(mapCapacity(size())))
}
/**
* Returns a HashSet of all elements
* Returns a [HashSet] of all elements.
*/
public fun CharArray.toHashSet(): HashSet<Char> {
return toCollection(HashSet<Char>(mapCapacity(size())))
}
/**
* Returns a HashSet of all elements
* Returns a [HashSet] of all elements.
*/
public fun DoubleArray.toHashSet(): HashSet<Double> {
return toCollection(HashSet<Double>(mapCapacity(size())))
}
/**
* Returns a HashSet of all elements
* Returns a [HashSet] of all elements.
*/
public fun FloatArray.toHashSet(): HashSet<Float> {
return toCollection(HashSet<Float>(mapCapacity(size())))
}
/**
* Returns a HashSet of all elements
* Returns a [HashSet] of all elements.
*/
public fun IntArray.toHashSet(): HashSet<Int> {
return toCollection(HashSet<Int>(mapCapacity(size())))
}
/**
* Returns a HashSet of all elements
* Returns a [HashSet] of all elements.
*/
public fun LongArray.toHashSet(): HashSet<Long> {
return toCollection(HashSet<Long>(mapCapacity(size())))
}
/**
* Returns a HashSet of all elements
* Returns a [HashSet] of all elements.
*/
public fun ShortArray.toHashSet(): HashSet<Short> {
return toCollection(HashSet<Short>(mapCapacity(size())))
}
/**
* Returns a HashSet of all elements
* Returns a [HashSet] of all elements.
*/
public fun <T> Iterable<T>.toHashSet(): HashSet<T> {
return toCollection(HashSet<T>(mapCapacity(collectionSizeOrDefault(12))))
}
/**
* Returns a HashSet of all elements
* Returns a [HashSet] of all elements.
*/
public fun <T> Sequence<T>.toHashSet(): HashSet<T> {
return toCollection(HashSet<T>())
@@ -340,91 +340,91 @@ public fun <T> Sequence<T>.toHashSet(): HashSet<T> {
deprecated("Migrate to using Sequence<T> and respective functions")
/**
* Returns a HashSet of all elements
* Returns a [HashSet] of all elements.
*/
public fun <T> Stream<T>.toHashSet(): HashSet<T> {
return toCollection(HashSet<T>())
}
/**
* Returns a HashSet of all elements
* Returns a [HashSet] of all elements.
*/
public fun String.toHashSet(): HashSet<Char> {
return toCollection(HashSet<Char>(mapCapacity(length())))
}
/**
* Returns a LinkedList containing all elements
* Returns a [LinkedList] containing all elements.
*/
public fun <T> Array<out T>.toLinkedList(): LinkedList<T> {
return toCollection(LinkedList<T>())
}
/**
* Returns a LinkedList containing all elements
* Returns a [LinkedList] containing all elements.
*/
public fun BooleanArray.toLinkedList(): LinkedList<Boolean> {
return toCollection(LinkedList<Boolean>())
}
/**
* Returns a LinkedList containing all elements
* Returns a [LinkedList] containing all elements.
*/
public fun ByteArray.toLinkedList(): LinkedList<Byte> {
return toCollection(LinkedList<Byte>())
}
/**
* Returns a LinkedList containing all elements
* Returns a [LinkedList] containing all elements.
*/
public fun CharArray.toLinkedList(): LinkedList<Char> {
return toCollection(LinkedList<Char>())
}
/**
* Returns a LinkedList containing all elements
* Returns a [LinkedList] containing all elements.
*/
public fun DoubleArray.toLinkedList(): LinkedList<Double> {
return toCollection(LinkedList<Double>())
}
/**
* Returns a LinkedList containing all elements
* Returns a [LinkedList] containing all elements.
*/
public fun FloatArray.toLinkedList(): LinkedList<Float> {
return toCollection(LinkedList<Float>())
}
/**
* Returns a LinkedList containing all elements
* Returns a [LinkedList] containing all elements.
*/
public fun IntArray.toLinkedList(): LinkedList<Int> {
return toCollection(LinkedList<Int>())
}
/**
* Returns a LinkedList containing all elements
* Returns a [LinkedList] containing all elements.
*/
public fun LongArray.toLinkedList(): LinkedList<Long> {
return toCollection(LinkedList<Long>())
}
/**
* Returns a LinkedList containing all elements
* Returns a [LinkedList] containing all elements.
*/
public fun ShortArray.toLinkedList(): LinkedList<Short> {
return toCollection(LinkedList<Short>())
}
/**
* Returns a LinkedList containing all elements
* Returns a [LinkedList] containing all elements.
*/
public fun <T> Iterable<T>.toLinkedList(): LinkedList<T> {
return toCollection(LinkedList<T>())
}
/**
* Returns a LinkedList containing all elements
* Returns a [LinkedList] containing all elements.
*/
public fun <T> Sequence<T>.toLinkedList(): LinkedList<T> {
return toCollection(LinkedList<T>())
@@ -433,21 +433,21 @@ public fun <T> Sequence<T>.toLinkedList(): LinkedList<T> {
deprecated("Migrate to using Sequence<T> and respective functions")
/**
* Returns a LinkedList containing all elements
* Returns a [LinkedList] containing all elements.
*/
public fun <T> Stream<T>.toLinkedList(): LinkedList<T> {
return toCollection(LinkedList<T>())
}
/**
* Returns a LinkedList containing all elements
* Returns a [LinkedList] containing all elements.
*/
public fun String.toLinkedList(): LinkedList<Char> {
return toCollection(LinkedList<Char>())
}
/**
* Returns a List containing all key-value pairs
* Returns a [List] containing all key-value pairs.
*/
public fun <K, V> Map<K, V>.toList(): List<Pair<K, V>> {
val result = ArrayList<Pair<K, V>>(size())
@@ -457,77 +457,77 @@ public fun <K, V> Map<K, V>.toList(): List<Pair<K, V>> {
}
/**
* Returns a List containing all elements
* Returns a [List] containing all elements.
*/
public fun <T> Array<out T>.toList(): List<T> {
return this.toArrayList()
}
/**
* Returns a List containing all elements
* Returns a [List] containing all elements.
*/
public fun BooleanArray.toList(): List<Boolean> {
return this.toArrayList()
}
/**
* Returns a List containing all elements
* Returns a [List] containing all elements.
*/
public fun ByteArray.toList(): List<Byte> {
return this.toArrayList()
}
/**
* Returns a List containing all elements
* Returns a [List] containing all elements.
*/
public fun CharArray.toList(): List<Char> {
return this.toArrayList()
}
/**
* Returns a List containing all elements
* Returns a [List] containing all elements.
*/
public fun DoubleArray.toList(): List<Double> {
return this.toArrayList()
}
/**
* Returns a List containing all elements
* Returns a [List] containing all elements.
*/
public fun FloatArray.toList(): List<Float> {
return this.toArrayList()
}
/**
* Returns a List containing all elements
* Returns a [List] containing all elements.
*/
public fun IntArray.toList(): List<Int> {
return this.toArrayList()
}
/**
* Returns a List containing all elements
* Returns a [List] containing all elements.
*/
public fun LongArray.toList(): List<Long> {
return this.toArrayList()
}
/**
* Returns a List containing all elements
* Returns a [List] containing all elements.
*/
public fun ShortArray.toList(): List<Short> {
return this.toArrayList()
}
/**
* Returns a List containing all elements
* Returns a [List] containing all elements.
*/
public fun <T> Iterable<T>.toList(): List<T> {
return this.toArrayList()
}
/**
* Returns a List containing all elements
* Returns a [List] containing all elements.
*/
public fun <T> Sequence<T>.toList(): List<T> {
return this.toArrayList()
@@ -536,21 +536,21 @@ public fun <T> Sequence<T>.toList(): List<T> {
deprecated("Migrate to using Sequence<T> and respective functions")
/**
* Returns a List containing all elements
* Returns a [List] containing all elements.
*/
public fun <T> Stream<T>.toList(): List<T> {
return this.toArrayList()
}
/**
* Returns a List containing all elements
* Returns a [List] containing all elements.
*/
public fun String.toList(): List<Char> {
return this.toArrayList()
}
/**
* Returns Map containing all the values from the given collection indexed by *selector*
* Returns Map containing all the values from the given collection indexed by [selector].
*/
public inline fun <T, K> Array<out T>.toMap(selector: (T) -> K): Map<K, T> {
val capacity = (size()/.75f) + 1
@@ -562,7 +562,7 @@ public inline fun <T, K> Array<out T>.toMap(selector: (T) -> K): Map<K, T> {
}
/**
* Returns Map containing all the values from the given collection indexed by *selector*
* Returns Map containing all the values from the given collection indexed by [selector].
*/
public inline fun <K> BooleanArray.toMap(selector: (Boolean) -> K): Map<K, Boolean> {
val capacity = (size()/.75f) + 1
@@ -574,7 +574,7 @@ public inline fun <K> BooleanArray.toMap(selector: (Boolean) -> K): Map<K, Boole
}
/**
* Returns Map containing all the values from the given collection indexed by *selector*
* Returns Map containing all the values from the given collection indexed by [selector].
*/
public inline fun <K> ByteArray.toMap(selector: (Byte) -> K): Map<K, Byte> {
val capacity = (size()/.75f) + 1
@@ -586,7 +586,7 @@ public inline fun <K> ByteArray.toMap(selector: (Byte) -> K): Map<K, Byte> {
}
/**
* Returns Map containing all the values from the given collection indexed by *selector*
* Returns Map containing all the values from the given collection indexed by [selector].
*/
public inline fun <K> CharArray.toMap(selector: (Char) -> K): Map<K, Char> {
val capacity = (size()/.75f) + 1
@@ -598,7 +598,7 @@ public inline fun <K> CharArray.toMap(selector: (Char) -> K): Map<K, Char> {
}
/**
* Returns Map containing all the values from the given collection indexed by *selector*
* Returns Map containing all the values from the given collection indexed by [selector].
*/
public inline fun <K> DoubleArray.toMap(selector: (Double) -> K): Map<K, Double> {
val capacity = (size()/.75f) + 1
@@ -610,7 +610,7 @@ public inline fun <K> DoubleArray.toMap(selector: (Double) -> K): Map<K, Double>
}
/**
* Returns Map containing all the values from the given collection indexed by *selector*
* Returns Map containing all the values from the given collection indexed by [selector].
*/
public inline fun <K> FloatArray.toMap(selector: (Float) -> K): Map<K, Float> {
val capacity = (size()/.75f) + 1
@@ -622,7 +622,7 @@ public inline fun <K> FloatArray.toMap(selector: (Float) -> K): Map<K, Float> {
}
/**
* Returns Map containing all the values from the given collection indexed by *selector*
* Returns Map containing all the values from the given collection indexed by [selector].
*/
public inline fun <K> IntArray.toMap(selector: (Int) -> K): Map<K, Int> {
val capacity = (size()/.75f) + 1
@@ -634,7 +634,7 @@ public inline fun <K> IntArray.toMap(selector: (Int) -> K): Map<K, Int> {
}
/**
* Returns Map containing all the values from the given collection indexed by *selector*
* Returns Map containing all the values from the given collection indexed by [selector].
*/
public inline fun <K> LongArray.toMap(selector: (Long) -> K): Map<K, Long> {
val capacity = (size()/.75f) + 1
@@ -646,7 +646,7 @@ public inline fun <K> LongArray.toMap(selector: (Long) -> K): Map<K, Long> {
}
/**
* Returns Map containing all the values from the given collection indexed by *selector*
* Returns Map containing all the values from the given collection indexed by [selector].
*/
public inline fun <K> ShortArray.toMap(selector: (Short) -> K): Map<K, Short> {
val capacity = (size()/.75f) + 1
@@ -658,7 +658,7 @@ public inline fun <K> ShortArray.toMap(selector: (Short) -> K): Map<K, Short> {
}
/**
* Returns Map containing all the values from the given collection indexed by *selector*
* Returns Map containing all the values from the given collection indexed by [selector].
*/
public inline fun <T, K> Iterable<T>.toMap(selector: (T) -> K): Map<K, T> {
val capacity = (collectionSizeOrDefault(10)/.75f) + 1
@@ -670,7 +670,7 @@ public inline fun <T, K> Iterable<T>.toMap(selector: (T) -> K): Map<K, T> {
}
/**
* Returns Map containing all the values from the given collection indexed by *selector*
* Returns Map containing all the values from the given collection indexed by [selector].
*/
public inline fun <T, K> Sequence<T>.toMap(selector: (T) -> K): Map<K, T> {
val result = LinkedHashMap<K, T>()
@@ -683,7 +683,7 @@ public inline fun <T, K> Sequence<T>.toMap(selector: (T) -> K): Map<K, T> {
deprecated("Migrate to using Sequence<T> and respective functions")
/**
* Returns Map containing all the values from the given collection indexed by *selector*
* Returns Map containing all the values from the given collection indexed by [selector].
*/
public inline fun <T, K> Stream<T>.toMap(selector: (T) -> K): Map<K, T> {
val result = LinkedHashMap<K, T>()
@@ -694,7 +694,7 @@ public inline fun <T, K> Stream<T>.toMap(selector: (T) -> K): Map<K, T> {
}
/**
* Returns Map containing all the values from the given collection indexed by *selector*
* Returns Map containing all the values from the given collection indexed by [selector].
*/
public inline fun <K> String.toMap(selector: (Char) -> K): Map<K, Char> {
val capacity = (length()/.75f) + 1
@@ -706,7 +706,7 @@ public inline fun <K> String.toMap(selector: (Char) -> K): Map<K, Char> {
}
/**
* Returns Map containing all the values provided by *transform* and indexed by *selector* from the given collection
* Returns Map containing all the values provided by [transform] and indexed by [selector] from the given collection.
*/
public inline fun <T, K, V> Array<out T>.toMap(selector: (T) -> K, transform: (T) -> V): Map<K, V> {
val capacity = (size()/.75f) + 1
@@ -718,7 +718,7 @@ public inline fun <T, K, V> Array<out T>.toMap(selector: (T) -> K, transform: (T
}
/**
* Returns Map containing all the values provided by *transform* and indexed by *selector* from the given collection
* Returns Map containing all the values provided by [transform] and indexed by [selector] from the given collection.
*/
public inline fun <K, V> BooleanArray.toMap(selector: (Boolean) -> K, transform: (Boolean) -> V): Map<K, V> {
val capacity = (size()/.75f) + 1
@@ -730,7 +730,7 @@ public inline fun <K, V> BooleanArray.toMap(selector: (Boolean) -> K, transform:
}
/**
* Returns Map containing all the values provided by *transform* and indexed by *selector* from the given collection
* Returns Map containing all the values provided by [transform] and indexed by [selector] from the given collection.
*/
public inline fun <K, V> ByteArray.toMap(selector: (Byte) -> K, transform: (Byte) -> V): Map<K, V> {
val capacity = (size()/.75f) + 1
@@ -742,7 +742,7 @@ public inline fun <K, V> ByteArray.toMap(selector: (Byte) -> K, transform: (Byte
}
/**
* Returns Map containing all the values provided by *transform* and indexed by *selector* from the given collection
* Returns Map containing all the values provided by [transform] and indexed by [selector] from the given collection.
*/
public inline fun <K, V> CharArray.toMap(selector: (Char) -> K, transform: (Char) -> V): Map<K, V> {
val capacity = (size()/.75f) + 1
@@ -754,7 +754,7 @@ public inline fun <K, V> CharArray.toMap(selector: (Char) -> K, transform: (Char
}
/**
* Returns Map containing all the values provided by *transform* and indexed by *selector* from the given collection
* Returns Map containing all the values provided by [transform] and indexed by [selector] from the given collection.
*/
public inline fun <K, V> DoubleArray.toMap(selector: (Double) -> K, transform: (Double) -> V): Map<K, V> {
val capacity = (size()/.75f) + 1
@@ -766,7 +766,7 @@ public inline fun <K, V> DoubleArray.toMap(selector: (Double) -> K, transform: (
}
/**
* Returns Map containing all the values provided by *transform* and indexed by *selector* from the given collection
* Returns Map containing all the values provided by [transform] and indexed by [selector] from the given collection.
*/
public inline fun <K, V> FloatArray.toMap(selector: (Float) -> K, transform: (Float) -> V): Map<K, V> {
val capacity = (size()/.75f) + 1
@@ -778,7 +778,7 @@ public inline fun <K, V> FloatArray.toMap(selector: (Float) -> K, transform: (Fl
}
/**
* Returns Map containing all the values provided by *transform* and indexed by *selector* from the given collection
* Returns Map containing all the values provided by [transform] and indexed by [selector] from the given collection.
*/
public inline fun <K, V> IntArray.toMap(selector: (Int) -> K, transform: (Int) -> V): Map<K, V> {
val capacity = (size()/.75f) + 1
@@ -790,7 +790,7 @@ public inline fun <K, V> IntArray.toMap(selector: (Int) -> K, transform: (Int) -
}
/**
* Returns Map containing all the values provided by *transform* and indexed by *selector* from the given collection
* Returns Map containing all the values provided by [transform] and indexed by [selector] from the given collection.
*/
public inline fun <K, V> LongArray.toMap(selector: (Long) -> K, transform: (Long) -> V): Map<K, V> {
val capacity = (size()/.75f) + 1
@@ -802,7 +802,7 @@ public inline fun <K, V> LongArray.toMap(selector: (Long) -> K, transform: (Long
}
/**
* Returns Map containing all the values provided by *transform* and indexed by *selector* from the given collection
* Returns Map containing all the values provided by [transform] and indexed by [selector] from the given collection.
*/
public inline fun <K, V> ShortArray.toMap(selector: (Short) -> K, transform: (Short) -> V): Map<K, V> {
val capacity = (size()/.75f) + 1
@@ -814,7 +814,7 @@ public inline fun <K, V> ShortArray.toMap(selector: (Short) -> K, transform: (Sh
}
/**
* Returns Map containing all the values provided by *transform* and indexed by *selector* from the given collection
* Returns Map containing all the values provided by [transform] and indexed by [selector] from the given collection.
*/
public inline fun <T, K, V> Iterable<T>.toMap(selector: (T) -> K, transform: (T) -> V): Map<K, V> {
val capacity = (collectionSizeOrDefault(10)/.75f) + 1
@@ -826,7 +826,7 @@ public inline fun <T, K, V> Iterable<T>.toMap(selector: (T) -> K, transform: (T)
}
/**
* Returns Map containing all the values provided by *transform* and indexed by *selector* from the given collection
* Returns Map containing all the values provided by [transform] and indexed by [selector] from the given collection.
*/
public inline fun <T, K, V> Sequence<T>.toMap(selector: (T) -> K, transform: (T) -> V): Map<K, V> {
val result = LinkedHashMap<K, V>()
@@ -839,7 +839,7 @@ public inline fun <T, K, V> Sequence<T>.toMap(selector: (T) -> K, transform: (T)
deprecated("Migrate to using Sequence<T> and respective functions")
/**
* Returns Map containing all the values provided by *transform* and indexed by *selector* from the given collection
* Returns Map containing all the values provided by [transform] and indexed by [selector] from the given collection.
*/
public inline fun <T, K, V> Stream<T>.toMap(selector: (T) -> K, transform: (T) -> V): Map<K, V> {
val result = LinkedHashMap<K, V>()
@@ -850,7 +850,7 @@ public inline fun <T, K, V> Stream<T>.toMap(selector: (T) -> K, transform: (T) -
}
/**
* Returns Map containing all the values provided by *transform* and indexed by *selector* from the given collection
* Returns Map containing all the values provided by [transform] and indexed by [selector] from the given collection.
*/
public inline fun <K, V> String.toMap(selector: (Char) -> K, transform: (Char) -> V): Map<K, V> {
val capacity = (length()/.75f) + 1
@@ -862,77 +862,77 @@ public inline fun <K, V> String.toMap(selector: (Char) -> K, transform: (Char) -
}
/**
* Returns a Set of all elements
* Returns a [Set] of all elements.
*/
public fun <T> Array<out T>.toSet(): Set<T> {
return toCollection(LinkedHashSet<T>(mapCapacity(size())))
}
/**
* Returns a Set of all elements
* Returns a [Set] of all elements.
*/
public fun BooleanArray.toSet(): Set<Boolean> {
return toCollection(LinkedHashSet<Boolean>(mapCapacity(size())))
}
/**
* Returns a Set of all elements
* Returns a [Set] of all elements.
*/
public fun ByteArray.toSet(): Set<Byte> {
return toCollection(LinkedHashSet<Byte>(mapCapacity(size())))
}
/**
* Returns a Set of all elements
* Returns a [Set] of all elements.
*/
public fun CharArray.toSet(): Set<Char> {
return toCollection(LinkedHashSet<Char>(mapCapacity(size())))
}
/**
* Returns a Set of all elements
* Returns a [Set] of all elements.
*/
public fun DoubleArray.toSet(): Set<Double> {
return toCollection(LinkedHashSet<Double>(mapCapacity(size())))
}
/**
* Returns a Set of all elements
* Returns a [Set] of all elements.
*/
public fun FloatArray.toSet(): Set<Float> {
return toCollection(LinkedHashSet<Float>(mapCapacity(size())))
}
/**
* Returns a Set of all elements
* Returns a [Set] of all elements.
*/
public fun IntArray.toSet(): Set<Int> {
return toCollection(LinkedHashSet<Int>(mapCapacity(size())))
}
/**
* Returns a Set of all elements
* Returns a [Set] of all elements.
*/
public fun LongArray.toSet(): Set<Long> {
return toCollection(LinkedHashSet<Long>(mapCapacity(size())))
}
/**
* Returns a Set of all elements
* Returns a [Set] of all elements.
*/
public fun ShortArray.toSet(): Set<Short> {
return toCollection(LinkedHashSet<Short>(mapCapacity(size())))
}
/**
* Returns a Set of all elements
* Returns a [Set] of all elements.
*/
public fun <T> Iterable<T>.toSet(): Set<T> {
return toCollection(LinkedHashSet<T>(mapCapacity(collectionSizeOrDefault(12))))
}
/**
* Returns a Set of all elements
* Returns a [Set] of all elements.
*/
public fun <T> Sequence<T>.toSet(): Set<T> {
return toCollection(LinkedHashSet<T>())
@@ -941,91 +941,91 @@ public fun <T> Sequence<T>.toSet(): Set<T> {
deprecated("Migrate to using Sequence<T> and respective functions")
/**
* Returns a Set of all elements
* Returns a [Set] of all elements.
*/
public fun <T> Stream<T>.toSet(): Set<T> {
return toCollection(LinkedHashSet<T>())
}
/**
* Returns a Set of all elements
* Returns a [Set] of all elements.
*/
public fun String.toSet(): Set<Char> {
return toCollection(LinkedHashSet<Char>(mapCapacity(length())))
}
/**
* Returns a SortedSet of all elements
* Returns a [SortedSet] of all elements.
*/
public fun <T> Array<out T>.toSortedSet(): SortedSet<T> {
return toCollection(TreeSet<T>())
}
/**
* Returns a SortedSet of all elements
* Returns a [SortedSet] of all elements.
*/
public fun BooleanArray.toSortedSet(): SortedSet<Boolean> {
return toCollection(TreeSet<Boolean>())
}
/**
* Returns a SortedSet of all elements
* Returns a [SortedSet] of all elements.
*/
public fun ByteArray.toSortedSet(): SortedSet<Byte> {
return toCollection(TreeSet<Byte>())
}
/**
* Returns a SortedSet of all elements
* Returns a [SortedSet] of all elements.
*/
public fun CharArray.toSortedSet(): SortedSet<Char> {
return toCollection(TreeSet<Char>())
}
/**
* Returns a SortedSet of all elements
* Returns a [SortedSet] of all elements.
*/
public fun DoubleArray.toSortedSet(): SortedSet<Double> {
return toCollection(TreeSet<Double>())
}
/**
* Returns a SortedSet of all elements
* Returns a [SortedSet] of all elements.
*/
public fun FloatArray.toSortedSet(): SortedSet<Float> {
return toCollection(TreeSet<Float>())
}
/**
* Returns a SortedSet of all elements
* Returns a [SortedSet] of all elements.
*/
public fun IntArray.toSortedSet(): SortedSet<Int> {
return toCollection(TreeSet<Int>())
}
/**
* Returns a SortedSet of all elements
* Returns a [SortedSet] of all elements.
*/
public fun LongArray.toSortedSet(): SortedSet<Long> {
return toCollection(TreeSet<Long>())
}
/**
* Returns a SortedSet of all elements
* Returns a [SortedSet] of all elements.
*/
public fun ShortArray.toSortedSet(): SortedSet<Short> {
return toCollection(TreeSet<Short>())
}
/**
* Returns a SortedSet of all elements
* Returns a [SortedSet] of all elements.
*/
public fun <T> Iterable<T>.toSortedSet(): SortedSet<T> {
return toCollection(TreeSet<T>())
}
/**
* Returns a SortedSet of all elements
* Returns a [SortedSet] of all elements.
*/
public fun <T> Sequence<T>.toSortedSet(): SortedSet<T> {
return toCollection(TreeSet<T>())
@@ -1034,14 +1034,14 @@ public fun <T> Sequence<T>.toSortedSet(): SortedSet<T> {
deprecated("Migrate to using Sequence<T> and respective functions")
/**
* Returns a SortedSet of all elements
* Returns a [SortedSet] of all elements.
*/
public fun <T> Stream<T>.toSortedSet(): SortedSet<T> {
return toCollection(TreeSet<T>())
}
/**
* Returns a SortedSet of all elements
* Returns a [SortedSet] of all elements.
*/
public fun String.toSortedSet(): SortedSet<Char> {
return toCollection(TreeSet<Char>())
+69 -69
View File
@@ -11,14 +11,14 @@ import java.util.*
import java.util.Collections // TODO: it's temporary while we have java.util.Collections in js
/**
* Returns a list that wraps the original array
* Returns a [List] that wraps the original array.
*/
public fun <T> Array<out T>.asList(): List<T> {
return Arrays.asList(*this)
}
/**
* Returns a list that wraps the original array
* Returns a [List] that wraps the original array.
*/
public fun BooleanArray.asList(): List<Boolean> {
return object : AbstractList<Boolean>(), RandomAccess {
@@ -33,7 +33,7 @@ public fun BooleanArray.asList(): List<Boolean> {
}
/**
* Returns a list that wraps the original array
* Returns a [List] that wraps the original array.
*/
public fun ByteArray.asList(): List<Byte> {
return object : AbstractList<Byte>(), RandomAccess {
@@ -48,7 +48,7 @@ public fun ByteArray.asList(): List<Byte> {
}
/**
* Returns a list that wraps the original array
* Returns a [List] that wraps the original array.
*/
public fun CharArray.asList(): List<Char> {
return object : AbstractList<Char>(), RandomAccess {
@@ -63,7 +63,7 @@ public fun CharArray.asList(): List<Char> {
}
/**
* Returns a list that wraps the original array
* Returns a [List] that wraps the original array.
*/
public fun DoubleArray.asList(): List<Double> {
return object : AbstractList<Double>(), RandomAccess {
@@ -78,7 +78,7 @@ public fun DoubleArray.asList(): List<Double> {
}
/**
* Returns a list that wraps the original array
* Returns a [List] that wraps the original array.
*/
public fun FloatArray.asList(): List<Float> {
return object : AbstractList<Float>(), RandomAccess {
@@ -93,7 +93,7 @@ public fun FloatArray.asList(): List<Float> {
}
/**
* Returns a list that wraps the original array
* Returns a [List] that wraps the original array.
*/
public fun IntArray.asList(): List<Int> {
return object : AbstractList<Int>(), RandomAccess {
@@ -108,7 +108,7 @@ public fun IntArray.asList(): List<Int> {
}
/**
* Returns a list that wraps the original array
* Returns a [List] that wraps the original array.
*/
public fun LongArray.asList(): List<Long> {
return object : AbstractList<Long>(), RandomAccess {
@@ -123,7 +123,7 @@ public fun LongArray.asList(): List<Long> {
}
/**
* Returns a list that wraps the original array
* Returns a [List] that wraps the original array.
*/
public fun ShortArray.asList(): List<Short> {
return object : AbstractList<Short>(), RandomAccess {
@@ -194,196 +194,196 @@ public fun ShortArray.binarySearch(element: Short, fromIndex: Int = 0, toIndex:
}
/**
* Returns new array which is a copy of the original array
* Returns new array which is a copy of the original array.
*/
public fun <T> Array<out T>.copyOf(): Array<T> {
return Arrays.copyOf(this, size()) as Array<T>
}
/**
* Returns new array which is a copy of the original array
* Returns new array which is a copy of the original array.
*/
public fun BooleanArray.copyOf(): BooleanArray {
return Arrays.copyOf(this, size())
}
/**
* Returns new array which is a copy of the original array
* Returns new array which is a copy of the original array.
*/
public fun ByteArray.copyOf(): ByteArray {
return Arrays.copyOf(this, size())
}
/**
* Returns new array which is a copy of the original array
* Returns new array which is a copy of the original array.
*/
public fun CharArray.copyOf(): CharArray {
return Arrays.copyOf(this, size())
}
/**
* Returns new array which is a copy of the original array
* Returns new array which is a copy of the original array.
*/
public fun DoubleArray.copyOf(): DoubleArray {
return Arrays.copyOf(this, size())
}
/**
* Returns new array which is a copy of the original array
* Returns new array which is a copy of the original array.
*/
public fun FloatArray.copyOf(): FloatArray {
return Arrays.copyOf(this, size())
}
/**
* Returns new array which is a copy of the original array
* Returns new array which is a copy of the original array.
*/
public fun IntArray.copyOf(): IntArray {
return Arrays.copyOf(this, size())
}
/**
* Returns new array which is a copy of the original array
* Returns new array which is a copy of the original array.
*/
public fun LongArray.copyOf(): LongArray {
return Arrays.copyOf(this, size())
}
/**
* Returns new array which is a copy of the original array
* Returns new array which is a copy of the original array.
*/
public fun ShortArray.copyOf(): ShortArray {
return Arrays.copyOf(this, size())
}
/**
* Returns new array which is a copy of the original array
* Returns new array which is a copy of the original array.
*/
public fun <T> Array<out T>.copyOf(newSize: Int): Array<T?> {
return Arrays.copyOf(this, newSize) as Array<T?>
}
/**
* Returns new array which is a copy of the original array
* Returns new array which is a copy of the original array.
*/
public fun BooleanArray.copyOf(newSize: Int): BooleanArray {
return Arrays.copyOf(this, newSize)
}
/**
* Returns new array which is a copy of the original array
* Returns new array which is a copy of the original array.
*/
public fun ByteArray.copyOf(newSize: Int): ByteArray {
return Arrays.copyOf(this, newSize)
}
/**
* Returns new array which is a copy of the original array
* Returns new array which is a copy of the original array.
*/
public fun CharArray.copyOf(newSize: Int): CharArray {
return Arrays.copyOf(this, newSize)
}
/**
* Returns new array which is a copy of the original array
* Returns new array which is a copy of the original array.
*/
public fun DoubleArray.copyOf(newSize: Int): DoubleArray {
return Arrays.copyOf(this, newSize)
}
/**
* Returns new array which is a copy of the original array
* Returns new array which is a copy of the original array.
*/
public fun FloatArray.copyOf(newSize: Int): FloatArray {
return Arrays.copyOf(this, newSize)
}
/**
* Returns new array which is a copy of the original array
* Returns new array which is a copy of the original array.
*/
public fun IntArray.copyOf(newSize: Int): IntArray {
return Arrays.copyOf(this, newSize)
}
/**
* Returns new array which is a copy of the original array
* Returns new array which is a copy of the original array.
*/
public fun LongArray.copyOf(newSize: Int): LongArray {
return Arrays.copyOf(this, newSize)
}
/**
* Returns new array which is a copy of the original array
* Returns new array which is a copy of the original array.
*/
public fun ShortArray.copyOf(newSize: Int): ShortArray {
return Arrays.copyOf(this, newSize)
}
/**
* Returns new array which is a copy of range of original array
* Returns new array which is a copy of range of original array.
*/
public fun <T> Array<out T>.copyOfRange(from: Int, to: Int): Array<T> {
return Arrays.copyOfRange(this, from, to)
}
/**
* Returns new array which is a copy of range of original array
* Returns new array which is a copy of range of original array.
*/
public fun BooleanArray.copyOfRange(from: Int, to: Int): BooleanArray {
return Arrays.copyOfRange(this, from, to)
}
/**
* Returns new array which is a copy of range of original array
* Returns new array which is a copy of range of original array.
*/
public fun ByteArray.copyOfRange(from: Int, to: Int): ByteArray {
return Arrays.copyOfRange(this, from, to)
}
/**
* Returns new array which is a copy of range of original array
* Returns new array which is a copy of range of original array.
*/
public fun CharArray.copyOfRange(from: Int, to: Int): CharArray {
return Arrays.copyOfRange(this, from, to)
}
/**
* Returns new array which is a copy of range of original array
* Returns new array which is a copy of range of original array.
*/
public fun DoubleArray.copyOfRange(from: Int, to: Int): DoubleArray {
return Arrays.copyOfRange(this, from, to)
}
/**
* Returns new array which is a copy of range of original array
* Returns new array which is a copy of range of original array.
*/
public fun FloatArray.copyOfRange(from: Int, to: Int): FloatArray {
return Arrays.copyOfRange(this, from, to)
}
/**
* Returns new array which is a copy of range of original array
* Returns new array which is a copy of range of original array.
*/
public fun IntArray.copyOfRange(from: Int, to: Int): IntArray {
return Arrays.copyOfRange(this, from, to)
}
/**
* Returns new array which is a copy of range of original array
* Returns new array which is a copy of range of original array.
*/
public fun LongArray.copyOfRange(from: Int, to: Int): LongArray {
return Arrays.copyOfRange(this, from, to)
}
/**
* Returns new array which is a copy of range of original array
* Returns new array which is a copy of range of original array.
*/
public fun ShortArray.copyOfRange(from: Int, to: Int): ShortArray {
return Arrays.copyOfRange(this, from, to)
}
/**
* Fills original array with the provided value
* Fills original array with the provided value.
*/
public fun <T> Array<out T>.fill(element: T): Array<out T> {
Arrays.fill(this, element)
@@ -391,7 +391,7 @@ public fun <T> Array<out T>.fill(element: T): Array<out T> {
}
/**
* Fills original array with the provided value
* Fills original array with the provided value.
*/
public fun BooleanArray.fill(element: Boolean): BooleanArray {
Arrays.fill(this, element)
@@ -399,7 +399,7 @@ public fun BooleanArray.fill(element: Boolean): BooleanArray {
}
/**
* Fills original array with the provided value
* Fills original array with the provided value.
*/
public fun ByteArray.fill(element: Byte): ByteArray {
Arrays.fill(this, element)
@@ -407,7 +407,7 @@ public fun ByteArray.fill(element: Byte): ByteArray {
}
/**
* Fills original array with the provided value
* Fills original array with the provided value.
*/
public fun CharArray.fill(element: Char): CharArray {
Arrays.fill(this, element)
@@ -415,7 +415,7 @@ public fun CharArray.fill(element: Char): CharArray {
}
/**
* Fills original array with the provided value
* Fills original array with the provided value.
*/
public fun DoubleArray.fill(element: Double): DoubleArray {
Arrays.fill(this, element)
@@ -423,7 +423,7 @@ public fun DoubleArray.fill(element: Double): DoubleArray {
}
/**
* Fills original array with the provided value
* Fills original array with the provided value.
*/
public fun FloatArray.fill(element: Float): FloatArray {
Arrays.fill(this, element)
@@ -431,7 +431,7 @@ public fun FloatArray.fill(element: Float): FloatArray {
}
/**
* Fills original array with the provided value
* Fills original array with the provided value.
*/
public fun IntArray.fill(element: Int): IntArray {
Arrays.fill(this, element)
@@ -439,7 +439,7 @@ public fun IntArray.fill(element: Int): IntArray {
}
/**
* Fills original array with the provided value
* Fills original array with the provided value.
*/
public fun LongArray.fill(element: Long): LongArray {
Arrays.fill(this, element)
@@ -447,7 +447,7 @@ public fun LongArray.fill(element: Long): LongArray {
}
/**
* Fills original array with the provided value
* Fills original array with the provided value.
*/
public fun ShortArray.fill(element: Short): ShortArray {
Arrays.fill(this, element)
@@ -455,21 +455,21 @@ public fun ShortArray.fill(element: Short): ShortArray {
}
/**
* Returns a list containing all elements that are instances of specified type parameter R
* Returns a list containing all elements that are instances of specified type parameter R.
*/
public inline fun <reified R> Array<*>.filterIsInstance(): List<R> {
return filterIsInstanceTo(ArrayList<R>())
}
/**
* Returns a list containing all elements that are instances of specified type parameter R
* Returns a list containing all elements that are instances of specified type parameter R.
*/
public inline fun <reified R> Iterable<*>.filterIsInstance(): List<R> {
return filterIsInstanceTo(ArrayList<R>())
}
/**
* Returns a sequence containing all elements that are instances of specified type parameter R
* Returns a sequence containing all elements that are instances of specified type parameter R.
*/
public inline fun <reified R> Sequence<*>.filterIsInstance(): Sequence<R> {
return filter { it is R } as Sequence<R>
@@ -478,28 +478,28 @@ public inline fun <reified R> Sequence<*>.filterIsInstance(): Sequence<R> {
deprecated("Migrate to using Sequence<T> and respective functions")
/**
* Returns a stream containing all elements that are instances of specified type parameter R
* Returns a stream containing all elements that are instances of specified type parameter R.
*/
public inline fun <reified R> Stream<*>.filterIsInstance(): Stream<R> {
return filter { it is R } as Stream<R>
}
/**
* Returns a list containing all elements that are instances of specified class
* Returns a list containing all elements that are instances of specified class.
*/
public fun <R> Array<*>.filterIsInstance(klass: Class<R>): List<R> {
return filterIsInstanceTo(ArrayList<R>(), klass)
}
/**
* Returns a list containing all elements that are instances of specified class
* Returns a list containing all elements that are instances of specified class.
*/
public fun <R> Iterable<*>.filterIsInstance(klass: Class<R>): List<R> {
return filterIsInstanceTo(ArrayList<R>(), klass)
}
/**
* Returns a sequence containing all elements that are instances of specified class
* Returns a sequence containing all elements that are instances of specified class.
*/
public fun <R> Sequence<*>.filterIsInstance(klass: Class<R>): Sequence<R> {
return filter { klass.isInstance(it) } as Sequence<R>
@@ -508,14 +508,14 @@ public fun <R> Sequence<*>.filterIsInstance(klass: Class<R>): Sequence<R> {
deprecated("Migrate to using Sequence<T> and respective functions")
/**
* Returns a stream containing all elements that are instances of specified class
* Returns a stream containing all elements that are instances of specified class.
*/
public fun <R> Stream<*>.filterIsInstance(klass: Class<R>): Stream<R> {
return filter { klass.isInstance(it) } as Stream<R>
}
/**
* Appends all elements that are instances of specified type parameter R to the given *destination*
* Appends all elements that are instances of specified type parameter R to the given [destination].
*/
public inline fun <reified R, C : MutableCollection<in R>> Array<*>.filterIsInstanceTo(destination: C): C {
for (element in this) if (element is R) destination.add(element)
@@ -523,7 +523,7 @@ public inline fun <reified R, C : MutableCollection<in R>> Array<*>.filterIsInst
}
/**
* Appends all elements that are instances of specified type parameter R to the given *destination*
* Appends all elements that are instances of specified type parameter R to the given [destination].
*/
public inline fun <reified R, C : MutableCollection<in R>> Iterable<*>.filterIsInstanceTo(destination: C): C {
for (element in this) if (element is R) destination.add(element)
@@ -531,7 +531,7 @@ public inline fun <reified R, C : MutableCollection<in R>> Iterable<*>.filterIsI
}
/**
* Appends all elements that are instances of specified type parameter R to the given *destination*
* Appends all elements that are instances of specified type parameter R to the given [destination].
*/
public inline fun <reified R, C : MutableCollection<in R>> Sequence<*>.filterIsInstanceTo(destination: C): C {
for (element in this) if (element is R) destination.add(element)
@@ -541,7 +541,7 @@ public inline fun <reified R, C : MutableCollection<in R>> Sequence<*>.filterIsI
deprecated("Migrate to using Sequence<T> and respective functions")
/**
* Appends all elements that are instances of specified type parameter R to the given *destination*
* Appends all elements that are instances of specified type parameter R to the given [destination].
*/
public inline fun <reified R, C : MutableCollection<in R>> Stream<*>.filterIsInstanceTo(destination: C): C {
for (element in this) if (element is R) destination.add(element)
@@ -549,7 +549,7 @@ public inline fun <reified R, C : MutableCollection<in R>> Stream<*>.filterIsIns
}
/**
* Appends all elements that are instances of specified class to the given *destination*
* Appends all elements that are instances of specified class to the given [destination].
*/
public fun <C : MutableCollection<in R>, R> Array<*>.filterIsInstanceTo(destination: C, klass: Class<R>): C {
for (element in this) if (klass.isInstance(element)) destination.add(element as R)
@@ -557,7 +557,7 @@ public fun <C : MutableCollection<in R>, R> Array<*>.filterIsInstanceTo(destinat
}
/**
* Appends all elements that are instances of specified class to the given *destination*
* Appends all elements that are instances of specified class to the given [destination].
*/
public fun <C : MutableCollection<in R>, R> Iterable<*>.filterIsInstanceTo(destination: C, klass: Class<R>): C {
for (element in this) if (klass.isInstance(element)) destination.add(element as R)
@@ -565,7 +565,7 @@ public fun <C : MutableCollection<in R>, R> Iterable<*>.filterIsInstanceTo(desti
}
/**
* Appends all elements that are instances of specified class to the given *destination*
* Appends all elements that are instances of specified class to the given [destination].
*/
public fun <C : MutableCollection<in R>, R> Sequence<*>.filterIsInstanceTo(destination: C, klass: Class<R>): C {
for (element in this) if (klass.isInstance(element)) destination.add(element as R)
@@ -575,7 +575,7 @@ public fun <C : MutableCollection<in R>, R> Sequence<*>.filterIsInstanceTo(desti
deprecated("Migrate to using Sequence<T> and respective functions")
/**
* Appends all elements that are instances of specified class to the given *destination*
* Appends all elements that are instances of specified class to the given [destination].
*/
public fun <C : MutableCollection<in R>, R> Stream<*>.filterIsInstanceTo(destination: C, klass: Class<R>): C {
for (element in this) if (klass.isInstance(element)) destination.add(element as R)
@@ -583,56 +583,56 @@ public fun <C : MutableCollection<in R>, R> Stream<*>.filterIsInstanceTo(destina
}
/**
* Sorts array or range in array inplace
* Sorts array or range in array inplace.
*/
public fun <T> Array<out T>.sort(fromIndex: Int = 0, toIndex: Int = size()): Unit {
Arrays.sort(this, fromIndex, toIndex)
}
/**
* Sorts array or range in array inplace
* Sorts array or range in array inplace.
*/
public fun ByteArray.sort(fromIndex: Int = 0, toIndex: Int = size()): Unit {
Arrays.sort(this, fromIndex, toIndex)
}
/**
* Sorts array or range in array inplace
* Sorts array or range in array inplace.
*/
public fun CharArray.sort(fromIndex: Int = 0, toIndex: Int = size()): Unit {
Arrays.sort(this, fromIndex, toIndex)
}
/**
* Sorts array or range in array inplace
* Sorts array or range in array inplace.
*/
public fun DoubleArray.sort(fromIndex: Int = 0, toIndex: Int = size()): Unit {
Arrays.sort(this, fromIndex, toIndex)
}
/**
* Sorts array or range in array inplace
* Sorts array or range in array inplace.
*/
public fun FloatArray.sort(fromIndex: Int = 0, toIndex: Int = size()): Unit {
Arrays.sort(this, fromIndex, toIndex)
}
/**
* Sorts array or range in array inplace
* Sorts array or range in array inplace.
*/
public fun IntArray.sort(fromIndex: Int = 0, toIndex: Int = size()): Unit {
Arrays.sort(this, fromIndex, toIndex)
}
/**
* Sorts array or range in array inplace
* Sorts array or range in array inplace.
*/
public fun LongArray.sort(fromIndex: Int = 0, toIndex: Int = size()): Unit {
Arrays.sort(this, fromIndex, toIndex)
}
/**
* Sorts array or range in array inplace
* Sorts array or range in array inplace.
*/
public fun ShortArray.sort(fromIndex: Int = 0, toIndex: Int = size()): Unit {
Arrays.sort(this, fromIndex, toIndex)