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

kotlin.collections.CollectionsH.kt Maven / Gradle / Ivy

There is a newer version: 2.0.0.0-RC3
Show newest version
/*
 * Copyright 2010-2018 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.
 */

package kotlin.collections

expect interface RandomAccess

/**
 * Returns the array if it's not `null`, or an empty array otherwise.
 * @sample samples.collections.Arrays.Usage.arrayOrEmpty
 */
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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy