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

core.javautilCollections.kt Maven / Gradle / Ivy

There is a newer version: 1.0.7
Show newest version
package java.util

import java.lang.*
import java.util.*

public object Collections {
    public fun max(col: Collection, comp: Comparator): T = java.util.max(col, comp)

    @Deprecated("Use list.sort() instead.", ReplaceWith("list.sort()"))
    public fun > sort(list: MutableList): Unit = java.util.sort(list, naturalOrder())

    @Deprecated("Use list.sortWith(comparator) instead.", ReplaceWith("list.sortWith(comparator)"))
    public fun  sort(list: MutableList, comparator: java.util.Comparator): Unit = java.util.sort(list, comparator)

    @Deprecated("Use list.reverse() instead.", ReplaceWith("list.reverse()"))
    public fun  reverse(list: MutableList): Unit {
        val size = list.size()
        for (i in 0..(size / 2) - 1) {
            val i2 = size - i - 1
            val tmp = list[i]
            list[i] = list[i2]
            list[i2] = tmp
        }
    }
}

@library("collectionsMax")
private fun max(col: Collection, comp: Comparator): T = noImpl

@library("collectionsSort")
private fun  sort(list: MutableList, comparator: Comparator): Unit = noImpl




© 2015 - 2024 Weber Informatics LLC | Privacy Policy