|
|
|
@@ -6162,6 +6162,8 @@ public fun <T> Array<out T>.sortedArrayWith(comparator: Comparator<in T>): Array
|
|
|
|
|
* Returns a list of all elements sorted according to natural sort order of the value returned by specified [selector] function.
|
|
|
|
|
*
|
|
|
|
|
* The sort is _stable_. It means that equal elements preserve their order relative to each other after sorting.
|
|
|
|
|
*
|
|
|
|
|
* @sample samples.collections.Collections.Sorting.sortedBy
|
|
|
|
|
*/
|
|
|
|
|
public inline fun <T, R : Comparable<R>> Array<out T>.sortedBy(crossinline selector: (T) -> R?): List<T> {
|
|
|
|
|
return sortedWith(compareBy(selector))
|
|
|
|
@@ -6169,6 +6171,8 @@ public inline fun <T, R : Comparable<R>> Array<out T>.sortedBy(crossinline selec
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Returns a list of all elements sorted according to natural sort order of the value returned by specified [selector] function.
|
|
|
|
|
*
|
|
|
|
|
* @sample samples.collections.Collections.Sorting.sortedBy
|
|
|
|
|
*/
|
|
|
|
|
public inline fun <R : Comparable<R>> ByteArray.sortedBy(crossinline selector: (Byte) -> R?): List<Byte> {
|
|
|
|
|
return sortedWith(compareBy(selector))
|
|
|
|
@@ -6176,6 +6180,8 @@ public inline fun <R : Comparable<R>> ByteArray.sortedBy(crossinline selector: (
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Returns a list of all elements sorted according to natural sort order of the value returned by specified [selector] function.
|
|
|
|
|
*
|
|
|
|
|
* @sample samples.collections.Collections.Sorting.sortedBy
|
|
|
|
|
*/
|
|
|
|
|
public inline fun <R : Comparable<R>> ShortArray.sortedBy(crossinline selector: (Short) -> R?): List<Short> {
|
|
|
|
|
return sortedWith(compareBy(selector))
|
|
|
|
@@ -6183,6 +6189,8 @@ public inline fun <R : Comparable<R>> ShortArray.sortedBy(crossinline selector:
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Returns a list of all elements sorted according to natural sort order of the value returned by specified [selector] function.
|
|
|
|
|
*
|
|
|
|
|
* @sample samples.collections.Collections.Sorting.sortedBy
|
|
|
|
|
*/
|
|
|
|
|
public inline fun <R : Comparable<R>> IntArray.sortedBy(crossinline selector: (Int) -> R?): List<Int> {
|
|
|
|
|
return sortedWith(compareBy(selector))
|
|
|
|
@@ -6190,6 +6198,8 @@ public inline fun <R : Comparable<R>> IntArray.sortedBy(crossinline selector: (I
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Returns a list of all elements sorted according to natural sort order of the value returned by specified [selector] function.
|
|
|
|
|
*
|
|
|
|
|
* @sample samples.collections.Collections.Sorting.sortedBy
|
|
|
|
|
*/
|
|
|
|
|
public inline fun <R : Comparable<R>> LongArray.sortedBy(crossinline selector: (Long) -> R?): List<Long> {
|
|
|
|
|
return sortedWith(compareBy(selector))
|
|
|
|
@@ -6197,6 +6207,8 @@ public inline fun <R : Comparable<R>> LongArray.sortedBy(crossinline selector: (
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Returns a list of all elements sorted according to natural sort order of the value returned by specified [selector] function.
|
|
|
|
|
*
|
|
|
|
|
* @sample samples.collections.Collections.Sorting.sortedBy
|
|
|
|
|
*/
|
|
|
|
|
public inline fun <R : Comparable<R>> FloatArray.sortedBy(crossinline selector: (Float) -> R?): List<Float> {
|
|
|
|
|
return sortedWith(compareBy(selector))
|
|
|
|
@@ -6204,6 +6216,8 @@ public inline fun <R : Comparable<R>> FloatArray.sortedBy(crossinline selector:
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Returns a list of all elements sorted according to natural sort order of the value returned by specified [selector] function.
|
|
|
|
|
*
|
|
|
|
|
* @sample samples.collections.Collections.Sorting.sortedBy
|
|
|
|
|
*/
|
|
|
|
|
public inline fun <R : Comparable<R>> DoubleArray.sortedBy(crossinline selector: (Double) -> R?): List<Double> {
|
|
|
|
|
return sortedWith(compareBy(selector))
|
|
|
|
@@ -6211,6 +6225,8 @@ public inline fun <R : Comparable<R>> DoubleArray.sortedBy(crossinline selector:
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Returns a list of all elements sorted according to natural sort order of the value returned by specified [selector] function.
|
|
|
|
|
*
|
|
|
|
|
* @sample samples.collections.Collections.Sorting.sortedBy
|
|
|
|
|
*/
|
|
|
|
|
public inline fun <R : Comparable<R>> BooleanArray.sortedBy(crossinline selector: (Boolean) -> R?): List<Boolean> {
|
|
|
|
|
return sortedWith(compareBy(selector))
|
|
|
|
@@ -6218,6 +6234,8 @@ public inline fun <R : Comparable<R>> BooleanArray.sortedBy(crossinline selector
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Returns a list of all elements sorted according to natural sort order of the value returned by specified [selector] function.
|
|
|
|
|
*
|
|
|
|
|
* @sample samples.collections.Collections.Sorting.sortedBy
|
|
|
|
|
*/
|
|
|
|
|
public inline fun <R : Comparable<R>> CharArray.sortedBy(crossinline selector: (Char) -> R?): List<Char> {
|
|
|
|
|
return sortedWith(compareBy(selector))
|
|
|
|
|