Drop deprecated sorting and reversing methods.

This commit is contained in:
Ilya Gorbunov
2015-09-29 22:31:01 +03:00
parent e54db8cd2a
commit 0b88801c66
5 changed files with 129 additions and 581 deletions
-293
View File
@@ -4084,78 +4084,6 @@ public inline fun ShortArray.takeWhile(predicate: (Short) -> Boolean): List<Shor
return list
}
/**
* Returns a list with elements in reversed order.
*/
@Deprecated("reverse will change its behavior soon. Use reversed() instead.", ReplaceWith("reversed()"))
public fun <T> Array<out T>.reverse(): List<T> {
return reversed()
}
/**
* Returns a list with elements in reversed order.
*/
@Deprecated("reverse will change its behavior soon. Use reversed() instead.", ReplaceWith("reversed()"))
public fun BooleanArray.reverse(): List<Boolean> {
return reversed()
}
/**
* Returns a list with elements in reversed order.
*/
@Deprecated("reverse will change its behavior soon. Use reversed() instead.", ReplaceWith("reversed()"))
public fun ByteArray.reverse(): List<Byte> {
return reversed()
}
/**
* Returns a list with elements in reversed order.
*/
@Deprecated("reverse will change its behavior soon. Use reversed() instead.", ReplaceWith("reversed()"))
public fun CharArray.reverse(): List<Char> {
return reversed()
}
/**
* Returns a list with elements in reversed order.
*/
@Deprecated("reverse will change its behavior soon. Use reversed() instead.", ReplaceWith("reversed()"))
public fun DoubleArray.reverse(): List<Double> {
return reversed()
}
/**
* Returns a list with elements in reversed order.
*/
@Deprecated("reverse will change its behavior soon. Use reversed() instead.", ReplaceWith("reversed()"))
public fun FloatArray.reverse(): List<Float> {
return reversed()
}
/**
* Returns a list with elements in reversed order.
*/
@Deprecated("reverse will change its behavior soon. Use reversed() instead.", ReplaceWith("reversed()"))
public fun IntArray.reverse(): List<Int> {
return reversed()
}
/**
* Returns a list with elements in reversed order.
*/
@Deprecated("reverse will change its behavior soon. Use reversed() instead.", ReplaceWith("reversed()"))
public fun LongArray.reverse(): List<Long> {
return reversed()
}
/**
* Returns a list with elements in reversed order.
*/
@Deprecated("reverse will change its behavior soon. Use reversed() instead.", ReplaceWith("reversed()"))
public fun ShortArray.reverse(): List<Short> {
return reversed()
}
/**
* Returns a list with elements in reversed order.
*/
@@ -4354,38 +4282,6 @@ public fun ShortArray.reversedArray(): ShortArray {
return result
}
/**
* 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)"))
public fun <T> Array<out T>.sortBy(comparator: Comparator<in T>): List<T> {
val sortedList = toArrayList()
java.util.Collections.sort(sortedList, comparator)
return sortedList
}
/**
* 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(crossinline order: (T) -> R): List<T> {
val sortedList = toArrayList()
val sortBy: Comparator<T> = compareBy(order)
java.util.Collections.sort(sortedList, sortBy)
return sortedList
}
/**
* 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(crossinline order: (T) -> R): List<T> {
val sortedList = toArrayList()
val sortBy: Comparator<T> = compareByDescending(order)
java.util.Collections.sort(sortedList, sortBy)
return sortedList
}
/**
* Returns a list of all elements sorted according to their natural sort order.
*/
@@ -4865,195 +4761,6 @@ public fun ShortArray.sortedWith(comparator: Comparator<in Short>): List<Short>
return sortedList
}
/**
* Returns a sorted list of all elements.
*/
@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)
return sortedList
}
/**
* Returns a sorted list of all elements.
*/
@Deprecated("Use sorted() instead.", ReplaceWith("sorted()"))
public fun BooleanArray.toSortedList(): List<Boolean> {
val sortedList = toArrayList()
java.util.Collections.sort(sortedList)
return sortedList
}
/**
* Returns a sorted list of all elements.
*/
@Deprecated("Use sorted() instead.", ReplaceWith("sorted()"))
public fun ByteArray.toSortedList(): List<Byte> {
val sortedList = toArrayList()
java.util.Collections.sort(sortedList)
return sortedList
}
/**
* Returns a sorted list of all elements.
*/
@Deprecated("Use sorted() instead.", ReplaceWith("sorted()"))
public fun CharArray.toSortedList(): List<Char> {
val sortedList = toArrayList()
java.util.Collections.sort(sortedList)
return sortedList
}
/**
* Returns a sorted list of all elements.
*/
@Deprecated("Use sorted() instead.", ReplaceWith("sorted()"))
public fun DoubleArray.toSortedList(): List<Double> {
val sortedList = toArrayList()
java.util.Collections.sort(sortedList)
return sortedList
}
/**
* Returns a sorted list of all elements.
*/
@Deprecated("Use sorted() instead.", ReplaceWith("sorted()"))
public fun FloatArray.toSortedList(): List<Float> {
val sortedList = toArrayList()
java.util.Collections.sort(sortedList)
return sortedList
}
/**
* Returns a sorted list of all elements.
*/
@Deprecated("Use sorted() instead.", ReplaceWith("sorted()"))
public fun IntArray.toSortedList(): List<Int> {
val sortedList = toArrayList()
java.util.Collections.sort(sortedList)
return sortedList
}
/**
* Returns a sorted list of all elements.
*/
@Deprecated("Use sorted() instead.", ReplaceWith("sorted()"))
public fun LongArray.toSortedList(): List<Long> {
val sortedList = toArrayList()
java.util.Collections.sort(sortedList)
return sortedList
}
/**
* Returns a sorted list of all elements.
*/
@Deprecated("Use sorted() instead.", ReplaceWith("sorted()"))
public fun ShortArray.toSortedList(): List<Short> {
val sortedList = toArrayList()
java.util.Collections.sort(sortedList)
return sortedList
}
/**
* Returns a sorted list of all elements, ordered by results of specified [order] function.
*/
@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)
java.util.Collections.sort(sortedList, sortBy)
return sortedList
}
/**
* Returns a sorted list of all elements, ordered by results of specified [order] function.
*/
@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)
java.util.Collections.sort(sortedList, sortBy)
return sortedList
}
/**
* Returns a sorted list of all elements, ordered by results of specified [order] function.
*/
@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)
java.util.Collections.sort(sortedList, sortBy)
return sortedList
}
/**
* Returns a sorted list of all elements, ordered by results of specified [order] function.
*/
@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)
java.util.Collections.sort(sortedList, sortBy)
return sortedList
}
/**
* Returns a sorted list of all elements, ordered by results of specified [order] function.
*/
@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)
java.util.Collections.sort(sortedList, sortBy)
return sortedList
}
/**
* Returns a sorted list of all elements, ordered by results of specified [order] function.
*/
@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)
java.util.Collections.sort(sortedList, sortBy)
return sortedList
}
/**
* Returns a sorted list of all elements, ordered by results of specified [order] function.
*/
@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)
java.util.Collections.sort(sortedList, sortBy)
return sortedList
}
/**
* Returns a sorted list of all elements, ordered by results of specified [order] function.
*/
@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)
java.util.Collections.sort(sortedList, sortBy)
return sortedList
}
/**
* Returns a sorted list of all elements, ordered by results of specified [order] function.
*/
@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)
java.util.Collections.sort(sortedList, sortBy)
return sortedList
}
/**
* Returns the Iterable that wraps the original array.
*/