kotlin.collections.CollectionsH.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of kotlin-stdlib-common Show documentation
Show all versions of kotlin-stdlib-common Show documentation
Kotlin Common Standard Library (legacy, use kotlin-stdlib instead)
/*
* Copyright 2010-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license
* that can be found in the license/LICENSE.txt file.
*/
package kotlin.collections
expect interface RandomAccess
/** Returns the array if it's not `null`, or an empty array otherwise. */
expect inline fun Array?.orEmpty(): Array
expect inline fun Collection.toTypedArray(): Array
@SinceKotlin("1.2")
expect fun MutableList.fill(value: T): Unit
@SinceKotlin("1.2")
expect fun MutableList.shuffle(): Unit
@SinceKotlin("1.2")
expect fun Iterable.shuffled(): List
expect fun > MutableList.sort(): Unit
expect fun MutableList.sortWith(comparator: Comparator): Unit
// from Grouping.kt
public expect fun Grouping.eachCount(): Map
// public expect inline fun Grouping.eachSumOf(valueSelector: (T) -> Int): Map
internal expect fun copyToArrayImpl(collection: Collection<*>): Array
internal expect fun copyToArrayImpl(collection: Collection<*>, array: Array): Array
internal expect fun arrayOfNulls(reference: Array, size: Int): Array
internal expect fun Map.toSingletonMapOrSelf(): Map
internal expect fun Map.toSingletonMap(): Map
internal expect fun Array.copyToArrayOfAny(isVarargs: Boolean): Array