Eliminate deprecated language constructions from the generated code.

This commit is contained in:
Ilya Gorbunov
2015-09-10 21:22:15 +03:00
parent 0a32e5a96d
commit 909cbc6817
16 changed files with 298 additions and 293 deletions
+50 -50
View File
@@ -13,7 +13,7 @@ import java.util.Collections // TODO: it's temporary while we have java.util.Col
/**
* Returns 1st *element* from the collection.
*/
suppress("NOTHING_TO_INLINE")
@Suppress("NOTHING_TO_INLINE")
public inline fun <T> Array<out T>.component1(): T {
return get(0)
}
@@ -21,7 +21,7 @@ public inline fun <T> Array<out T>.component1(): T {
/**
* Returns 1st *element* from the collection.
*/
suppress("NOTHING_TO_INLINE")
@Suppress("NOTHING_TO_INLINE")
public inline fun BooleanArray.component1(): Boolean {
return get(0)
}
@@ -29,7 +29,7 @@ public inline fun BooleanArray.component1(): Boolean {
/**
* Returns 1st *element* from the collection.
*/
suppress("NOTHING_TO_INLINE")
@Suppress("NOTHING_TO_INLINE")
public inline fun ByteArray.component1(): Byte {
return get(0)
}
@@ -37,7 +37,7 @@ public inline fun ByteArray.component1(): Byte {
/**
* Returns 1st *element* from the collection.
*/
suppress("NOTHING_TO_INLINE")
@Suppress("NOTHING_TO_INLINE")
public inline fun CharArray.component1(): Char {
return get(0)
}
@@ -45,7 +45,7 @@ public inline fun CharArray.component1(): Char {
/**
* Returns 1st *element* from the collection.
*/
suppress("NOTHING_TO_INLINE")
@Suppress("NOTHING_TO_INLINE")
public inline fun DoubleArray.component1(): Double {
return get(0)
}
@@ -53,7 +53,7 @@ public inline fun DoubleArray.component1(): Double {
/**
* Returns 1st *element* from the collection.
*/
suppress("NOTHING_TO_INLINE")
@Suppress("NOTHING_TO_INLINE")
public inline fun FloatArray.component1(): Float {
return get(0)
}
@@ -61,7 +61,7 @@ public inline fun FloatArray.component1(): Float {
/**
* Returns 1st *element* from the collection.
*/
suppress("NOTHING_TO_INLINE")
@Suppress("NOTHING_TO_INLINE")
public inline fun IntArray.component1(): Int {
return get(0)
}
@@ -69,7 +69,7 @@ public inline fun IntArray.component1(): Int {
/**
* Returns 1st *element* from the collection.
*/
suppress("NOTHING_TO_INLINE")
@Suppress("NOTHING_TO_INLINE")
public inline fun LongArray.component1(): Long {
return get(0)
}
@@ -77,7 +77,7 @@ public inline fun LongArray.component1(): Long {
/**
* Returns 1st *element* from the collection.
*/
suppress("NOTHING_TO_INLINE")
@Suppress("NOTHING_TO_INLINE")
public inline fun ShortArray.component1(): Short {
return get(0)
}
@@ -85,7 +85,7 @@ public inline fun ShortArray.component1(): Short {
/**
* Returns 1st *element* from the collection.
*/
suppress("NOTHING_TO_INLINE")
@Suppress("NOTHING_TO_INLINE")
public inline fun <T> List<T>.component1(): T {
return get(0)
}
@@ -93,7 +93,7 @@ public inline fun <T> List<T>.component1(): T {
/**
* Returns 2nd *element* from the collection.
*/
suppress("NOTHING_TO_INLINE")
@Suppress("NOTHING_TO_INLINE")
public inline fun <T> Array<out T>.component2(): T {
return get(1)
}
@@ -101,7 +101,7 @@ public inline fun <T> Array<out T>.component2(): T {
/**
* Returns 2nd *element* from the collection.
*/
suppress("NOTHING_TO_INLINE")
@Suppress("NOTHING_TO_INLINE")
public inline fun BooleanArray.component2(): Boolean {
return get(1)
}
@@ -109,7 +109,7 @@ public inline fun BooleanArray.component2(): Boolean {
/**
* Returns 2nd *element* from the collection.
*/
suppress("NOTHING_TO_INLINE")
@Suppress("NOTHING_TO_INLINE")
public inline fun ByteArray.component2(): Byte {
return get(1)
}
@@ -117,7 +117,7 @@ public inline fun ByteArray.component2(): Byte {
/**
* Returns 2nd *element* from the collection.
*/
suppress("NOTHING_TO_INLINE")
@Suppress("NOTHING_TO_INLINE")
public inline fun CharArray.component2(): Char {
return get(1)
}
@@ -125,7 +125,7 @@ public inline fun CharArray.component2(): Char {
/**
* Returns 2nd *element* from the collection.
*/
suppress("NOTHING_TO_INLINE")
@Suppress("NOTHING_TO_INLINE")
public inline fun DoubleArray.component2(): Double {
return get(1)
}
@@ -133,7 +133,7 @@ public inline fun DoubleArray.component2(): Double {
/**
* Returns 2nd *element* from the collection.
*/
suppress("NOTHING_TO_INLINE")
@Suppress("NOTHING_TO_INLINE")
public inline fun FloatArray.component2(): Float {
return get(1)
}
@@ -141,7 +141,7 @@ public inline fun FloatArray.component2(): Float {
/**
* Returns 2nd *element* from the collection.
*/
suppress("NOTHING_TO_INLINE")
@Suppress("NOTHING_TO_INLINE")
public inline fun IntArray.component2(): Int {
return get(1)
}
@@ -149,7 +149,7 @@ public inline fun IntArray.component2(): Int {
/**
* Returns 2nd *element* from the collection.
*/
suppress("NOTHING_TO_INLINE")
@Suppress("NOTHING_TO_INLINE")
public inline fun LongArray.component2(): Long {
return get(1)
}
@@ -157,7 +157,7 @@ public inline fun LongArray.component2(): Long {
/**
* Returns 2nd *element* from the collection.
*/
suppress("NOTHING_TO_INLINE")
@Suppress("NOTHING_TO_INLINE")
public inline fun ShortArray.component2(): Short {
return get(1)
}
@@ -165,7 +165,7 @@ public inline fun ShortArray.component2(): Short {
/**
* Returns 2nd *element* from the collection.
*/
suppress("NOTHING_TO_INLINE")
@Suppress("NOTHING_TO_INLINE")
public inline fun <T> List<T>.component2(): T {
return get(1)
}
@@ -173,7 +173,7 @@ public inline fun <T> List<T>.component2(): T {
/**
* Returns 3rd *element* from the collection.
*/
suppress("NOTHING_TO_INLINE")
@Suppress("NOTHING_TO_INLINE")
public inline fun <T> Array<out T>.component3(): T {
return get(2)
}
@@ -181,7 +181,7 @@ public inline fun <T> Array<out T>.component3(): T {
/**
* Returns 3rd *element* from the collection.
*/
suppress("NOTHING_TO_INLINE")
@Suppress("NOTHING_TO_INLINE")
public inline fun BooleanArray.component3(): Boolean {
return get(2)
}
@@ -189,7 +189,7 @@ public inline fun BooleanArray.component3(): Boolean {
/**
* Returns 3rd *element* from the collection.
*/
suppress("NOTHING_TO_INLINE")
@Suppress("NOTHING_TO_INLINE")
public inline fun ByteArray.component3(): Byte {
return get(2)
}
@@ -197,7 +197,7 @@ public inline fun ByteArray.component3(): Byte {
/**
* Returns 3rd *element* from the collection.
*/
suppress("NOTHING_TO_INLINE")
@Suppress("NOTHING_TO_INLINE")
public inline fun CharArray.component3(): Char {
return get(2)
}
@@ -205,7 +205,7 @@ public inline fun CharArray.component3(): Char {
/**
* Returns 3rd *element* from the collection.
*/
suppress("NOTHING_TO_INLINE")
@Suppress("NOTHING_TO_INLINE")
public inline fun DoubleArray.component3(): Double {
return get(2)
}
@@ -213,7 +213,7 @@ public inline fun DoubleArray.component3(): Double {
/**
* Returns 3rd *element* from the collection.
*/
suppress("NOTHING_TO_INLINE")
@Suppress("NOTHING_TO_INLINE")
public inline fun FloatArray.component3(): Float {
return get(2)
}
@@ -221,7 +221,7 @@ public inline fun FloatArray.component3(): Float {
/**
* Returns 3rd *element* from the collection.
*/
suppress("NOTHING_TO_INLINE")
@Suppress("NOTHING_TO_INLINE")
public inline fun IntArray.component3(): Int {
return get(2)
}
@@ -229,7 +229,7 @@ public inline fun IntArray.component3(): Int {
/**
* Returns 3rd *element* from the collection.
*/
suppress("NOTHING_TO_INLINE")
@Suppress("NOTHING_TO_INLINE")
public inline fun LongArray.component3(): Long {
return get(2)
}
@@ -237,7 +237,7 @@ public inline fun LongArray.component3(): Long {
/**
* Returns 3rd *element* from the collection.
*/
suppress("NOTHING_TO_INLINE")
@Suppress("NOTHING_TO_INLINE")
public inline fun ShortArray.component3(): Short {
return get(2)
}
@@ -245,7 +245,7 @@ public inline fun ShortArray.component3(): Short {
/**
* Returns 3rd *element* from the collection.
*/
suppress("NOTHING_TO_INLINE")
@Suppress("NOTHING_TO_INLINE")
public inline fun <T> List<T>.component3(): T {
return get(2)
}
@@ -253,7 +253,7 @@ public inline fun <T> List<T>.component3(): T {
/**
* Returns 4th *element* from the collection.
*/
suppress("NOTHING_TO_INLINE")
@Suppress("NOTHING_TO_INLINE")
public inline fun <T> Array<out T>.component4(): T {
return get(3)
}
@@ -261,7 +261,7 @@ public inline fun <T> Array<out T>.component4(): T {
/**
* Returns 4th *element* from the collection.
*/
suppress("NOTHING_TO_INLINE")
@Suppress("NOTHING_TO_INLINE")
public inline fun BooleanArray.component4(): Boolean {
return get(3)
}
@@ -269,7 +269,7 @@ public inline fun BooleanArray.component4(): Boolean {
/**
* Returns 4th *element* from the collection.
*/
suppress("NOTHING_TO_INLINE")
@Suppress("NOTHING_TO_INLINE")
public inline fun ByteArray.component4(): Byte {
return get(3)
}
@@ -277,7 +277,7 @@ public inline fun ByteArray.component4(): Byte {
/**
* Returns 4th *element* from the collection.
*/
suppress("NOTHING_TO_INLINE")
@Suppress("NOTHING_TO_INLINE")
public inline fun CharArray.component4(): Char {
return get(3)
}
@@ -285,7 +285,7 @@ public inline fun CharArray.component4(): Char {
/**
* Returns 4th *element* from the collection.
*/
suppress("NOTHING_TO_INLINE")
@Suppress("NOTHING_TO_INLINE")
public inline fun DoubleArray.component4(): Double {
return get(3)
}
@@ -293,7 +293,7 @@ public inline fun DoubleArray.component4(): Double {
/**
* Returns 4th *element* from the collection.
*/
suppress("NOTHING_TO_INLINE")
@Suppress("NOTHING_TO_INLINE")
public inline fun FloatArray.component4(): Float {
return get(3)
}
@@ -301,7 +301,7 @@ public inline fun FloatArray.component4(): Float {
/**
* Returns 4th *element* from the collection.
*/
suppress("NOTHING_TO_INLINE")
@Suppress("NOTHING_TO_INLINE")
public inline fun IntArray.component4(): Int {
return get(3)
}
@@ -309,7 +309,7 @@ public inline fun IntArray.component4(): Int {
/**
* Returns 4th *element* from the collection.
*/
suppress("NOTHING_TO_INLINE")
@Suppress("NOTHING_TO_INLINE")
public inline fun LongArray.component4(): Long {
return get(3)
}
@@ -317,7 +317,7 @@ public inline fun LongArray.component4(): Long {
/**
* Returns 4th *element* from the collection.
*/
suppress("NOTHING_TO_INLINE")
@Suppress("NOTHING_TO_INLINE")
public inline fun ShortArray.component4(): Short {
return get(3)
}
@@ -325,7 +325,7 @@ public inline fun ShortArray.component4(): Short {
/**
* Returns 4th *element* from the collection.
*/
suppress("NOTHING_TO_INLINE")
@Suppress("NOTHING_TO_INLINE")
public inline fun <T> List<T>.component4(): T {
return get(3)
}
@@ -333,7 +333,7 @@ public inline fun <T> List<T>.component4(): T {
/**
* Returns 5th *element* from the collection.
*/
suppress("NOTHING_TO_INLINE")
@Suppress("NOTHING_TO_INLINE")
public inline fun <T> Array<out T>.component5(): T {
return get(4)
}
@@ -341,7 +341,7 @@ public inline fun <T> Array<out T>.component5(): T {
/**
* Returns 5th *element* from the collection.
*/
suppress("NOTHING_TO_INLINE")
@Suppress("NOTHING_TO_INLINE")
public inline fun BooleanArray.component5(): Boolean {
return get(4)
}
@@ -349,7 +349,7 @@ public inline fun BooleanArray.component5(): Boolean {
/**
* Returns 5th *element* from the collection.
*/
suppress("NOTHING_TO_INLINE")
@Suppress("NOTHING_TO_INLINE")
public inline fun ByteArray.component5(): Byte {
return get(4)
}
@@ -357,7 +357,7 @@ public inline fun ByteArray.component5(): Byte {
/**
* Returns 5th *element* from the collection.
*/
suppress("NOTHING_TO_INLINE")
@Suppress("NOTHING_TO_INLINE")
public inline fun CharArray.component5(): Char {
return get(4)
}
@@ -365,7 +365,7 @@ public inline fun CharArray.component5(): Char {
/**
* Returns 5th *element* from the collection.
*/
suppress("NOTHING_TO_INLINE")
@Suppress("NOTHING_TO_INLINE")
public inline fun DoubleArray.component5(): Double {
return get(4)
}
@@ -373,7 +373,7 @@ public inline fun DoubleArray.component5(): Double {
/**
* Returns 5th *element* from the collection.
*/
suppress("NOTHING_TO_INLINE")
@Suppress("NOTHING_TO_INLINE")
public inline fun FloatArray.component5(): Float {
return get(4)
}
@@ -381,7 +381,7 @@ public inline fun FloatArray.component5(): Float {
/**
* Returns 5th *element* from the collection.
*/
suppress("NOTHING_TO_INLINE")
@Suppress("NOTHING_TO_INLINE")
public inline fun IntArray.component5(): Int {
return get(4)
}
@@ -389,7 +389,7 @@ public inline fun IntArray.component5(): Int {
/**
* Returns 5th *element* from the collection.
*/
suppress("NOTHING_TO_INLINE")
@Suppress("NOTHING_TO_INLINE")
public inline fun LongArray.component5(): Long {
return get(4)
}
@@ -397,7 +397,7 @@ public inline fun LongArray.component5(): Long {
/**
* Returns 5th *element* from the collection.
*/
suppress("NOTHING_TO_INLINE")
@Suppress("NOTHING_TO_INLINE")
public inline fun ShortArray.component5(): Short {
return get(4)
}
@@ -405,7 +405,7 @@ public inline fun ShortArray.component5(): Short {
/**
* Returns 5th *element* from the collection.
*/
suppress("NOTHING_TO_INLINE")
@Suppress("NOTHING_TO_INLINE")
public inline fun <T> List<T>.component5(): T {
return get(4)
}
+12 -12
View File
@@ -1067,7 +1067,7 @@ public fun String.withIndex(): Iterable<IndexedValue<Char>> {
/**
* Returns a list containing pairs of each element of the original collection and their index.
*/
deprecated("Use withIndex() instead.")
@Deprecated("Use withIndex() instead.")
public fun <T> Array<out T>.withIndices(): List<Pair<Int, T>> {
var index = 0
return mapTo(ArrayList<Pair<Int, T>>(), { index++ to it })
@@ -1076,7 +1076,7 @@ public fun <T> Array<out T>.withIndices(): List<Pair<Int, T>> {
/**
* Returns a list containing pairs of each element of the original collection and their index.
*/
deprecated("Use withIndex() instead.")
@Deprecated("Use withIndex() instead.")
public fun BooleanArray.withIndices(): List<Pair<Int, Boolean>> {
var index = 0
return mapTo(ArrayList<Pair<Int, Boolean>>(), { index++ to it })
@@ -1085,7 +1085,7 @@ public fun BooleanArray.withIndices(): List<Pair<Int, Boolean>> {
/**
* Returns a list containing pairs of each element of the original collection and their index.
*/
deprecated("Use withIndex() instead.")
@Deprecated("Use withIndex() instead.")
public fun ByteArray.withIndices(): List<Pair<Int, Byte>> {
var index = 0
return mapTo(ArrayList<Pair<Int, Byte>>(), { index++ to it })
@@ -1094,7 +1094,7 @@ public fun ByteArray.withIndices(): List<Pair<Int, Byte>> {
/**
* Returns a list containing pairs of each element of the original collection and their index.
*/
deprecated("Use withIndex() instead.")
@Deprecated("Use withIndex() instead.")
public fun CharArray.withIndices(): List<Pair<Int, Char>> {
var index = 0
return mapTo(ArrayList<Pair<Int, Char>>(), { index++ to it })
@@ -1103,7 +1103,7 @@ public fun CharArray.withIndices(): List<Pair<Int, Char>> {
/**
* Returns a list containing pairs of each element of the original collection and their index.
*/
deprecated("Use withIndex() instead.")
@Deprecated("Use withIndex() instead.")
public fun DoubleArray.withIndices(): List<Pair<Int, Double>> {
var index = 0
return mapTo(ArrayList<Pair<Int, Double>>(), { index++ to it })
@@ -1112,7 +1112,7 @@ public fun DoubleArray.withIndices(): List<Pair<Int, Double>> {
/**
* Returns a list containing pairs of each element of the original collection and their index.
*/
deprecated("Use withIndex() instead.")
@Deprecated("Use withIndex() instead.")
public fun FloatArray.withIndices(): List<Pair<Int, Float>> {
var index = 0
return mapTo(ArrayList<Pair<Int, Float>>(), { index++ to it })
@@ -1121,7 +1121,7 @@ public fun FloatArray.withIndices(): List<Pair<Int, Float>> {
/**
* Returns a list containing pairs of each element of the original collection and their index.
*/
deprecated("Use withIndex() instead.")
@Deprecated("Use withIndex() instead.")
public fun IntArray.withIndices(): List<Pair<Int, Int>> {
var index = 0
return mapTo(ArrayList<Pair<Int, Int>>(), { index++ to it })
@@ -1130,7 +1130,7 @@ public fun IntArray.withIndices(): List<Pair<Int, Int>> {
/**
* Returns a list containing pairs of each element of the original collection and their index.
*/
deprecated("Use withIndex() instead.")
@Deprecated("Use withIndex() instead.")
public fun LongArray.withIndices(): List<Pair<Int, Long>> {
var index = 0
return mapTo(ArrayList<Pair<Int, Long>>(), { index++ to it })
@@ -1139,7 +1139,7 @@ public fun LongArray.withIndices(): List<Pair<Int, Long>> {
/**
* Returns a list containing pairs of each element of the original collection and their index.
*/
deprecated("Use withIndex() instead.")
@Deprecated("Use withIndex() instead.")
public fun ShortArray.withIndices(): List<Pair<Int, Short>> {
var index = 0
return mapTo(ArrayList<Pair<Int, Short>>(), { index++ to it })
@@ -1148,7 +1148,7 @@ public fun ShortArray.withIndices(): List<Pair<Int, Short>> {
/**
* Returns a list containing pairs of each element of the original collection and their index.
*/
deprecated("Use withIndex() instead.")
@Deprecated("Use withIndex() instead.")
public fun <T> Iterable<T>.withIndices(): List<Pair<Int, T>> {
var index = 0
return mapTo(ArrayList<Pair<Int, T>>(), { index++ to it })
@@ -1157,7 +1157,7 @@ public fun <T> Iterable<T>.withIndices(): List<Pair<Int, T>> {
/**
* Returns a sequence containing pairs of each element of the original collection and their index.
*/
deprecated("Use withIndex() instead.")
@Deprecated("Use withIndex() instead.")
public fun <T> Sequence<T>.withIndices(): Sequence<Pair<Int, T>> {
var index = 0
return TransformingSequence(this, { index++ to it })
@@ -1166,7 +1166,7 @@ public fun <T> Sequence<T>.withIndices(): Sequence<Pair<Int, T>> {
/**
* Returns a list containing pairs of each element of the original collection and their index.
*/
deprecated("Use withIndex() instead.")
@Deprecated("Use withIndex() instead.")
public fun String.withIndices(): List<Pair<Int, Char>> {
var index = 0
return mapTo(ArrayList<Pair<Int, Char>>(), { index++ to it })
+36 -36
View File
@@ -13,7 +13,7 @@ import java.util.Collections // TODO: it's temporary while we have java.util.Col
/**
* Returns an average value of elements in the collection.
*/
platformName("averageOfByte")
@kotlin.jvm.JvmName("averageOfByte")
public fun Array<out Byte>.average(): Double {
val iterator = iterator()
var sum: Double = 0.0
@@ -28,7 +28,7 @@ public fun Array<out Byte>.average(): Double {
/**
* Returns an average value of elements in the collection.
*/
platformName("averageOfDouble")
@kotlin.jvm.JvmName("averageOfDouble")
public fun Array<out Double>.average(): Double {
val iterator = iterator()
var sum: Double = 0.0
@@ -43,7 +43,7 @@ public fun Array<out Double>.average(): Double {
/**
* Returns an average value of elements in the collection.
*/
platformName("averageOfFloat")
@kotlin.jvm.JvmName("averageOfFloat")
public fun Array<out Float>.average(): Double {
val iterator = iterator()
var sum: Double = 0.0
@@ -58,7 +58,7 @@ public fun Array<out Float>.average(): Double {
/**
* Returns an average value of elements in the collection.
*/
platformName("averageOfInt")
@kotlin.jvm.JvmName("averageOfInt")
public fun Array<out Int>.average(): Double {
val iterator = iterator()
var sum: Double = 0.0
@@ -73,7 +73,7 @@ public fun Array<out Int>.average(): Double {
/**
* Returns an average value of elements in the collection.
*/
platformName("averageOfLong")
@kotlin.jvm.JvmName("averageOfLong")
public fun Array<out Long>.average(): Double {
val iterator = iterator()
var sum: Double = 0.0
@@ -88,7 +88,7 @@ public fun Array<out Long>.average(): Double {
/**
* Returns an average value of elements in the collection.
*/
platformName("averageOfShort")
@kotlin.jvm.JvmName("averageOfShort")
public fun Array<out Short>.average(): Double {
val iterator = iterator()
var sum: Double = 0.0
@@ -187,7 +187,7 @@ public fun ShortArray.average(): Double {
/**
* Returns an average value of elements in the collection.
*/
platformName("averageOfByte")
@kotlin.jvm.JvmName("averageOfByte")
public fun Iterable<Byte>.average(): Double {
val iterator = iterator()
var sum: Double = 0.0
@@ -202,7 +202,7 @@ public fun Iterable<Byte>.average(): Double {
/**
* Returns an average value of elements in the collection.
*/
platformName("averageOfDouble")
@kotlin.jvm.JvmName("averageOfDouble")
public fun Iterable<Double>.average(): Double {
val iterator = iterator()
var sum: Double = 0.0
@@ -217,7 +217,7 @@ public fun Iterable<Double>.average(): Double {
/**
* Returns an average value of elements in the collection.
*/
platformName("averageOfFloat")
@kotlin.jvm.JvmName("averageOfFloat")
public fun Iterable<Float>.average(): Double {
val iterator = iterator()
var sum: Double = 0.0
@@ -232,7 +232,7 @@ public fun Iterable<Float>.average(): Double {
/**
* Returns an average value of elements in the collection.
*/
platformName("averageOfInt")
@kotlin.jvm.JvmName("averageOfInt")
public fun Iterable<Int>.average(): Double {
val iterator = iterator()
var sum: Double = 0.0
@@ -247,7 +247,7 @@ public fun Iterable<Int>.average(): Double {
/**
* Returns an average value of elements in the collection.
*/
platformName("averageOfLong")
@kotlin.jvm.JvmName("averageOfLong")
public fun Iterable<Long>.average(): Double {
val iterator = iterator()
var sum: Double = 0.0
@@ -262,7 +262,7 @@ public fun Iterable<Long>.average(): Double {
/**
* Returns an average value of elements in the collection.
*/
platformName("averageOfShort")
@kotlin.jvm.JvmName("averageOfShort")
public fun Iterable<Short>.average(): Double {
val iterator = iterator()
var sum: Double = 0.0
@@ -277,7 +277,7 @@ public fun Iterable<Short>.average(): Double {
/**
* Returns an average value of elements in the collection.
*/
platformName("averageOfByte")
@kotlin.jvm.JvmName("averageOfByte")
public fun Sequence<Byte>.average(): Double {
val iterator = iterator()
var sum: Double = 0.0
@@ -292,7 +292,7 @@ public fun Sequence<Byte>.average(): Double {
/**
* Returns an average value of elements in the collection.
*/
platformName("averageOfDouble")
@kotlin.jvm.JvmName("averageOfDouble")
public fun Sequence<Double>.average(): Double {
val iterator = iterator()
var sum: Double = 0.0
@@ -307,7 +307,7 @@ public fun Sequence<Double>.average(): Double {
/**
* Returns an average value of elements in the collection.
*/
platformName("averageOfFloat")
@kotlin.jvm.JvmName("averageOfFloat")
public fun Sequence<Float>.average(): Double {
val iterator = iterator()
var sum: Double = 0.0
@@ -322,7 +322,7 @@ public fun Sequence<Float>.average(): Double {
/**
* Returns an average value of elements in the collection.
*/
platformName("averageOfInt")
@kotlin.jvm.JvmName("averageOfInt")
public fun Sequence<Int>.average(): Double {
val iterator = iterator()
var sum: Double = 0.0
@@ -337,7 +337,7 @@ public fun Sequence<Int>.average(): Double {
/**
* Returns an average value of elements in the collection.
*/
platformName("averageOfLong")
@kotlin.jvm.JvmName("averageOfLong")
public fun Sequence<Long>.average(): Double {
val iterator = iterator()
var sum: Double = 0.0
@@ -352,7 +352,7 @@ public fun Sequence<Long>.average(): Double {
/**
* Returns an average value of elements in the collection.
*/
platformName("averageOfShort")
@kotlin.jvm.JvmName("averageOfShort")
public fun Sequence<Short>.average(): Double {
val iterator = iterator()
var sum: Double = 0.0
@@ -367,7 +367,7 @@ public fun Sequence<Short>.average(): Double {
/**
* Returns the sum of all elements in the collection.
*/
platformName("sumOfByte")
@kotlin.jvm.JvmName("sumOfByte")
public fun Array<out Byte>.sum(): Int {
val iterator = iterator()
var sum: Int = 0
@@ -380,7 +380,7 @@ public fun Array<out Byte>.sum(): Int {
/**
* Returns the sum of all elements in the collection.
*/
platformName("sumOfDouble")
@kotlin.jvm.JvmName("sumOfDouble")
public fun Array<out Double>.sum(): Double {
val iterator = iterator()
var sum: Double = 0.0
@@ -393,7 +393,7 @@ public fun Array<out Double>.sum(): Double {
/**
* Returns the sum of all elements in the collection.
*/
platformName("sumOfFloat")
@kotlin.jvm.JvmName("sumOfFloat")
public fun Array<out Float>.sum(): Float {
val iterator = iterator()
var sum: Float = 0.0f
@@ -406,7 +406,7 @@ public fun Array<out Float>.sum(): Float {
/**
* Returns the sum of all elements in the collection.
*/
platformName("sumOfInt")
@kotlin.jvm.JvmName("sumOfInt")
public fun Array<out Int>.sum(): Int {
val iterator = iterator()
var sum: Int = 0
@@ -419,7 +419,7 @@ public fun Array<out Int>.sum(): Int {
/**
* Returns the sum of all elements in the collection.
*/
platformName("sumOfLong")
@kotlin.jvm.JvmName("sumOfLong")
public fun Array<out Long>.sum(): Long {
val iterator = iterator()
var sum: Long = 0L
@@ -432,7 +432,7 @@ public fun Array<out Long>.sum(): Long {
/**
* Returns the sum of all elements in the collection.
*/
platformName("sumOfShort")
@kotlin.jvm.JvmName("sumOfShort")
public fun Array<out Short>.sum(): Int {
val iterator = iterator()
var sum: Int = 0
@@ -517,7 +517,7 @@ public fun ShortArray.sum(): Int {
/**
* Returns the sum of all elements in the collection.
*/
platformName("sumOfByte")
@kotlin.jvm.JvmName("sumOfByte")
public fun Iterable<Byte>.sum(): Int {
val iterator = iterator()
var sum: Int = 0
@@ -530,7 +530,7 @@ public fun Iterable<Byte>.sum(): Int {
/**
* Returns the sum of all elements in the collection.
*/
platformName("sumOfDouble")
@kotlin.jvm.JvmName("sumOfDouble")
public fun Iterable<Double>.sum(): Double {
val iterator = iterator()
var sum: Double = 0.0
@@ -543,7 +543,7 @@ public fun Iterable<Double>.sum(): Double {
/**
* Returns the sum of all elements in the collection.
*/
platformName("sumOfFloat")
@kotlin.jvm.JvmName("sumOfFloat")
public fun Iterable<Float>.sum(): Float {
val iterator = iterator()
var sum: Float = 0.0f
@@ -556,7 +556,7 @@ public fun Iterable<Float>.sum(): Float {
/**
* Returns the sum of all elements in the collection.
*/
platformName("sumOfInt")
@kotlin.jvm.JvmName("sumOfInt")
public fun Iterable<Int>.sum(): Int {
val iterator = iterator()
var sum: Int = 0
@@ -569,7 +569,7 @@ public fun Iterable<Int>.sum(): Int {
/**
* Returns the sum of all elements in the collection.
*/
platformName("sumOfLong")
@kotlin.jvm.JvmName("sumOfLong")
public fun Iterable<Long>.sum(): Long {
val iterator = iterator()
var sum: Long = 0L
@@ -582,7 +582,7 @@ public fun Iterable<Long>.sum(): Long {
/**
* Returns the sum of all elements in the collection.
*/
platformName("sumOfShort")
@kotlin.jvm.JvmName("sumOfShort")
public fun Iterable<Short>.sum(): Int {
val iterator = iterator()
var sum: Int = 0
@@ -595,7 +595,7 @@ public fun Iterable<Short>.sum(): Int {
/**
* Returns the sum of all elements in the collection.
*/
platformName("sumOfByte")
@kotlin.jvm.JvmName("sumOfByte")
public fun Sequence<Byte>.sum(): Int {
val iterator = iterator()
var sum: Int = 0
@@ -608,7 +608,7 @@ public fun Sequence<Byte>.sum(): Int {
/**
* Returns the sum of all elements in the collection.
*/
platformName("sumOfDouble")
@kotlin.jvm.JvmName("sumOfDouble")
public fun Sequence<Double>.sum(): Double {
val iterator = iterator()
var sum: Double = 0.0
@@ -621,7 +621,7 @@ public fun Sequence<Double>.sum(): Double {
/**
* Returns the sum of all elements in the collection.
*/
platformName("sumOfFloat")
@kotlin.jvm.JvmName("sumOfFloat")
public fun Sequence<Float>.sum(): Float {
val iterator = iterator()
var sum: Float = 0.0f
@@ -634,7 +634,7 @@ public fun Sequence<Float>.sum(): Float {
/**
* Returns the sum of all elements in the collection.
*/
platformName("sumOfInt")
@kotlin.jvm.JvmName("sumOfInt")
public fun Sequence<Int>.sum(): Int {
val iterator = iterator()
var sum: Int = 0
@@ -647,7 +647,7 @@ public fun Sequence<Int>.sum(): Int {
/**
* Returns the sum of all elements in the collection.
*/
platformName("sumOfLong")
@kotlin.jvm.JvmName("sumOfLong")
public fun Sequence<Long>.sum(): Long {
val iterator = iterator()
var sum: Long = 0L
@@ -660,7 +660,7 @@ public fun Sequence<Long>.sum(): Long {
/**
* Returns the sum of all elements in the collection.
*/
platformName("sumOfShort")
@kotlin.jvm.JvmName("sumOfShort")
public fun Sequence<Short>.sum(): Int {
val iterator = iterator()
var sum: Int = 0
+67 -67
View File
@@ -13,7 +13,7 @@ import java.util.Collections // TODO: it's temporary while we have java.util.Col
/**
* Returns a list with elements in reversed order.
*/
deprecated("reverse will change its behavior soon. Use reversed() instead.", ReplaceWith("reversed()"))
@Deprecated("reverse will change its behavior soon. Use reversed() instead.", ReplaceWith("reversed()"))
public fun <T> Array<out T>.reverse(): List<T> {
return reversed()
}
@@ -21,7 +21,7 @@ public fun <T> Array<out T>.reverse(): List<T> {
/**
* Returns a list with elements in reversed order.
*/
deprecated("reverse will change its behavior soon. Use reversed() instead.", ReplaceWith("reversed()"))
@Deprecated("reverse will change its behavior soon. Use reversed() instead.", ReplaceWith("reversed()"))
public fun BooleanArray.reverse(): List<Boolean> {
return reversed()
}
@@ -29,7 +29,7 @@ public fun BooleanArray.reverse(): List<Boolean> {
/**
* Returns a list with elements in reversed order.
*/
deprecated("reverse will change its behavior soon. Use reversed() instead.", ReplaceWith("reversed()"))
@Deprecated("reverse will change its behavior soon. Use reversed() instead.", ReplaceWith("reversed()"))
public fun ByteArray.reverse(): List<Byte> {
return reversed()
}
@@ -37,7 +37,7 @@ public fun ByteArray.reverse(): List<Byte> {
/**
* Returns a list with elements in reversed order.
*/
deprecated("reverse will change its behavior soon. Use reversed() instead.", ReplaceWith("reversed()"))
@Deprecated("reverse will change its behavior soon. Use reversed() instead.", ReplaceWith("reversed()"))
public fun CharArray.reverse(): List<Char> {
return reversed()
}
@@ -45,7 +45,7 @@ public fun CharArray.reverse(): List<Char> {
/**
* Returns a list with elements in reversed order.
*/
deprecated("reverse will change its behavior soon. Use reversed() instead.", ReplaceWith("reversed()"))
@Deprecated("reverse will change its behavior soon. Use reversed() instead.", ReplaceWith("reversed()"))
public fun DoubleArray.reverse(): List<Double> {
return reversed()
}
@@ -53,7 +53,7 @@ public fun DoubleArray.reverse(): List<Double> {
/**
* Returns a list with elements in reversed order.
*/
deprecated("reverse will change its behavior soon. Use reversed() instead.", ReplaceWith("reversed()"))
@Deprecated("reverse will change its behavior soon. Use reversed() instead.", ReplaceWith("reversed()"))
public fun FloatArray.reverse(): List<Float> {
return reversed()
}
@@ -61,7 +61,7 @@ public fun FloatArray.reverse(): List<Float> {
/**
* Returns a list with elements in reversed order.
*/
deprecated("reverse will change its behavior soon. Use reversed() instead.", ReplaceWith("reversed()"))
@Deprecated("reverse will change its behavior soon. Use reversed() instead.", ReplaceWith("reversed()"))
public fun IntArray.reverse(): List<Int> {
return reversed()
}
@@ -69,7 +69,7 @@ public fun IntArray.reverse(): List<Int> {
/**
* Returns a list with elements in reversed order.
*/
deprecated("reverse will change its behavior soon. Use reversed() instead.", ReplaceWith("reversed()"))
@Deprecated("reverse will change its behavior soon. Use reversed() instead.", ReplaceWith("reversed()"))
public fun LongArray.reverse(): List<Long> {
return reversed()
}
@@ -77,7 +77,7 @@ public fun LongArray.reverse(): List<Long> {
/**
* Returns a list with elements in reversed order.
*/
deprecated("reverse will change its behavior soon. Use reversed() instead.", ReplaceWith("reversed()"))
@Deprecated("reverse will change its behavior soon. Use reversed() instead.", ReplaceWith("reversed()"))
public fun ShortArray.reverse(): List<Short> {
return reversed()
}
@@ -85,7 +85,7 @@ public fun ShortArray.reverse(): List<Short> {
/**
* Returns a list with elements in reversed order.
*/
deprecated("reverse will change its behavior soon. Use reversed() instead.", ReplaceWith("reversed()"))
@Deprecated("reverse will change its behavior soon. Use reversed() instead.", ReplaceWith("reversed()"))
public fun <T> Iterable<T>.reverse(): List<T> {
return reversed()
}
@@ -93,7 +93,7 @@ public fun <T> Iterable<T>.reverse(): List<T> {
/**
* Returns a list with elements in reversed order.
*/
deprecated("reverse will change its behavior soon. Use reversed() instead.", ReplaceWith("reversed()"))
@Deprecated("reverse will change its behavior soon. Use reversed() instead.", ReplaceWith("reversed()"))
public fun String.reverse(): String {
return reversed()
}
@@ -316,7 +316,7 @@ public fun ShortArray.reversedArray(): ShortArray {
/**
* Returns a sorted list of all elements.
*/
deprecated("This method may change its behavior soon. Use sorted() instead.", ReplaceWith("sorted()"))
@Deprecated("This method may change its behavior soon. Use sorted() instead.", ReplaceWith("sorted()"))
public fun <T : Comparable<T>> Iterable<T>.sort(): List<T> {
val sortedList = toArrayList()
java.util.Collections.sort(sortedList)
@@ -326,7 +326,7 @@ public fun <T : Comparable<T>> Iterable<T>.sort(): List<T> {
/**
* Returns a list of all elements, sorted by the specified [comparator].
*/
deprecated("This method may change its behavior soon. Use sortedWith() instead.", ReplaceWith("sortedWith(comparator)"))
@Deprecated("This method may change its behavior soon. Use sortedWith() instead.", ReplaceWith("sortedWith(comparator)"))
public fun <T> Array<out T>.sortBy(comparator: Comparator<in T>): List<T> {
val sortedList = toArrayList()
java.util.Collections.sort(sortedList, comparator)
@@ -336,7 +336,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].
*/
deprecated("This method may change its behavior soon. Use sortedWith() instead.", ReplaceWith("sortedWith(comparator)"))
@Deprecated("This method may change its behavior soon. Use sortedWith() instead.", ReplaceWith("sortedWith(comparator)"))
public fun <T> Iterable<T>.sortBy(comparator: Comparator<in T>): List<T> {
val sortedList = toArrayList()
java.util.Collections.sort(sortedList, comparator)
@@ -346,8 +346,8 @@ 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.
*/
deprecated("This method may change its behavior soon. Use sortedBy() instead.", ReplaceWith("sortedBy(order)"))
public inline fun <T, R : Comparable<R>> Array<out T>.sortBy(inlineOptions(InlineOption.ONLY_LOCAL_RETURN) order: (T) -> R): List<T> {
@Deprecated("This method may change its behavior soon. Use sortedBy() instead.", ReplaceWith("sortedBy(order)"))
public inline fun <T, R : Comparable<R>> Array<out T>.sortBy(crossinline order: (T) -> R): List<T> {
val sortedList = toArrayList()
val sortBy: Comparator<T> = compareBy(order)
java.util.Collections.sort(sortedList, sortBy)
@@ -357,8 +357,8 @@ 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.
*/
deprecated("This method may change its behavior soon. Use sortedBy() instead.", ReplaceWith("sortedBy(order)"))
public inline fun <T, R : Comparable<R>> Iterable<T>.sortBy(inlineOptions(InlineOption.ONLY_LOCAL_RETURN) order: (T) -> R): List<T> {
@Deprecated("This method may change its behavior soon. Use sortedBy() instead.", ReplaceWith("sortedBy(order)"))
public inline fun <T, R : Comparable<R>> Iterable<T>.sortBy(crossinline order: (T) -> R): List<T> {
val sortedList = toArrayList()
val sortBy: Comparator<T> = compareBy(order)
java.util.Collections.sort(sortedList, sortBy)
@@ -368,7 +368,7 @@ public inline fun <T, R : Comparable<R>> Iterable<T>.sortBy(inlineOptions(Inline
/**
* Returns a sorted list of all elements, in descending order.
*/
deprecated("This method may change its behavior soon. Use sortedDescending() instead.", ReplaceWith("sortedDescending()"))
@Deprecated("This method may change its behavior soon. Use sortedDescending() instead.", ReplaceWith("sortedDescending()"))
public fun <T : Comparable<T>> Iterable<T>.sortDescending(): List<T> {
val sortedList = toArrayList()
java.util.Collections.sort(sortedList, comparator { x, y -> y.compareTo(x) })
@@ -378,8 +378,8 @@ 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.
*/
deprecated("This method may change its behavior soon. Use sortedByDescending() instead.", ReplaceWith("sortedByDescending(order)"))
public inline fun <T, R : Comparable<R>> Array<out T>.sortDescendingBy(inlineOptions(InlineOption.ONLY_LOCAL_RETURN) order: (T) -> R): List<T> {
@Deprecated("This method may change its behavior soon. Use sortedByDescending() instead.", ReplaceWith("sortedByDescending(order)"))
public inline fun <T, R : Comparable<R>> Array<out T>.sortDescendingBy(crossinline order: (T) -> R): List<T> {
val sortedList = toArrayList()
val sortBy: Comparator<T> = compareByDescending(order)
java.util.Collections.sort(sortedList, sortBy)
@@ -389,8 +389,8 @@ 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.
*/
deprecated("This method may change its behavior soon. Use sortedByDescending() instead.", ReplaceWith("sortedByDescending(order)"))
public inline fun <T, R : Comparable<R>> Iterable<T>.sortDescendingBy(inlineOptions(InlineOption.ONLY_LOCAL_RETURN) order: (T) -> R): List<T> {
@Deprecated("This method may change its behavior soon. Use sortedByDescending() instead.", ReplaceWith("sortedByDescending(order)"))
public inline fun <T, R : Comparable<R>> Iterable<T>.sortDescendingBy(crossinline order: (T) -> R): List<T> {
val sortedList = toArrayList()
val sortBy: Comparator<T> = compareByDescending(order)
java.util.Collections.sort(sortedList, sortBy)
@@ -638,154 +638,154 @@ public fun <T, A: Array<out T>> A.sortedArrayWith(comparator: Comparator<in T>):
/**
* Returns a list of all elements sorted according to natural sort order of the value returned by specified [selector] function.
*/
public inline fun <T, R : Comparable<R>> Array<out T>.sortedBy(inlineOptions(InlineOption.ONLY_LOCAL_RETURN) selector: (T) -> R?): List<T> {
public inline fun <T, R : Comparable<R>> Array<out T>.sortedBy(crossinline selector: (T) -> R?): List<T> {
return sortedWith(compareBy(selector))
}
/**
* Returns a list of all elements sorted according to natural sort order of the value returned by specified [selector] function.
*/
public inline fun <R : Comparable<R>> BooleanArray.sortedBy(inlineOptions(InlineOption.ONLY_LOCAL_RETURN) selector: (Boolean) -> R?): List<Boolean> {
public inline fun <R : Comparable<R>> BooleanArray.sortedBy(crossinline selector: (Boolean) -> R?): List<Boolean> {
return sortedWith(compareBy(selector))
}
/**
* Returns a list of all elements sorted according to natural sort order of the value returned by specified [selector] function.
*/
public inline fun <R : Comparable<R>> ByteArray.sortedBy(inlineOptions(InlineOption.ONLY_LOCAL_RETURN) selector: (Byte) -> R?): List<Byte> {
public inline fun <R : Comparable<R>> ByteArray.sortedBy(crossinline selector: (Byte) -> R?): List<Byte> {
return sortedWith(compareBy(selector))
}
/**
* Returns a list of all elements sorted according to natural sort order of the value returned by specified [selector] function.
*/
public inline fun <R : Comparable<R>> CharArray.sortedBy(inlineOptions(InlineOption.ONLY_LOCAL_RETURN) selector: (Char) -> R?): List<Char> {
public inline fun <R : Comparable<R>> CharArray.sortedBy(crossinline selector: (Char) -> R?): List<Char> {
return sortedWith(compareBy(selector))
}
/**
* Returns a list of all elements sorted according to natural sort order of the value returned by specified [selector] function.
*/
public inline fun <R : Comparable<R>> DoubleArray.sortedBy(inlineOptions(InlineOption.ONLY_LOCAL_RETURN) selector: (Double) -> R?): List<Double> {
public inline fun <R : Comparable<R>> DoubleArray.sortedBy(crossinline selector: (Double) -> R?): List<Double> {
return sortedWith(compareBy(selector))
}
/**
* Returns a list of all elements sorted according to natural sort order of the value returned by specified [selector] function.
*/
public inline fun <R : Comparable<R>> FloatArray.sortedBy(inlineOptions(InlineOption.ONLY_LOCAL_RETURN) selector: (Float) -> R?): List<Float> {
public inline fun <R : Comparable<R>> FloatArray.sortedBy(crossinline selector: (Float) -> R?): List<Float> {
return sortedWith(compareBy(selector))
}
/**
* Returns a list of all elements sorted according to natural sort order of the value returned by specified [selector] function.
*/
public inline fun <R : Comparable<R>> IntArray.sortedBy(inlineOptions(InlineOption.ONLY_LOCAL_RETURN) selector: (Int) -> R?): List<Int> {
public inline fun <R : Comparable<R>> IntArray.sortedBy(crossinline selector: (Int) -> R?): List<Int> {
return sortedWith(compareBy(selector))
}
/**
* Returns a list of all elements sorted according to natural sort order of the value returned by specified [selector] function.
*/
public inline fun <R : Comparable<R>> LongArray.sortedBy(inlineOptions(InlineOption.ONLY_LOCAL_RETURN) selector: (Long) -> R?): List<Long> {
public inline fun <R : Comparable<R>> LongArray.sortedBy(crossinline selector: (Long) -> R?): List<Long> {
return sortedWith(compareBy(selector))
}
/**
* Returns a list of all elements sorted according to natural sort order of the value returned by specified [selector] function.
*/
public inline fun <R : Comparable<R>> ShortArray.sortedBy(inlineOptions(InlineOption.ONLY_LOCAL_RETURN) selector: (Short) -> R?): List<Short> {
public inline fun <R : Comparable<R>> ShortArray.sortedBy(crossinline selector: (Short) -> R?): List<Short> {
return sortedWith(compareBy(selector))
}
/**
* Returns a list of all elements sorted according to natural sort order of the value returned by specified [selector] function.
*/
public inline fun <T, R : Comparable<R>> Iterable<T>.sortedBy(inlineOptions(InlineOption.ONLY_LOCAL_RETURN) selector: (T) -> R?): List<T> {
public inline fun <T, R : Comparable<R>> Iterable<T>.sortedBy(crossinline selector: (T) -> R?): List<T> {
return sortedWith(compareBy(selector))
}
/**
* Returns a sequence that yields elements of this sequence sorted according to natural sort order of the value returned by specified [selector] function.
*/
public inline fun <T, R : Comparable<R>> Sequence<T>.sortedBy(inlineOptions(InlineOption.ONLY_LOCAL_RETURN) selector: (T) -> R?): Sequence<T> {
public inline fun <T, R : Comparable<R>> Sequence<T>.sortedBy(crossinline selector: (T) -> R?): Sequence<T> {
return sortedWith(compareBy(selector))
}
/**
* Returns a list of all elements sorted descending according to natural sort order of the value returned by specified [selector] function.
*/
public inline fun <T, R : Comparable<R>> Array<out T>.sortedByDescending(inlineOptions(InlineOption.ONLY_LOCAL_RETURN) selector: (T) -> R?): List<T> {
public inline fun <T, R : Comparable<R>> Array<out T>.sortedByDescending(crossinline selector: (T) -> R?): List<T> {
return sortedWith(compareByDescending(selector))
}
/**
* Returns a list of all elements sorted descending according to natural sort order of the value returned by specified [selector] function.
*/
public inline fun <R : Comparable<R>> BooleanArray.sortedByDescending(inlineOptions(InlineOption.ONLY_LOCAL_RETURN) selector: (Boolean) -> R?): List<Boolean> {
public inline fun <R : Comparable<R>> BooleanArray.sortedByDescending(crossinline selector: (Boolean) -> R?): List<Boolean> {
return sortedWith(compareByDescending(selector))
}
/**
* Returns a list of all elements sorted descending according to natural sort order of the value returned by specified [selector] function.
*/
public inline fun <R : Comparable<R>> ByteArray.sortedByDescending(inlineOptions(InlineOption.ONLY_LOCAL_RETURN) selector: (Byte) -> R?): List<Byte> {
public inline fun <R : Comparable<R>> ByteArray.sortedByDescending(crossinline selector: (Byte) -> R?): List<Byte> {
return sortedWith(compareByDescending(selector))
}
/**
* Returns a list of all elements sorted descending according to natural sort order of the value returned by specified [selector] function.
*/
public inline fun <R : Comparable<R>> CharArray.sortedByDescending(inlineOptions(InlineOption.ONLY_LOCAL_RETURN) selector: (Char) -> R?): List<Char> {
public inline fun <R : Comparable<R>> CharArray.sortedByDescending(crossinline selector: (Char) -> R?): List<Char> {
return sortedWith(compareByDescending(selector))
}
/**
* Returns a list of all elements sorted descending according to natural sort order of the value returned by specified [selector] function.
*/
public inline fun <R : Comparable<R>> DoubleArray.sortedByDescending(inlineOptions(InlineOption.ONLY_LOCAL_RETURN) selector: (Double) -> R?): List<Double> {
public inline fun <R : Comparable<R>> DoubleArray.sortedByDescending(crossinline selector: (Double) -> R?): List<Double> {
return sortedWith(compareByDescending(selector))
}
/**
* Returns a list of all elements sorted descending according to natural sort order of the value returned by specified [selector] function.
*/
public inline fun <R : Comparable<R>> FloatArray.sortedByDescending(inlineOptions(InlineOption.ONLY_LOCAL_RETURN) selector: (Float) -> R?): List<Float> {
public inline fun <R : Comparable<R>> FloatArray.sortedByDescending(crossinline selector: (Float) -> R?): List<Float> {
return sortedWith(compareByDescending(selector))
}
/**
* Returns a list of all elements sorted descending according to natural sort order of the value returned by specified [selector] function.
*/
public inline fun <R : Comparable<R>> IntArray.sortedByDescending(inlineOptions(InlineOption.ONLY_LOCAL_RETURN) selector: (Int) -> R?): List<Int> {
public inline fun <R : Comparable<R>> IntArray.sortedByDescending(crossinline selector: (Int) -> R?): List<Int> {
return sortedWith(compareByDescending(selector))
}
/**
* Returns a list of all elements sorted descending according to natural sort order of the value returned by specified [selector] function.
*/
public inline fun <R : Comparable<R>> LongArray.sortedByDescending(inlineOptions(InlineOption.ONLY_LOCAL_RETURN) selector: (Long) -> R?): List<Long> {
public inline fun <R : Comparable<R>> LongArray.sortedByDescending(crossinline selector: (Long) -> R?): List<Long> {
return sortedWith(compareByDescending(selector))
}
/**
* Returns a list of all elements sorted descending according to natural sort order of the value returned by specified [selector] function.
*/
public inline fun <R : Comparable<R>> ShortArray.sortedByDescending(inlineOptions(InlineOption.ONLY_LOCAL_RETURN) selector: (Short) -> R?): List<Short> {
public inline fun <R : Comparable<R>> ShortArray.sortedByDescending(crossinline selector: (Short) -> R?): List<Short> {
return sortedWith(compareByDescending(selector))
}
/**
* Returns a list of all elements sorted descending according to natural sort order of the value returned by specified [selector] function.
*/
public inline fun <T, R : Comparable<R>> Iterable<T>.sortedByDescending(inlineOptions(InlineOption.ONLY_LOCAL_RETURN) selector: (T) -> R?): List<T> {
public inline fun <T, R : Comparable<R>> Iterable<T>.sortedByDescending(crossinline selector: (T) -> R?): List<T> {
return sortedWith(compareByDescending(selector))
}
/**
* Returns a sequence that yields elements of this sequence sorted descending according to natural sort order of the value returned by specified [selector] function.
*/
public inline fun <T, R : Comparable<R>> Sequence<T>.sortedByDescending(inlineOptions(InlineOption.ONLY_LOCAL_RETURN) selector: (T) -> R?): Sequence<T> {
public inline fun <T, R : Comparable<R>> Sequence<T>.sortedByDescending(crossinline selector: (T) -> R?): Sequence<T> {
return sortedWith(compareByDescending(selector))
}
@@ -965,7 +965,7 @@ public fun <T> Sequence<T>.sortedWith(comparator: Comparator<in T>): Sequence<T>
/**
* Returns a sorted list of all elements.
*/
deprecated("Use sorted() instead.", ReplaceWith("sorted()"))
@Deprecated("Use sorted() instead.", ReplaceWith("sorted()"))
public fun <T : Comparable<T>> Array<out T>.toSortedList(): List<T> {
val sortedList = toArrayList()
java.util.Collections.sort(sortedList)
@@ -975,7 +975,7 @@ public fun <T : Comparable<T>> Array<out T>.toSortedList(): List<T> {
/**
* Returns a sorted list of all elements.
*/
deprecated("Use sorted() instead.", ReplaceWith("sorted()"))
@Deprecated("Use sorted() instead.", ReplaceWith("sorted()"))
public fun BooleanArray.toSortedList(): List<Boolean> {
val sortedList = toArrayList()
java.util.Collections.sort(sortedList)
@@ -985,7 +985,7 @@ public fun BooleanArray.toSortedList(): List<Boolean> {
/**
* Returns a sorted list of all elements.
*/
deprecated("Use sorted() instead.", ReplaceWith("sorted()"))
@Deprecated("Use sorted() instead.", ReplaceWith("sorted()"))
public fun ByteArray.toSortedList(): List<Byte> {
val sortedList = toArrayList()
java.util.Collections.sort(sortedList)
@@ -995,7 +995,7 @@ public fun ByteArray.toSortedList(): List<Byte> {
/**
* Returns a sorted list of all elements.
*/
deprecated("Use sorted() instead.", ReplaceWith("sorted()"))
@Deprecated("Use sorted() instead.", ReplaceWith("sorted()"))
public fun CharArray.toSortedList(): List<Char> {
val sortedList = toArrayList()
java.util.Collections.sort(sortedList)
@@ -1005,7 +1005,7 @@ public fun CharArray.toSortedList(): List<Char> {
/**
* Returns a sorted list of all elements.
*/
deprecated("Use sorted() instead.", ReplaceWith("sorted()"))
@Deprecated("Use sorted() instead.", ReplaceWith("sorted()"))
public fun DoubleArray.toSortedList(): List<Double> {
val sortedList = toArrayList()
java.util.Collections.sort(sortedList)
@@ -1015,7 +1015,7 @@ public fun DoubleArray.toSortedList(): List<Double> {
/**
* Returns a sorted list of all elements.
*/
deprecated("Use sorted() instead.", ReplaceWith("sorted()"))
@Deprecated("Use sorted() instead.", ReplaceWith("sorted()"))
public fun FloatArray.toSortedList(): List<Float> {
val sortedList = toArrayList()
java.util.Collections.sort(sortedList)
@@ -1025,7 +1025,7 @@ public fun FloatArray.toSortedList(): List<Float> {
/**
* Returns a sorted list of all elements.
*/
deprecated("Use sorted() instead.", ReplaceWith("sorted()"))
@Deprecated("Use sorted() instead.", ReplaceWith("sorted()"))
public fun IntArray.toSortedList(): List<Int> {
val sortedList = toArrayList()
java.util.Collections.sort(sortedList)
@@ -1035,7 +1035,7 @@ public fun IntArray.toSortedList(): List<Int> {
/**
* Returns a sorted list of all elements.
*/
deprecated("Use sorted() instead.", ReplaceWith("sorted()"))
@Deprecated("Use sorted() instead.", ReplaceWith("sorted()"))
public fun LongArray.toSortedList(): List<Long> {
val sortedList = toArrayList()
java.util.Collections.sort(sortedList)
@@ -1045,7 +1045,7 @@ public fun LongArray.toSortedList(): List<Long> {
/**
* Returns a sorted list of all elements.
*/
deprecated("Use sorted() instead.", ReplaceWith("sorted()"))
@Deprecated("Use sorted() instead.", ReplaceWith("sorted()"))
public fun ShortArray.toSortedList(): List<Short> {
val sortedList = toArrayList()
java.util.Collections.sort(sortedList)
@@ -1055,7 +1055,7 @@ public fun ShortArray.toSortedList(): List<Short> {
/**
* Returns a sorted list of all elements.
*/
deprecated("Use sorted() instead.", ReplaceWith("sorted()"))
@Deprecated("Use sorted() instead.", ReplaceWith("sorted()"))
public fun <T : Comparable<T>> Iterable<T>.toSortedList(): List<T> {
val sortedList = toArrayList()
java.util.Collections.sort(sortedList)
@@ -1065,7 +1065,7 @@ public fun <T : Comparable<T>> Iterable<T>.toSortedList(): List<T> {
/**
* Returns a sorted list of all elements.
*/
deprecated("Use asIterable().sorted() instead.", ReplaceWith("asIterable().sorted()"))
@Deprecated("Use asIterable().sorted() instead.", ReplaceWith("asIterable().sorted()"))
public fun <T : Comparable<T>> Sequence<T>.toSortedList(): List<T> {
val sortedList = toArrayList()
java.util.Collections.sort(sortedList)
@@ -1075,7 +1075,7 @@ public fun <T : Comparable<T>> Sequence<T>.toSortedList(): List<T> {
/**
* Returns a sorted list of all elements, ordered by results of specified [order] function.
*/
deprecated("Use sortedBy(order) instead.", ReplaceWith("sortedBy(order)"))
@Deprecated("Use sortedBy(order) instead.", ReplaceWith("sortedBy(order)"))
public fun <T, V : Comparable<V>> Array<out T>.toSortedListBy(order: (T) -> V): List<T> {
val sortedList = toArrayList()
val sortBy: Comparator<T> = compareBy(order)
@@ -1086,7 +1086,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.
*/
deprecated("Use sortedBy(order) instead.", ReplaceWith("sortedBy(order)"))
@Deprecated("Use sortedBy(order) instead.", ReplaceWith("sortedBy(order)"))
public fun <V : Comparable<V>> BooleanArray.toSortedListBy(order: (Boolean) -> V): List<Boolean> {
val sortedList = toArrayList()
val sortBy: Comparator<Boolean> = compareBy(order)
@@ -1097,7 +1097,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.
*/
deprecated("Use sortedBy(order) instead.", ReplaceWith("sortedBy(order)"))
@Deprecated("Use sortedBy(order) instead.", ReplaceWith("sortedBy(order)"))
public fun <V : Comparable<V>> ByteArray.toSortedListBy(order: (Byte) -> V): List<Byte> {
val sortedList = toArrayList()
val sortBy: Comparator<Byte> = compareBy(order)
@@ -1108,7 +1108,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.
*/
deprecated("Use sortedBy(order) instead.", ReplaceWith("sortedBy(order)"))
@Deprecated("Use sortedBy(order) instead.", ReplaceWith("sortedBy(order)"))
public fun <V : Comparable<V>> CharArray.toSortedListBy(order: (Char) -> V): List<Char> {
val sortedList = toArrayList()
val sortBy: Comparator<Char> = compareBy(order)
@@ -1119,7 +1119,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.
*/
deprecated("Use sortedBy(order) instead.", ReplaceWith("sortedBy(order)"))
@Deprecated("Use sortedBy(order) instead.", ReplaceWith("sortedBy(order)"))
public fun <V : Comparable<V>> DoubleArray.toSortedListBy(order: (Double) -> V): List<Double> {
val sortedList = toArrayList()
val sortBy: Comparator<Double> = compareBy(order)
@@ -1130,7 +1130,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.
*/
deprecated("Use sortedBy(order) instead.", ReplaceWith("sortedBy(order)"))
@Deprecated("Use sortedBy(order) instead.", ReplaceWith("sortedBy(order)"))
public fun <V : Comparable<V>> FloatArray.toSortedListBy(order: (Float) -> V): List<Float> {
val sortedList = toArrayList()
val sortBy: Comparator<Float> = compareBy(order)
@@ -1141,7 +1141,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.
*/
deprecated("Use sortedBy(order) instead.", ReplaceWith("sortedBy(order)"))
@Deprecated("Use sortedBy(order) instead.", ReplaceWith("sortedBy(order)"))
public fun <V : Comparable<V>> IntArray.toSortedListBy(order: (Int) -> V): List<Int> {
val sortedList = toArrayList()
val sortBy: Comparator<Int> = compareBy(order)
@@ -1152,7 +1152,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.
*/
deprecated("Use sortedBy(order) instead.", ReplaceWith("sortedBy(order)"))
@Deprecated("Use sortedBy(order) instead.", ReplaceWith("sortedBy(order)"))
public fun <V : Comparable<V>> LongArray.toSortedListBy(order: (Long) -> V): List<Long> {
val sortedList = toArrayList()
val sortBy: Comparator<Long> = compareBy(order)
@@ -1163,7 +1163,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.
*/
deprecated("Use sortedBy(order) instead.", ReplaceWith("sortedBy(order)"))
@Deprecated("Use sortedBy(order) instead.", ReplaceWith("sortedBy(order)"))
public fun <V : Comparable<V>> ShortArray.toSortedListBy(order: (Short) -> V): List<Short> {
val sortedList = toArrayList()
val sortBy: Comparator<Short> = compareBy(order)
@@ -1174,7 +1174,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.
*/
deprecated("Use sortedBy(order) instead.", ReplaceWith("sortedBy(order)"))
@Deprecated("Use sortedBy(order) instead.", ReplaceWith("sortedBy(order)"))
public fun <T, V : Comparable<V>> Iterable<T>.toSortedListBy(order: (T) -> V): List<T> {
val sortedList = toArrayList()
val sortBy: Comparator<T> = compareBy(order)
@@ -1185,7 +1185,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.
*/
deprecated("Use asIterable().sortedBy(order) instead.", ReplaceWith("asIterable().sortedBy(order)"))
@Deprecated("Use asIterable().sortedBy(order) instead.", ReplaceWith("asIterable().sortedBy(order)"))
public fun <T, V : Comparable<V>> Sequence<T>.toSortedListBy(order: (T) -> V): List<T> {
val sortedList = toArrayList()
val sortBy: Comparator<T> = compareBy(order)
+42 -42
View File
@@ -13,7 +13,7 @@ import java.util.Collections // TODO: it's temporary while we have java.util.Col
/**
* Checks if the specified [item] belongs to this range.
*/
platformName("intRangeContains")
@kotlin.jvm.JvmName("intRangeContains")
public fun Range<Int>.contains(item: Byte): Boolean {
return start <= item && item <= end
}
@@ -21,7 +21,7 @@ public fun Range<Int>.contains(item: Byte): Boolean {
/**
* Checks if the specified [item] belongs to this range.
*/
platformName("longRangeContains")
@kotlin.jvm.JvmName("longRangeContains")
public fun Range<Long>.contains(item: Byte): Boolean {
return start <= item && item <= end
}
@@ -29,7 +29,7 @@ public fun Range<Long>.contains(item: Byte): Boolean {
/**
* Checks if the specified [item] belongs to this range.
*/
platformName("shortRangeContains")
@kotlin.jvm.JvmName("shortRangeContains")
public fun Range<Short>.contains(item: Byte): Boolean {
return start <= item && item <= end
}
@@ -37,7 +37,7 @@ public fun Range<Short>.contains(item: Byte): Boolean {
/**
* Checks if the specified [item] belongs to this range.
*/
platformName("doubleRangeContains")
@kotlin.jvm.JvmName("doubleRangeContains")
public fun Range<Double>.contains(item: Byte): Boolean {
return start <= item && item <= end
}
@@ -45,42 +45,42 @@ public fun Range<Double>.contains(item: Byte): Boolean {
/**
* Checks if the specified [item] belongs to this range.
*/
platformName("floatRangeContains")
@kotlin.jvm.JvmName("floatRangeContains")
public fun Range<Float>.contains(item: Byte): Boolean {
return start <= item && item <= end
}
deprecated("The 'contains' operation for a range of Char and Byte item is not supported and should not be used.")
@Deprecated("The 'contains' operation for a range of Char and Byte item is not supported and should not be used.")
public fun CharRange.contains(item: Byte): Nothing {
throw UnsupportedOperationException()
}
deprecated("The 'contains' operation for a range of Int and Char item is not supported and should not be used.")
@Deprecated("The 'contains' operation for a range of Int and Char item is not supported and should not be used.")
public fun IntRange.contains(item: Char): Nothing {
throw UnsupportedOperationException()
}
deprecated("The 'contains' operation for a range of Long and Char item is not supported and should not be used.")
@Deprecated("The 'contains' operation for a range of Long and Char item is not supported and should not be used.")
public fun LongRange.contains(item: Char): Nothing {
throw UnsupportedOperationException()
}
deprecated("The 'contains' operation for a range of Byte and Char item is not supported and should not be used.")
@Deprecated("The 'contains' operation for a range of Byte and Char item is not supported and should not be used.")
public fun ByteRange.contains(item: Char): Nothing {
throw UnsupportedOperationException()
}
deprecated("The 'contains' operation for a range of Short and Char item is not supported and should not be used.")
@Deprecated("The 'contains' operation for a range of Short and Char item is not supported and should not be used.")
public fun ShortRange.contains(item: Char): Nothing {
throw UnsupportedOperationException()
}
deprecated("The 'contains' operation for a range of Double and Char item is not supported and should not be used.")
@Deprecated("The 'contains' operation for a range of Double and Char item is not supported and should not be used.")
public fun DoubleRange.contains(item: Char): Nothing {
throw UnsupportedOperationException()
}
deprecated("The 'contains' operation for a range of Float and Char item is not supported and should not be used.")
@Deprecated("The 'contains' operation for a range of Float and Char item is not supported and should not be used.")
public fun FloatRange.contains(item: Char): Nothing {
throw UnsupportedOperationException()
}
@@ -88,7 +88,7 @@ public fun FloatRange.contains(item: Char): Nothing {
/**
* Checks if the specified [item] belongs to this range.
*/
platformName("intRangeContains")
@kotlin.jvm.JvmName("intRangeContains")
public fun Range<Int>.contains(item: Double): Boolean {
return start <= item && item <= end
}
@@ -96,7 +96,7 @@ public fun Range<Int>.contains(item: Double): Boolean {
/**
* Checks if the specified [item] belongs to this range.
*/
platformName("longRangeContains")
@kotlin.jvm.JvmName("longRangeContains")
public fun Range<Long>.contains(item: Double): Boolean {
return start <= item && item <= end
}
@@ -104,7 +104,7 @@ public fun Range<Long>.contains(item: Double): Boolean {
/**
* Checks if the specified [item] belongs to this range.
*/
platformName("byteRangeContains")
@kotlin.jvm.JvmName("byteRangeContains")
public fun Range<Byte>.contains(item: Double): Boolean {
return start <= item && item <= end
}
@@ -112,7 +112,7 @@ public fun Range<Byte>.contains(item: Double): Boolean {
/**
* Checks if the specified [item] belongs to this range.
*/
platformName("shortRangeContains")
@kotlin.jvm.JvmName("shortRangeContains")
public fun Range<Short>.contains(item: Double): Boolean {
return start <= item && item <= end
}
@@ -120,12 +120,12 @@ public fun Range<Short>.contains(item: Double): Boolean {
/**
* Checks if the specified [item] belongs to this range.
*/
platformName("floatRangeContains")
@kotlin.jvm.JvmName("floatRangeContains")
public fun Range<Float>.contains(item: Double): Boolean {
return start <= item && item <= end
}
deprecated("The 'contains' operation for a range of Char and Double item is not supported and should not be used.")
@Deprecated("The 'contains' operation for a range of Char and Double item is not supported and should not be used.")
public fun CharRange.contains(item: Double): Nothing {
throw UnsupportedOperationException()
}
@@ -133,7 +133,7 @@ public fun CharRange.contains(item: Double): Nothing {
/**
* Checks if the specified [item] belongs to this range.
*/
platformName("intRangeContains")
@kotlin.jvm.JvmName("intRangeContains")
public fun Range<Int>.contains(item: Float): Boolean {
return start <= item && item <= end
}
@@ -141,7 +141,7 @@ public fun Range<Int>.contains(item: Float): Boolean {
/**
* Checks if the specified [item] belongs to this range.
*/
platformName("longRangeContains")
@kotlin.jvm.JvmName("longRangeContains")
public fun Range<Long>.contains(item: Float): Boolean {
return start <= item && item <= end
}
@@ -149,7 +149,7 @@ public fun Range<Long>.contains(item: Float): Boolean {
/**
* Checks if the specified [item] belongs to this range.
*/
platformName("byteRangeContains")
@kotlin.jvm.JvmName("byteRangeContains")
public fun Range<Byte>.contains(item: Float): Boolean {
return start <= item && item <= end
}
@@ -157,7 +157,7 @@ public fun Range<Byte>.contains(item: Float): Boolean {
/**
* Checks if the specified [item] belongs to this range.
*/
platformName("shortRangeContains")
@kotlin.jvm.JvmName("shortRangeContains")
public fun Range<Short>.contains(item: Float): Boolean {
return start <= item && item <= end
}
@@ -165,12 +165,12 @@ public fun Range<Short>.contains(item: Float): Boolean {
/**
* Checks if the specified [item] belongs to this range.
*/
platformName("doubleRangeContains")
@kotlin.jvm.JvmName("doubleRangeContains")
public fun Range<Double>.contains(item: Float): Boolean {
return start <= item && item <= end
}
deprecated("The 'contains' operation for a range of Char and Float item is not supported and should not be used.")
@Deprecated("The 'contains' operation for a range of Char and Float item is not supported and should not be used.")
public fun CharRange.contains(item: Float): Nothing {
throw UnsupportedOperationException()
}
@@ -178,7 +178,7 @@ public fun CharRange.contains(item: Float): Nothing {
/**
* Checks if the specified [item] belongs to this range.
*/
platformName("longRangeContains")
@kotlin.jvm.JvmName("longRangeContains")
public fun Range<Long>.contains(item: Int): Boolean {
return start <= item && item <= end
}
@@ -186,7 +186,7 @@ public fun Range<Long>.contains(item: Int): Boolean {
/**
* Checks if the specified [item] belongs to this range.
*/
platformName("byteRangeContains")
@kotlin.jvm.JvmName("byteRangeContains")
public fun Range<Byte>.contains(item: Int): Boolean {
return start <= item && item <= end
}
@@ -194,7 +194,7 @@ public fun Range<Byte>.contains(item: Int): Boolean {
/**
* Checks if the specified [item] belongs to this range.
*/
platformName("shortRangeContains")
@kotlin.jvm.JvmName("shortRangeContains")
public fun Range<Short>.contains(item: Int): Boolean {
return start <= item && item <= end
}
@@ -202,7 +202,7 @@ public fun Range<Short>.contains(item: Int): Boolean {
/**
* Checks if the specified [item] belongs to this range.
*/
platformName("doubleRangeContains")
@kotlin.jvm.JvmName("doubleRangeContains")
public fun Range<Double>.contains(item: Int): Boolean {
return start <= item && item <= end
}
@@ -210,12 +210,12 @@ public fun Range<Double>.contains(item: Int): Boolean {
/**
* Checks if the specified [item] belongs to this range.
*/
platformName("floatRangeContains")
@kotlin.jvm.JvmName("floatRangeContains")
public fun Range<Float>.contains(item: Int): Boolean {
return start <= item && item <= end
}
deprecated("The 'contains' operation for a range of Char and Int item is not supported and should not be used.")
@Deprecated("The 'contains' operation for a range of Char and Int item is not supported and should not be used.")
public fun CharRange.contains(item: Int): Nothing {
throw UnsupportedOperationException()
}
@@ -223,7 +223,7 @@ public fun CharRange.contains(item: Int): Nothing {
/**
* Checks if the specified [item] belongs to this range.
*/
platformName("intRangeContains")
@kotlin.jvm.JvmName("intRangeContains")
public fun Range<Int>.contains(item: Long): Boolean {
return start <= item && item <= end
}
@@ -231,7 +231,7 @@ public fun Range<Int>.contains(item: Long): Boolean {
/**
* Checks if the specified [item] belongs to this range.
*/
platformName("byteRangeContains")
@kotlin.jvm.JvmName("byteRangeContains")
public fun Range<Byte>.contains(item: Long): Boolean {
return start <= item && item <= end
}
@@ -239,7 +239,7 @@ public fun Range<Byte>.contains(item: Long): Boolean {
/**
* Checks if the specified [item] belongs to this range.
*/
platformName("shortRangeContains")
@kotlin.jvm.JvmName("shortRangeContains")
public fun Range<Short>.contains(item: Long): Boolean {
return start <= item && item <= end
}
@@ -247,7 +247,7 @@ public fun Range<Short>.contains(item: Long): Boolean {
/**
* Checks if the specified [item] belongs to this range.
*/
platformName("doubleRangeContains")
@kotlin.jvm.JvmName("doubleRangeContains")
public fun Range<Double>.contains(item: Long): Boolean {
return start <= item && item <= end
}
@@ -255,12 +255,12 @@ public fun Range<Double>.contains(item: Long): Boolean {
/**
* Checks if the specified [item] belongs to this range.
*/
platformName("floatRangeContains")
@kotlin.jvm.JvmName("floatRangeContains")
public fun Range<Float>.contains(item: Long): Boolean {
return start <= item && item <= end
}
deprecated("The 'contains' operation for a range of Char and Long item is not supported and should not be used.")
@Deprecated("The 'contains' operation for a range of Char and Long item is not supported and should not be used.")
public fun CharRange.contains(item: Long): Nothing {
throw UnsupportedOperationException()
}
@@ -268,7 +268,7 @@ public fun CharRange.contains(item: Long): Nothing {
/**
* Checks if the specified [item] belongs to this range.
*/
platformName("intRangeContains")
@kotlin.jvm.JvmName("intRangeContains")
public fun Range<Int>.contains(item: Short): Boolean {
return start <= item && item <= end
}
@@ -276,7 +276,7 @@ public fun Range<Int>.contains(item: Short): Boolean {
/**
* Checks if the specified [item] belongs to this range.
*/
platformName("longRangeContains")
@kotlin.jvm.JvmName("longRangeContains")
public fun Range<Long>.contains(item: Short): Boolean {
return start <= item && item <= end
}
@@ -284,7 +284,7 @@ public fun Range<Long>.contains(item: Short): Boolean {
/**
* Checks if the specified [item] belongs to this range.
*/
platformName("byteRangeContains")
@kotlin.jvm.JvmName("byteRangeContains")
public fun Range<Byte>.contains(item: Short): Boolean {
return start <= item && item <= end
}
@@ -292,7 +292,7 @@ public fun Range<Byte>.contains(item: Short): Boolean {
/**
* Checks if the specified [item] belongs to this range.
*/
platformName("doubleRangeContains")
@kotlin.jvm.JvmName("doubleRangeContains")
public fun Range<Double>.contains(item: Short): Boolean {
return start <= item && item <= end
}
@@ -300,12 +300,12 @@ public fun Range<Double>.contains(item: Short): Boolean {
/**
* Checks if the specified [item] belongs to this range.
*/
platformName("floatRangeContains")
@kotlin.jvm.JvmName("floatRangeContains")
public fun Range<Float>.contains(item: Short): Boolean {
return start <= item && item <= end
}
deprecated("The 'contains' operation for a range of Char and Short item is not supported and should not be used.")
@Deprecated("The 'contains' operation for a range of Char and Short item is not supported and should not be used.")
public fun CharRange.contains(item: Short): Nothing {
throw UnsupportedOperationException()
}
+13 -13
View File
@@ -162,7 +162,7 @@ public fun String.asSequence(): Sequence<Char> {
/**
* Returns a sequence from the given collection
*/
deprecated("Use asSequence() instead", ReplaceWith("asSequence()"))
@Deprecated("Use asSequence() instead", ReplaceWith("asSequence()"))
public fun <T> Array<out T>.sequence(): Sequence<T> {
return asSequence()
}
@@ -170,7 +170,7 @@ public fun <T> Array<out T>.sequence(): Sequence<T> {
/**
* Returns a sequence from the given collection
*/
deprecated("Use asSequence() instead", ReplaceWith("asSequence()"))
@Deprecated("Use asSequence() instead", ReplaceWith("asSequence()"))
public fun BooleanArray.sequence(): Sequence<Boolean> {
return asSequence()
}
@@ -178,7 +178,7 @@ public fun BooleanArray.sequence(): Sequence<Boolean> {
/**
* Returns a sequence from the given collection
*/
deprecated("Use asSequence() instead", ReplaceWith("asSequence()"))
@Deprecated("Use asSequence() instead", ReplaceWith("asSequence()"))
public fun ByteArray.sequence(): Sequence<Byte> {
return asSequence()
}
@@ -186,7 +186,7 @@ public fun ByteArray.sequence(): Sequence<Byte> {
/**
* Returns a sequence from the given collection
*/
deprecated("Use asSequence() instead", ReplaceWith("asSequence()"))
@Deprecated("Use asSequence() instead", ReplaceWith("asSequence()"))
public fun CharArray.sequence(): Sequence<Char> {
return asSequence()
}
@@ -194,7 +194,7 @@ public fun CharArray.sequence(): Sequence<Char> {
/**
* Returns a sequence from the given collection
*/
deprecated("Use asSequence() instead", ReplaceWith("asSequence()"))
@Deprecated("Use asSequence() instead", ReplaceWith("asSequence()"))
public fun DoubleArray.sequence(): Sequence<Double> {
return asSequence()
}
@@ -202,7 +202,7 @@ public fun DoubleArray.sequence(): Sequence<Double> {
/**
* Returns a sequence from the given collection
*/
deprecated("Use asSequence() instead", ReplaceWith("asSequence()"))
@Deprecated("Use asSequence() instead", ReplaceWith("asSequence()"))
public fun FloatArray.sequence(): Sequence<Float> {
return asSequence()
}
@@ -210,7 +210,7 @@ public fun FloatArray.sequence(): Sequence<Float> {
/**
* Returns a sequence from the given collection
*/
deprecated("Use asSequence() instead", ReplaceWith("asSequence()"))
@Deprecated("Use asSequence() instead", ReplaceWith("asSequence()"))
public fun IntArray.sequence(): Sequence<Int> {
return asSequence()
}
@@ -218,7 +218,7 @@ public fun IntArray.sequence(): Sequence<Int> {
/**
* Returns a sequence from the given collection
*/
deprecated("Use asSequence() instead", ReplaceWith("asSequence()"))
@Deprecated("Use asSequence() instead", ReplaceWith("asSequence()"))
public fun LongArray.sequence(): Sequence<Long> {
return asSequence()
}
@@ -226,7 +226,7 @@ public fun LongArray.sequence(): Sequence<Long> {
/**
* Returns a sequence from the given collection
*/
deprecated("Use asSequence() instead", ReplaceWith("asSequence()"))
@Deprecated("Use asSequence() instead", ReplaceWith("asSequence()"))
public fun ShortArray.sequence(): Sequence<Short> {
return asSequence()
}
@@ -234,7 +234,7 @@ public fun ShortArray.sequence(): Sequence<Short> {
/**
* Returns a sequence from the given collection
*/
deprecated("Use asSequence() instead", ReplaceWith("asSequence()"))
@Deprecated("Use asSequence() instead", ReplaceWith("asSequence()"))
public fun <T> Iterable<T>.sequence(): Sequence<T> {
return asSequence()
}
@@ -242,7 +242,7 @@ public fun <T> Iterable<T>.sequence(): Sequence<T> {
/**
* Returns a sequence from the given collection
*/
deprecated("Use asSequence() instead", ReplaceWith("asSequence()"))
@Deprecated("Use asSequence() instead", ReplaceWith("asSequence()"))
public fun <K, V> Map<K, V>.sequence(): Sequence<Map.Entry<K, V>> {
return asSequence()
}
@@ -250,7 +250,7 @@ public fun <K, V> Map<K, V>.sequence(): Sequence<Map.Entry<K, V>> {
/**
* Returns a sequence from the given collection
*/
deprecated("Use asSequence() instead", ReplaceWith("asSequence()"))
@Deprecated("Use asSequence() instead", ReplaceWith("asSequence()"))
public fun <T> Sequence<T>.sequence(): Sequence<T> {
return this
}
@@ -258,7 +258,7 @@ public fun <T> Sequence<T>.sequence(): Sequence<T> {
/**
* Returns a sequence from the given collection
*/
deprecated("Use asSequence() instead", ReplaceWith("asSequence()"))
@Deprecated("Use asSequence() instead", ReplaceWith("asSequence()"))
public fun String.sequence(): Sequence<Char> {
return asSequence()
}
@@ -329,7 +329,7 @@ public fun ShortArray.copyOf(newSize: Int): ShortArray {
/**
* Returns new array which is a copy of the original array.
*/
platformName("mutableCopyOf")
@JvmName("mutableCopyOf")
public fun <T> Array<T>.copyOf(newSize: Int): Array<T?> {
return Arrays.copyOf(this, newSize)
}