All Downloads are FREE. Search and download functionalities are using the official Maven repository.

generated._Ordering.kt Maven / Gradle / Ivy

There is a newer version: 2.1.0-Beta1
Show newest version
package kotlin

//
// NOTE THIS FILE IS AUTO-GENERATED by the GenerateStandardLib.kt
// See: https://github.com/JetBrains/kotlin/tree/master/libraries/stdlib
//

import java.util.*

/**
 * Returns a list with elements in reversed order
 */
public fun  Array.reverse() : List {
    val list = toArrayList()
    Collections.reverse(list)
    return list
    
}

/**
 * Returns a list with elements in reversed order
 */
public fun BooleanArray.reverse() : List {
    val list = toArrayList()
    Collections.reverse(list)
    return list
    
}

/**
 * Returns a list with elements in reversed order
 */
public fun ByteArray.reverse() : List {
    val list = toArrayList()
    Collections.reverse(list)
    return list
    
}

/**
 * Returns a list with elements in reversed order
 */
public fun CharArray.reverse() : List {
    val list = toArrayList()
    Collections.reverse(list)
    return list
    
}

/**
 * Returns a list with elements in reversed order
 */
public fun DoubleArray.reverse() : List {
    val list = toArrayList()
    Collections.reverse(list)
    return list
    
}

/**
 * Returns a list with elements in reversed order
 */
public fun FloatArray.reverse() : List {
    val list = toArrayList()
    Collections.reverse(list)
    return list
    
}

/**
 * Returns a list with elements in reversed order
 */
public fun IntArray.reverse() : List {
    val list = toArrayList()
    Collections.reverse(list)
    return list
    
}

/**
 * Returns a list with elements in reversed order
 */
public fun LongArray.reverse() : List {
    val list = toArrayList()
    Collections.reverse(list)
    return list
    
}

/**
 * Returns a list with elements in reversed order
 */
public fun ShortArray.reverse() : List {
    val list = toArrayList()
    Collections.reverse(list)
    return list
    
}

/**
 * Returns a list with elements in reversed order
 */
public fun  Iterable.reverse() : List {
    val list = toArrayList()
    Collections.reverse(list)
    return list
    
}

/**
 * Returns a sorted list of all elements
 */
public fun > Iterable.sort() : List {
    val sortedList = toArrayList()
    java.util.Collections.sort(sortedList)
    return sortedList
    
}

/**
 * Returns a list of all elements, sorted by the specified *comparator*
 */
public fun  Array.sortBy(comparator : Comparator) : List {
    val sortedList = toArrayList()
    java.util.Collections.sort(sortedList, comparator)
    return sortedList
    
}

/**
 * Returns a list of all elements, sorted by the specified *comparator*
 */
public fun  Iterable.sortBy(comparator : Comparator) : List {
    val sortedList = toArrayList()
    java.util.Collections.sort(sortedList, comparator)
    return sortedList
    
}

/**
 * Returns a list of all elements, sorted by results of specified *order* function.
 */
public inline fun > Array.sortBy(order: (T) -> R) : List {
    val sortedList = toArrayList()
    val sortBy: Comparator = comparator {(x: T, y: T) -> order(x).compareTo(order(y))}
    java.util.Collections.sort(sortedList, sortBy)
    return sortedList
    
}

/**
 * Returns a list of all elements, sorted by results of specified *order* function.
 */
public inline fun > Iterable.sortBy(order: (T) -> R) : List {
    val sortedList = toArrayList()
    val sortBy: Comparator = comparator {(x: T, y: T) -> order(x).compareTo(order(y))}
    java.util.Collections.sort(sortedList, sortBy)
    return sortedList
    
}

/**
 * Returns a sorted list of all elements
 */
public fun > Iterable.sortDescending() : List {
    val sortedList = toArrayList()
    val sortBy: Comparator = comparator {(x: T, y: T) -> -x.compareTo(y)}
    java.util.Collections.sort(sortedList, sortBy)
    return sortedList
    
}

/**
 * Returns a list of all elements, sorted by results of specified *order* function.
 */
public inline fun > Array.sortDescendingBy(order: (T) -> R) : List {
    val sortedList = toArrayList()
    val sortBy: Comparator = comparator {(x: T, y: T) -> -order(x).compareTo(order(y))}
    java.util.Collections.sort(sortedList, sortBy)
    return sortedList
    
}

/**
 * Returns a list of all elements, sorted by results of specified *order* function.
 */
public inline fun > Iterable.sortDescendingBy(order: (T) -> R) : List {
    val sortedList = toArrayList()
    val sortBy: Comparator = comparator {(x: T, y: T) -> -order(x).compareTo(order(y))}
    java.util.Collections.sort(sortedList, sortBy)
    return sortedList
    
}





© 2015 - 2024 Weber Informatics LLC | Privacy Policy