org.pkl.thirdparty.kotlin.collections.MutableCollectionsJVM.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pkl-tools Show documentation
Show all versions of pkl-tools Show documentation
Fat Jar containing pkl-cli, pkl-codegen-java, pkl-codegen-kotlin, pkl-config-java, pkl-core, pkl-doc, and their shaded third-party dependencies.
/*
* Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
@file:org.pkl.thirdparty.kotlin.jvm.JvmMultifileClass
@file:org.pkl.thirdparty.kotlin.jvm.JvmName("CollectionsKt")
package org.pkl.thirdparty.kotlin.collections
@Deprecated("Use sortWith(comparator) instead.", ReplaceWith("this.sortWith(comparator)"), level = DeprecationLevel.ERROR)
@org.pkl.thirdparty.kotlin.internal.InlineOnly
@Suppress("UNUSED_PARAMETER", "EXTENSION_SHADOWED_BY_MEMBER")
public inline fun MutableList.sort(comparator: Comparator): Unit = throw NotImplementedError()
@Deprecated("Use sortWith(Comparator(comparison)) instead.", ReplaceWith("this.sortWith(Comparator(comparison))"), level = DeprecationLevel.ERROR)
@org.pkl.thirdparty.kotlin.internal.InlineOnly
@Suppress("UNUSED_PARAMETER")
public inline fun MutableList.sort(comparison: (T, T) -> Int): Unit = throw NotImplementedError()
/**
* Sorts elements in the list in-place according to their natural sort order.
*
* The sort is _stable_. It means that equal elements preserve their order relative to each other after sorting.
*
* @sample samples.collections.Collections.Sorting.sortMutableList
*/
public actual fun > MutableList.sort(): Unit {
if (size > 1) java.util.Collections.sort(this)
}
/**
* Sorts elements in the list in-place according to the order specified with [comparator].
*
* The sort is _stable_. It means that equal elements preserve their order relative to each other after sorting.
*
* @sample samples.collections.Collections.Sorting.sortMutableListWith
*/
public actual fun MutableList.sortWith(comparator: Comparator): Unit {
if (size > 1) java.util.Collections.sort(this, comparator)
}
/**
* Fills the list with the provided [value].
*
* Each element in the list gets replaced with the [value].
*/
@org.pkl.thirdparty.kotlin.internal.InlineOnly
@SinceKotlin("1.2")
public actual inline fun MutableList.fill(value: T) {
java.util.Collections.fill(this, value)
}
/**
* Randomly shuffles elements in this mutable list.
*/
@org.pkl.thirdparty.kotlin.internal.InlineOnly
@SinceKotlin("1.2")
public actual inline fun MutableList.shuffle() {
java.util.Collections.shuffle(this)
}
/**
* Randomly shuffles elements in this mutable list using the specified [random] instance as the source of randomness.
*/
@org.pkl.thirdparty.kotlin.internal.InlineOnly
@SinceKotlin("1.2")
public inline fun MutableList.shuffle(random: java.util.Random) {
java.util.Collections.shuffle(this, random)
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy