core.javautilCollections.kt Maven / Gradle / Ivy
package java.util
import java.lang.*
import java.util.*
import kotlin.comparisons.*
public object Collections {
@Deprecated("Use collection.maxWith(comparator) instead.", ReplaceWith("col.maxWith(comp)"))
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