Package-level declarations

Collection types, such as Iterable, Collection, List, Set, Map and related top-level and extension functions.

Collection types, such as Iterable, Collection, List, Set, Map and related top-level and extension functions.

Collection types, such as Iterable, Collection, List, Set, Map and related top-level and extension functions.

Collection types, such as Iterable, Collection, List, Set, Map and related top-level and extension functions.

Collection types, such as Iterable, Collection, List, Set, Map and related top-level and extension functions.

Collection types, such as Iterable, Collection, List, Set, Map and related top-level and extension functions.

Types

Link copied to clipboard
abstract class AbstractCollection<out E> : Collection<E>

Provides a skeletal implementation of the read-only Collection interface.

Since Kotlin 1.1
Link copied to clipboard
abstract class AbstractIterator<T> : Iterator<T>

A base class to simplify implementing iterators so that implementations only have to implement computeNext to implement the iterator, calling done when the iteration is complete.

Since Kotlin 1.0
Link copied to clipboard
abstract class AbstractList<out E> : AbstractCollection<E> , List<E>

Provides a skeletal implementation of the read-only List interface.

Since Kotlin 1.1
Link copied to clipboard
abstract class AbstractMap<K, out V> : Map<K, V>

Provides a skeletal implementation of the read-only Map interface.

Since Kotlin 1.1
Link copied to clipboard
expect abstract class AbstractMutableCollection<E> : MutableCollection<E>

Provides a skeletal implementation of the MutableCollection interface.

Since Kotlin 1.3

Provides a skeletal implementation of the MutableCollection interface.

Since Kotlin 1.1

Provides a skeletal implementation of the MutableCollection interface.

Since Kotlin 1.1

Provides a skeletal implementation of the MutableCollection interface.

Since Kotlin 1.3

Provides a skeletal implementation of the MutableCollection interface.

Since Kotlin 1.8

Provides a skeletal implementation of the MutableCollection interface.

Since Kotlin 1.8
Link copied to clipboard
expect abstract class AbstractMutableList<E> : MutableList<E>

Provides a skeletal implementation of the MutableList interface.

Since Kotlin 1.0

Provides a skeletal implementation of the MutableList interface.

Since Kotlin 1.1
actual abstract class AbstractMutableList<E> : AbstractList<E> , MutableList<E>

Provides a skeletal implementation of the MutableList interface.

Since Kotlin 1.1

Provides a skeletal implementation of the MutableList interface.

Since Kotlin 1.3

Provides a skeletal implementation of the MutableList interface.

Since Kotlin 1.8

Provides a skeletal implementation of the MutableList interface.

Since Kotlin 1.8
Link copied to clipboard
expect abstract class AbstractMutableMap<K, V> : MutableMap<K, V>

Provides a skeletal implementation of the MutableMap interface.

Since Kotlin 1.3
actual abstract class AbstractMutableMap<K, V> : AbstractMap<K, V> , MutableMap<K, V>

Provides a skeletal implementation of the MutableMap interface.

Since Kotlin 1.1
actual abstract class AbstractMutableMap<K, V> : AbstractMap<K, V> , MutableMap<K, V>

Provides a skeletal implementation of the MutableMap interface.

Since Kotlin 1.1
actual abstract class AbstractMutableMap<K, V> : AbstractMap<K, V> , MutableMap<K, V>

Provides a skeletal implementation of the MutableMap interface.

Since Kotlin 1.3
actual abstract class AbstractMutableMap<K, V> : AbstractMap<K, V> , MutableMap<K, V>

Provides a skeletal implementation of the MutableMap interface.

Since Kotlin 1.8
actual abstract class AbstractMutableMap<K, V> : AbstractMap<K, V> , MutableMap<K, V>

Provides a skeletal implementation of the MutableMap interface.

Since Kotlin 1.8
Link copied to clipboard
expect abstract class AbstractMutableSet<E> : MutableSet<E>

Provides a skeletal implementation of the MutableSet interface.

Since Kotlin 1.3

Provides a skeletal implementation of the MutableSet interface.

Since Kotlin 1.1
actual abstract class AbstractMutableSet<E> : AbstractSet<E> , MutableSet<E>

Provides a skeletal implementation of the MutableSet interface.

Since Kotlin 1.1

Provides a skeletal implementation of the MutableSet interface.

Since Kotlin 1.3

Provides a skeletal implementation of the MutableSet interface.

Since Kotlin 1.8

Provides a skeletal implementation of the MutableSet interface.

Since Kotlin 1.8
Link copied to clipboard
abstract class AbstractSet<out E> : AbstractCollection<E> , Set<E>

Provides a skeletal implementation of the read-only Set interface.

Since Kotlin 1.1
Link copied to clipboard

Resizable-array implementation of the deque data structure.

Since Kotlin 1.4
Link copied to clipboard
expect class ArrayList<E>(initialCapacity: Int) : MutableList<E> , RandomAccess
Since Kotlin 1.0
actual open class ArrayList<E>(initialCapacity: Int) : AbstractMutableList<E> , MutableList<E> , RandomAccess

Provides a MutableList implementation, which uses a resizable array as its backing storage.

Since Kotlin 1.1
actual typealias ArrayList<E> = java.util.ArrayList<E>
Since Kotlin 1.1
actual class ArrayList<E>(initialCapacity: Int) : AbstractMutableList<E> , MutableList<E> , RandomAccess

Creates a new empty ArrayList with the specified initial capacity.

Since Kotlin 1.3
actual class ArrayList<E>(initialCapacity: Int) : AbstractMutableList<E> , MutableList<E> , RandomAccess

Creates a new empty ArrayList with the specified initial capacity.

Since Kotlin 1.8
actual class ArrayList<E>(initialCapacity: Int) : AbstractMutableList<E> , MutableList<E> , RandomAccess

Creates a new empty ArrayList with the specified initial capacity.

Since Kotlin 1.8
Link copied to clipboard
abstract class BooleanIterator : Iterator<Boolean>

An iterator over a sequence of values of type Boolean.

Since Kotlin 1.0
Link copied to clipboard
abstract class ByteIterator : Iterator<Byte>

An iterator over a sequence of values of type Byte.

Since Kotlin 1.0
Link copied to clipboard
abstract class CharIterator : Iterator<Char>

An iterator over a sequence of values of type Char.

Since Kotlin 1.0
Link copied to clipboard
interface Collection<out E> : Iterable<E>

A generic collection of elements. Methods in this interface support only read-only access to the collection; read/write access is supported through the MutableCollection interface.

Since Kotlin 1.0
interface Collection<out E> : Iterable<E>

A generic collection of elements. Methods in this interface support only read-only access to the collection; read/write access is supported through the MutableCollection interface.

Since Kotlin 1.1
interface Collection<out E> : Iterable<E>

A generic collection of elements. Methods in this interface support only read-only access to the collection; read/write access is supported through the MutableCollection interface.

Since Kotlin 1.3
interface Collection<out E> : Iterable<E>

A generic collection of elements. Methods in this interface support only read-only access to the collection; read/write access is supported through the MutableCollection interface.

Since Kotlin 1.8
interface Collection<out E> : Iterable<E>

A generic collection of elements. Methods in this interface support only read-only access to the collection; read/write access is supported through the MutableCollection interface.

Since Kotlin 1.8
Link copied to clipboard
abstract class DoubleIterator : Iterator<Double>

An iterator over a sequence of values of type Double.

Since Kotlin 1.0
Link copied to clipboard
abstract class FloatIterator : Iterator<Float>

An iterator over a sequence of values of type Float.

Since Kotlin 1.0
Link copied to clipboard
interface Grouping<T, out K>

Represents a source of elements with a keyOf function, which can be applied to each element to get its key.

Since Kotlin 1.1
Link copied to clipboard
expect class HashMap<K, V> : MutableMap<K, V>
Since Kotlin 1.0
actual open class HashMap<K, V> : AbstractMutableMap<K, V> , MutableMap<K, V>

Hash table based implementation of the MutableMap interface.

Since Kotlin 1.1
actual typealias HashMap<K, V> = java.util.HashMap<K, V>
Since Kotlin 1.1
actual class HashMap<K, V> : MutableMap<K, V>
Since Kotlin 1.3
actual class HashMap<K, V> : MutableMap<K, V>
Since Kotlin 1.8
actual class HashMap<K, V> : MutableMap<K, V>
Since Kotlin 1.8
Link copied to clipboard
expect class HashSet<E> : MutableSet<E>
Since Kotlin 1.0
actual open class HashSet<E> : AbstractMutableSet<E> , MutableSet<E>

The implementation of the MutableSet interface, backed by a InternalMap implementation.

Since Kotlin 1.1
actual typealias HashSet<E> = java.util.HashSet<E>
Since Kotlin 1.1
actual class HashSet<E> : AbstractMutableSet<E> , MutableSet<E> , KonanSet<E>
Since Kotlin 1.3
actual class HashSet<E> : AbstractMutableSet<E> , MutableSet<E> , KonanSet<E>
Since Kotlin 1.8
actual class HashSet<E> : AbstractMutableSet<E> , MutableSet<E> , KonanSet<E>
Since Kotlin 1.8
Link copied to clipboard
data class IndexedValue<out T>(val index: Int, val value: T)

Data class representing a value from a collection or sequence, along with its index in that collection or sequence.

Since Kotlin 1.0
Link copied to clipboard
abstract class IntIterator : Iterator<Int>

An iterator over a sequence of values of type Int.

Since Kotlin 1.0
Link copied to clipboard
interface Iterable<out T>

Classes that inherit from this interface can be represented as a sequence of elements that can be iterated over.

Since Kotlin 1.0
interface Iterable<out T>

Classes that inherit from this interface can be represented as a sequence of elements that can be iterated over.

Since Kotlin 1.1
interface Iterable<out T>

Classes that inherit from this interface can be represented as a sequence of elements that can be iterated over.

Since Kotlin 1.3
interface Iterable<out T>

Classes that inherit from this interface can be represented as a sequence of elements that can be iterated over.

Since Kotlin 1.8
interface Iterable<out T>

Classes that inherit from this interface can be represented as a sequence of elements that can be iterated over.

Since Kotlin 1.8
Link copied to clipboard
interface Iterator<out T>

An iterator over a collection or another entity that can be represented as a sequence of elements. Allows to sequentially access the elements.

Since Kotlin 1.0
interface Iterator<out T>

An iterator over a collection or another entity that can be represented as a sequence of elements. Allows to sequentially access the elements.

Since Kotlin 1.1
interface Iterator<out T>

An iterator over a collection or another entity that can be represented as a sequence of elements. Allows to sequentially access the elements.

Since Kotlin 1.3
interface Iterator<out T>

An iterator over a collection or another entity that can be represented as a sequence of elements. Allows to sequentially access the elements.

Since Kotlin 1.8
interface Iterator<out T>

An iterator over a collection or another entity that can be represented as a sequence of elements. Allows to sequentially access the elements.

Since Kotlin 1.8
Link copied to clipboard
expect class LinkedHashMap<K, V> : MutableMap<K, V>
Since Kotlin 1.0
actual open class LinkedHashMap<K, V> : HashMap<K, V> , MutableMap<K, V>

Hash table based implementation of the MutableMap interface, which additionally preserves the insertion order of entries during the iteration.

Since Kotlin 1.1
actual typealias LinkedHashMap<K, V> = java.util.LinkedHashMap<K, V>
Since Kotlin 1.1
actual typealias LinkedHashMap<K, V> = HashMap<K, V>
Since Kotlin 1.3
actual typealias LinkedHashMap<K, V> = HashMap<K, V>
Since Kotlin 1.8
actual typealias LinkedHashMap<K, V> = HashMap<K, V>
Since Kotlin 1.8
Link copied to clipboard
expect class LinkedHashSet<E> : MutableSet<E>
Since Kotlin 1.0
actual open class LinkedHashSet<E> : HashSet<E> , MutableSet<E>

The implementation of the MutableSet interface, backed by a InternalMap implementation.

Since Kotlin 1.1
Since Kotlin 1.1
actual typealias LinkedHashSet<E> = HashSet<V>
Since Kotlin 1.3
actual typealias LinkedHashSet<E> = HashSet<V>
Since Kotlin 1.8
actual typealias LinkedHashSet<E> = HashSet<V>
Since Kotlin 1.8
Link copied to clipboard
interface List<out E> : Collection<E>

A generic ordered collection of elements. Methods in this interface support only read-only access to the list; read/write access is supported through the MutableList interface.

Since Kotlin 1.0
interface List<out E> : Collection<E>

A generic ordered collection of elements. Methods in this interface support only read-only access to the list; read/write access is supported through the MutableList interface.

Since Kotlin 1.1
interface List<out E> : Collection<E>

A generic ordered collection of elements. Methods in this interface support only read-only access to the list; read/write access is supported through the MutableList interface.

Since Kotlin 1.3
interface List<out E> : Collection<E>

A generic ordered collection of elements. Methods in this interface support only read-only access to the list; read/write access is supported through the MutableList interface.

Since Kotlin 1.8
interface List<out E> : Collection<E>

A generic ordered collection of elements. Methods in this interface support only read-only access to the list; read/write access is supported through the MutableList interface.

Since Kotlin 1.8
Link copied to clipboard
interface ListIterator<out T> : Iterator<T>

An iterator over a collection that supports indexed access.

Since Kotlin 1.0
interface ListIterator<out T> : Iterator<T>

An iterator over a collection that supports indexed access.

Since Kotlin 1.1
interface ListIterator<out T> : Iterator<T>

An iterator over a collection that supports indexed access.

Since Kotlin 1.3
interface ListIterator<out T> : Iterator<T>

An iterator over a collection that supports indexed access.

Since Kotlin 1.8
interface ListIterator<out T> : Iterator<T>

An iterator over a collection that supports indexed access.

Since Kotlin 1.8
Link copied to clipboard
abstract class LongIterator : Iterator<Long>

An iterator over a sequence of values of type Long.

Since Kotlin 1.0
Link copied to clipboard
interface Map<K, out V>

A collection that holds pairs of objects (keys and values) and supports efficiently retrieving the value corresponding to each key. Map keys are unique; the map holds only one value for each key. Methods in this interface support only read-only access to the map; read-write access is supported through the MutableMap interface.

Since Kotlin 1.0
interface Map<K, out V>

A collection that holds pairs of objects (keys and values) and supports efficiently retrieving the value corresponding to each key. Map keys are unique; the map holds only one value for each key. Methods in this interface support only read-only access to the map; read-write access is supported through the MutableMap interface.

Since Kotlin 1.1
interface Map<K, out V>

A collection that holds pairs of objects (keys and values) and supports efficiently retrieving the value corresponding to each key. Map keys are unique; the map holds only one value for each key. Methods in this interface support only read-only access to the map; read-write access is supported through the MutableMap interface.

Since Kotlin 1.3
interface Map<K, out V>

A collection that holds pairs of objects (keys and values) and supports efficiently retrieving the value corresponding to each key. Map keys are unique; the map holds only one value for each key. Methods in this interface support only read-only access to the map; read-write access is supported through the MutableMap interface.

Since Kotlin 1.8
interface Map<K, out V>

A collection that holds pairs of objects (keys and values) and supports efficiently retrieving the value corresponding to each key. Map keys are unique; the map holds only one value for each key. Methods in this interface support only read-only access to the map; read-write access is supported through the MutableMap interface.

Since Kotlin 1.8
Link copied to clipboard

A generic collection of elements that supports adding and removing elements.

Since Kotlin 1.0

A generic collection of elements that supports adding and removing elements.

Since Kotlin 1.1

A generic collection of elements that supports adding and removing elements.

Since Kotlin 1.3

A generic collection of elements that supports adding and removing elements.

Since Kotlin 1.8

A generic collection of elements that supports adding and removing elements.

Since Kotlin 1.8
Link copied to clipboard
interface MutableIterable<out T> : Iterable<T>

Classes that inherit from this interface can be represented as a sequence of elements that can be iterated over and that supports removing elements during iteration.

Since Kotlin 1.0
interface MutableIterable<out T> : Iterable<T>

Classes that inherit from this interface can be represented as a sequence of elements that can be iterated over and that supports removing elements during iteration.

Since Kotlin 1.1
interface MutableIterable<out T> : Iterable<T>

Classes that inherit from this interface can be represented as a sequence of elements that can be iterated over and that supports removing elements during iteration.

Since Kotlin 1.3
interface MutableIterable<out T> : Iterable<T>

Classes that inherit from this interface can be represented as a sequence of elements that can be iterated over and that supports removing elements during iteration.

Since Kotlin 1.8
interface MutableIterable<out T> : Iterable<T>

Classes that inherit from this interface can be represented as a sequence of elements that can be iterated over and that supports removing elements during iteration.

Since Kotlin 1.8
Link copied to clipboard
interface MutableIterator<out T> : Iterator<T>

An iterator over a mutable collection. Provides the ability to remove elements while iterating.

Since Kotlin 1.0
interface MutableIterator<out T> : Iterator<T>

An iterator over a mutable collection. Provides the ability to remove elements while iterating.

Since Kotlin 1.1
interface MutableIterator<out T> : Iterator<T>

An iterator over a mutable collection. Provides the ability to remove elements while iterating.

Since Kotlin 1.3
interface MutableIterator<out T> : Iterator<T>

An iterator over a mutable collection. Provides the ability to remove elements while iterating.

Since Kotlin 1.8
interface MutableIterator<out T> : Iterator<T>

An iterator over a mutable collection. Provides the ability to remove elements while iterating.

Since Kotlin 1.8
Link copied to clipboard

A generic ordered collection of elements that supports adding and removing elements.

Since Kotlin 1.0

A generic ordered collection of elements that supports adding and removing elements.

Since Kotlin 1.1

A generic ordered collection of elements that supports adding and removing elements.

Since Kotlin 1.3

A generic ordered collection of elements that supports adding and removing elements.

Since Kotlin 1.8

A generic ordered collection of elements that supports adding and removing elements.

Since Kotlin 1.8
Link copied to clipboard

An iterator over a mutable collection that supports indexed access. Provides the ability to add, modify and remove elements while iterating.

Since Kotlin 1.0

An iterator over a mutable collection that supports indexed access. Provides the ability to add, modify and remove elements while iterating.

Since Kotlin 1.1

An iterator over a mutable collection that supports indexed access. Provides the ability to add, modify and remove elements while iterating.

Since Kotlin 1.3

An iterator over a mutable collection that supports indexed access. Provides the ability to add, modify and remove elements while iterating.

Since Kotlin 1.8

An iterator over a mutable collection that supports indexed access. Provides the ability to add, modify and remove elements while iterating.

Since Kotlin 1.8
Link copied to clipboard
interface MutableMap<K, V> : Map<K, V>

A modifiable collection that holds pairs of objects (keys and values) and supports efficiently retrieving the value corresponding to each key. Map keys are unique; the map holds only one value for each key.

Since Kotlin 1.0
interface MutableMap<K, V> : Map<K, V>

A modifiable collection that holds pairs of objects (keys and values) and supports efficiently retrieving the value corresponding to each key. Map keys are unique; the map holds only one value for each key.

Since Kotlin 1.1
interface MutableMap<K, V> : Map<K, V>

A modifiable collection that holds pairs of objects (keys and values) and supports efficiently retrieving the value corresponding to each key. Map keys are unique; the map holds only one value for each key.

Since Kotlin 1.3
interface MutableMap<K, V> : Map<K, V>

A modifiable collection that holds pairs of objects (keys and values) and supports efficiently retrieving the value corresponding to each key. Map keys are unique; the map holds only one value for each key.

Since Kotlin 1.8
interface MutableMap<K, V> : Map<K, V>

A modifiable collection that holds pairs of objects (keys and values) and supports efficiently retrieving the value corresponding to each key. Map keys are unique; the map holds only one value for each key.

Since Kotlin 1.8
Link copied to clipboard
interface MutableSet<E> : Set<E> , MutableCollection<E>

A generic unordered collection of elements that does not support duplicate elements, and supports adding and removing elements.

Since Kotlin 1.0
interface MutableSet<E> : Set<E> , MutableCollection<E>

A generic unordered collection of elements that does not support duplicate elements, and supports adding and removing elements.

Since Kotlin 1.1
interface MutableSet<E> : Set<E> , MutableCollection<E>

A generic unordered collection of elements that does not support duplicate elements, and supports adding and removing elements.

Since Kotlin 1.3
interface MutableSet<E> : Set<E> , MutableCollection<E>

A generic unordered collection of elements that does not support duplicate elements, and supports adding and removing elements.

Since Kotlin 1.8
interface MutableSet<E> : Set<E> , MutableCollection<E>

A generic unordered collection of elements that does not support duplicate elements, and supports adding and removing elements.

Since Kotlin 1.8
Link copied to clipboard
expect interface RandomAccess

Marker interface indicating that the List implementation supports fast indexed access.

Since Kotlin 1.0
actual interface RandomAccess

Marker interface indicating that the List implementation supports fast indexed access.

Since Kotlin 1.1

Marker interface indicating that the List implementation supports fast indexed access.

Since Kotlin 1.1
actual interface RandomAccess

Marker interface indicating that the List implementation supports fast indexed access.

Since Kotlin 1.3
actual interface RandomAccess

Marker interface indicating that the List implementation supports fast indexed access.

Since Kotlin 1.8
actual interface RandomAccess

Marker interface indicating that the List implementation supports fast indexed access.

Since Kotlin 1.8
Link copied to clipboard
interface Set<out E> : Collection<E>

A generic unordered collection of elements that does not support duplicate elements. Methods in this interface support only read-only access to the set; read/write access is supported through the MutableSet interface.

Since Kotlin 1.0
interface Set<out E> : Collection<E>

A generic unordered collection of elements that does not support duplicate elements. Methods in this interface support only read-only access to the set; read/write access is supported through the MutableSet interface.

Since Kotlin 1.1
interface Set<out E> : Collection<E>

A generic unordered collection of elements that does not support duplicate elements. Methods in this interface support only read-only access to the set; read/write access is supported through the MutableSet interface.

Since Kotlin 1.3
interface Set<out E> : Collection<E>

A generic unordered collection of elements that does not support duplicate elements. Methods in this interface support only read-only access to the set; read/write access is supported through the MutableSet interface.

Since Kotlin 1.8
interface Set<out E> : Collection<E>

A generic unordered collection of elements that does not support duplicate elements. Methods in this interface support only read-only access to the set; read/write access is supported through the MutableSet interface.

Since Kotlin 1.8
Link copied to clipboard
abstract class ShortIterator : Iterator<Short>

An iterator over a sequence of values of type Short.

Since Kotlin 1.0

Properties

Link copied to clipboard
val <T> Array<out T>.indices: IntRange

Returns the range of valid indices for the array.

Since Kotlin 1.0

Returns the range of valid indices for the array.

Since Kotlin 1.3

Returns an IntRange of the valid indices for this collection.

Since Kotlin 1.0
Link copied to clipboard
val <T> Array<out T>.lastIndex: Int

Returns the last valid index for the array.

Since Kotlin 1.0

Returns the last valid index for the array.

Since Kotlin 1.3
val <T> List<T>.lastIndex: Int

Returns the index of the last item in the list or -1 if the list is empty.

Since Kotlin 1.0

Functions

Link copied to clipboard
fun <T> MutableCollection<in T>.addAll(elements: Array<out T>): Boolean

Adds all elements of the given elements array to this MutableCollection.

Since Kotlin 1.0
fun <T> MutableCollection<in T>.addAll(elements: Iterable<T>): Boolean

Adds all elements of the given elements collection to this MutableCollection.

Since Kotlin 1.0
fun <T> MutableCollection<in T>.addAll(elements: Sequence<T>): Boolean

Adds all elements of the given elements sequence to this MutableCollection.

Since Kotlin 1.0
Link copied to clipboard
inline fun <T, K, R> Grouping<T, K>.aggregate(operation: (key: K, accumulator: R?, element: T, first: Boolean) -> R): Map<K, R>

Groups elements from the Grouping source by key and applies operation to the elements of each group sequentially, passing the previously accumulated value and the current element as arguments, and stores the results in a new map.

Since Kotlin 1.1
Link copied to clipboard
inline fun <T, K, R, M : MutableMap<in K, R>> Grouping<T, K>.aggregateTo(destination: M, operation: (key: K, accumulator: R?, element: T, first: Boolean) -> R): M

Groups elements from the Grouping source by key and applies operation to the elements of each group sequentially, passing the previously accumulated value and the current element as arguments, and stores the results in the given destination map.

Since Kotlin 1.1
Link copied to clipboard
inline fun <T> Array<out T>.all(predicate: (T) -> Boolean): Boolean
inline fun BooleanArray.all(predicate: (Boolean) -> Boolean): Boolean
inline fun ByteArray.all(predicate: (Byte) -> Boolean): Boolean
inline fun CharArray.all(predicate: (Char) -> Boolean): Boolean
inline fun DoubleArray.all(predicate: (Double) -> Boolean): Boolean
inline fun FloatArray.all(predicate: (Float) -> Boolean): Boolean
inline fun IntArray.all(predicate: (Int) -> Boolean): Boolean
inline fun LongArray.all(predicate: (Long) -> Boolean): Boolean
inline fun ShortArray.all(predicate: (Short) -> Boolean): Boolean
inline fun <T> Iterable<T>.all(predicate: (T) -> Boolean): Boolean

Returns true if all elements match the given predicate.

Since Kotlin 1.0

Returns true if all elements match the given predicate.

Since Kotlin 1.3
inline fun <K, V> Map<out K, V>.all(predicate: (Map.Entry<K, V>) -> Boolean): Boolean

Returns true if all entries match the given predicate.

Since Kotlin 1.0
Link copied to clipboard
fun <T> Array<out T>.any(): Boolean

Returns true if array has at least one element.

Since Kotlin 1.0

Returns true if array has at least one element.

Since Kotlin 1.3
fun <T> Iterable<T>.any(): Boolean

Returns true if collection has at least one element.

Since Kotlin 1.0
fun <K, V> Map<out K, V>.any(): Boolean

Returns true if map has at least one entry.

Since Kotlin 1.0
inline fun <T> Array<out T>.any(predicate: (T) -> Boolean): Boolean
inline fun BooleanArray.any(predicate: (Boolean) -> Boolean): Boolean
inline fun ByteArray.any(predicate: (Byte) -> Boolean): Boolean
inline fun CharArray.any(predicate: (Char) -> Boolean): Boolean
inline fun DoubleArray.any(predicate: (Double) -> Boolean): Boolean
inline fun FloatArray.any(predicate: (Float) -> Boolean): Boolean
inline fun IntArray.any(predicate: (Int) -> Boolean): Boolean
inline fun LongArray.any(predicate: (Long) -> Boolean): Boolean
inline fun ShortArray.any(predicate: (Short) -> Boolean): Boolean
inline fun <T> Iterable<T>.any(predicate: (T) -> Boolean): Boolean

Returns true if at least one element matches the given predicate.

Since Kotlin 1.0

Returns true if at least one element matches the given predicate.

Since Kotlin 1.3
inline fun <K, V> Map<out K, V>.any(predicate: (Map.Entry<K, V>) -> Boolean): Boolean

Returns true if at least one entry matches the given predicate.

Since Kotlin 1.0
Link copied to clipboard
inline fun <T> arrayListOf(): ArrayList<T>

Returns an empty new ArrayList.

Since Kotlin 1.1
fun <T> arrayListOf(vararg elements: T): ArrayList<T>

Returns a new ArrayList with the given elements.

Since Kotlin 1.0
Link copied to clipboard

Returns an array of type ByteArray, which is a view of this array where each element is a signed reinterpretation of the corresponding element of this array.

Since Kotlin 1.3
Link copied to clipboard

Returns an array of type IntArray, which is a view of this array where each element is a signed reinterpretation of the corresponding element of this array.

Since Kotlin 1.3
Link copied to clipboard
fun <T> Array<out T>.asIterable(): Iterable<T>

Creates an Iterable instance that wraps the original array returning its elements when being iterated.

Since Kotlin 1.0
inline fun <T> Iterable<T>.asIterable(): Iterable<T>

Returns this collection as an Iterable.

Since Kotlin 1.0
inline fun <K, V> Map<out K, V>.asIterable(): Iterable<Map.Entry<K, V>>

Creates an Iterable instance that wraps the original map returning its entries when being iterated.

Since Kotlin 1.0
Link copied to clipboard
expect fun <T> Array<out T>.asList(): List<T>
expect fun ByteArray.asList(): List<Byte>
expect fun CharArray.asList(): List<Char>
expect fun DoubleArray.asList(): List<Double>
expect fun FloatArray.asList(): List<Float>
expect fun IntArray.asList(): List<Int>
expect fun LongArray.asList(): List<Long>
expect fun ShortArray.asList(): List<Short>

Returns a List that wraps the original array.

Since Kotlin 1.0

Returns a List that wraps the original array.

Since Kotlin 1.3
actual fun <T> Array<out T>.asList(): List<T>
actual inline fun BooleanArray.asList(): List<Boolean>
actual inline fun ByteArray.asList(): List<Byte>
actual fun CharArray.asList(): List<Char>
actual inline fun DoubleArray.asList(): List<Double>
actual inline fun FloatArray.asList(): List<Float>
actual inline fun IntArray.asList(): List<Int>
actual inline fun LongArray.asList(): List<Long>
actual inline fun ShortArray.asList(): List<Short>

Returns a List that wraps the original array.

Since Kotlin 1.1

Returns a List that wraps the original array.

Since Kotlin 1.3
actual fun <T> Array<out T>.asList(): List<T>
actual fun ByteArray.asList(): List<Byte>
actual fun CharArray.asList(): List<Char>
actual fun DoubleArray.asList(): List<Double>
actual fun FloatArray.asList(): List<Float>
actual fun IntArray.asList(): List<Int>
actual fun LongArray.asList(): List<Long>
actual fun ShortArray.asList(): List<Short>

Returns a List that wraps the original array.

Since Kotlin 1.0

Returns a List that wraps the original array.

Since Kotlin 1.3
actual fun <T> Array<out T>.asList(): List<T>
actual fun ByteArray.asList(): List<Byte>
actual fun CharArray.asList(): List<Char>
actual fun DoubleArray.asList(): List<Double>
actual fun FloatArray.asList(): List<Float>
actual fun IntArray.asList(): List<Int>
actual fun LongArray.asList(): List<Long>
actual fun ShortArray.asList(): List<Short>

Returns a List that wraps the original array.

Since Kotlin 1.3
actual fun <T> Array<out T>.asList(): List<T>
actual fun ByteArray.asList(): List<Byte>
actual fun CharArray.asList(): List<Char>
actual fun DoubleArray.asList(): List<Double>
actual fun FloatArray.asList(): List<Float>
actual fun IntArray.asList(): List<Int>
actual fun LongArray.asList(): List<Long>
actual fun ShortArray.asList(): List<Short>

Returns a List that wraps the original array.

Since Kotlin 1.8
actual fun <T> Array<out T>.asList(): List<T>
actual fun ByteArray.asList(): List<Byte>
actual fun CharArray.asList(): List<Char>
actual fun DoubleArray.asList(): List<Double>
actual fun FloatArray.asList(): List<Float>
actual fun IntArray.asList(): List<Int>
actual fun LongArray.asList(): List<Long>
actual fun ShortArray.asList(): List<Short>

Returns a List that wraps the original array.

Since Kotlin 1.8
Link copied to clipboard

Returns an array of type LongArray, which is a view of this array where each element is a signed reinterpretation of the corresponding element of this array.

Since Kotlin 1.3
Link copied to clipboard
fun <T> List<T>.asReversed(): List<T>

Returns a reversed read-only view of the original List. All changes made in the original list will be reflected in the reversed one.

Since Kotlin 1.0
@JvmName(name = "asReversedMutable")
fun <T> MutableList<T>.asReversed(): MutableList<T>

Returns a reversed mutable view of the original mutable List. All changes made in the original list will be reflected in the reversed one and vice versa.

Since Kotlin 1.0
Link copied to clipboard
fun <T> Array<out T>.asSequence(): Sequence<T>

Creates a Sequence instance that wraps the original array returning its elements when being iterated.

Since Kotlin 1.0

Creates a Sequence instance that wraps the original collection returning its elements when being iterated.

Since Kotlin 1.0
fun <K, V> Map<out K, V>.asSequence(): Sequence<Map.Entry<K, V>>

Creates a Sequence instance that wraps the original map returning its entries when being iterated.

Since Kotlin 1.0
Link copied to clipboard

Returns an array of type ShortArray, which is a view of this array where each element is a signed reinterpretation of the corresponding element of this array.

Since Kotlin 1.3
Link copied to clipboard
inline fun <T, K, V> Array<out T>.associate(transform: (T) -> Pair<K, V>): Map<K, V>
inline fun <K, V> BooleanArray.associate(transform: (Boolean) -> Pair<K, V>): Map<K, V>
inline fun <K, V> ByteArray.associate(transform: (Byte) -> Pair<K, V>): Map<K, V>
inline fun <K, V> CharArray.associate(transform: (Char) -> Pair<K, V>): Map<K, V>
inline fun <K, V> DoubleArray.associate(transform: (Double) -> Pair<K, V>): Map<K, V>
inline fun <K, V> FloatArray.associate(transform: (Float) -> Pair<K, V>): Map<K, V>
inline fun <K, V> IntArray.associate(transform: (Int) -> Pair<K, V>): Map<K, V>
inline fun <K, V> LongArray.associate(transform: (Long) -> Pair<K, V>): Map<K, V>
inline fun <K, V> ShortArray.associate(transform: (Short) -> Pair<K, V>): Map<K, V>

Returns a Map containing key-value pairs provided by transform function applied to elements of the given array.

Since Kotlin 1.0
inline fun <T, K, V> Iterable<T>.associate(transform: (T) -> Pair<K, V>): Map<K, V>

Returns a Map containing key-value pairs provided by transform function applied to elements of the given collection.

Since Kotlin 1.0
Link copied to clipboard
inline fun <T, K> Array<out T>.associateBy(keySelector: (T) -> K): Map<K, T>
inline fun <K> BooleanArray.associateBy(keySelector: (Boolean) -> K): Map<K, Boolean>
inline fun <K> ByteArray.associateBy(keySelector: (Byte) -> K): Map<K, Byte>
inline fun <K> CharArray.associateBy(keySelector: (Char) -> K): Map<K, Char>
inline fun <K> DoubleArray.associateBy(keySelector: (Double) -> K): Map<K, Double>
inline fun <K> FloatArray.associateBy(keySelector: (Float) -> K): Map<K, Float>
inline fun <K> IntArray.associateBy(keySelector: (Int) -> K): Map<K, Int>
inline fun <K> LongArray.associateBy(keySelector: (Long) -> K): Map<K, Long>
inline fun <K> ShortArray.associateBy(keySelector: (Short) -> K): Map<K, Short>

Returns a Map containing the elements from the given array indexed by the key returned from keySelector function applied to each element.

Since Kotlin 1.0
inline fun <T, K> Iterable<T>.associateBy(keySelector: (T) -> K): Map<K, T>

Returns a Map containing the elements from the given collection indexed by the key returned from keySelector function applied to each element.

Since Kotlin 1.0
inline fun <T, K, V> Array<out T>.associateBy(keySelector: (T) -> K, valueTransform: (T) -> V): Map<K, V>
inline fun <K, V> BooleanArray.associateBy(keySelector: (Boolean) -> K, valueTransform: (Boolean) -> V): Map<K, V>
inline fun <K, V> ByteArray.associateBy(keySelector: (Byte) -> K, valueTransform: (Byte) -> V): Map<K, V>
inline fun <K, V> CharArray.associateBy(keySelector: (Char) -> K, valueTransform: (Char) -> V): Map<K, V>
inline fun <K, V> DoubleArray.associateBy(keySelector: (Double) -> K, valueTransform: (Double) -> V): Map<K, V>
inline fun <K, V> FloatArray.associateBy(keySelector: (Float) -> K, valueTransform: (Float) -> V): Map<K, V>
inline fun <K, V> IntArray.associateBy(keySelector: (Int) -> K, valueTransform: (Int) -> V): Map<K, V>
inline fun <K, V> LongArray.associateBy(keySelector: (Long) -> K, valueTransform: (Long) -> V): Map<K, V>
inline fun <K, V> ShortArray.associateBy(keySelector: (Short) -> K, valueTransform: (Short) -> V): Map<K, V>

Returns a Map containing the values provided by valueTransform and indexed by keySelector functions applied to elements of the given array.

Since Kotlin 1.0
inline fun <T, K, V> Iterable<T>.associateBy(keySelector: (T) -> K, valueTransform: (T) -> V): Map<K, V>

Returns a Map containing the values provided by valueTransform and indexed by keySelector functions applied to elements of the given collection.

Since Kotlin 1.0
Link copied to clipboard
inline fun <T, K, M : MutableMap<in K, in T>> Array<out T>.associateByTo(destination: M, keySelector: (T) -> K): M
inline fun <K, M : MutableMap<in K, in Boolean>> BooleanArray.associateByTo(destination: M, keySelector: (Boolean) -> K): M
inline fun <K, M : MutableMap<in K, in Byte>> ByteArray.associateByTo(destination: M, keySelector: (Byte) -> K): M
inline fun <K, M : MutableMap<in K, in Char>> CharArray.associateByTo(destination: M, keySelector: (Char) -> K): M
inline fun <K, M : MutableMap<in K, in Double>> DoubleArray.associateByTo(destination: M, keySelector: (Double) -> K): M
inline fun <K, M : MutableMap<in K, in Float>> FloatArray.associateByTo(destination: M, keySelector: (Float) -> K): M
inline fun <K, M : MutableMap<in K, in Int>> IntArray.associateByTo(destination: M, keySelector: (Int) -> K): M
inline fun <K, M : MutableMap<in K, in Long>> LongArray.associateByTo(destination: M, keySelector: (Long) -> K): M
inline fun <K, M : MutableMap<in K, in Short>> ShortArray.associateByTo(destination: M, keySelector: (Short) -> K): M

Populates and returns the destination mutable map with key-value pairs, where key is provided by the keySelector function applied to each element of the given array and value is the element itself.

Since Kotlin 1.0
inline fun <T, K, M : MutableMap<in K, in T>> Iterable<T>.associateByTo(destination: M, keySelector: (T) -> K): M

Populates and returns the destination mutable map with key-value pairs, where key is provided by the keySelector function applied to each element of the given collection and value is the element itself.

Since Kotlin 1.0
inline fun <T, K, V, M : MutableMap<in K, in V>> Array<out T>.associateByTo(destination: M, keySelector: (T) -> K, valueTransform: (T) -> V): M
inline fun <K, V, M : MutableMap<in K, in V>> BooleanArray.associateByTo(destination: M, keySelector: (Boolean) -> K, valueTransform: (Boolean) -> V): M
inline fun <K, V, M : MutableMap<in K, in V>> ByteArray.associateByTo(destination: M, keySelector: (Byte) -> K, valueTransform: (Byte) -> V): M
inline fun <K, V, M : MutableMap<in K, in V>> CharArray.associateByTo(destination: M, keySelector: (Char) -> K, valueTransform: (Char) -> V): M
inline fun <K, V, M : MutableMap<in K, in V>> DoubleArray.associateByTo(destination: M, keySelector: (Double) -> K, valueTransform: (Double) -> V): M
inline fun <K, V, M : MutableMap<in K, in V>> FloatArray.associateByTo(destination: M, keySelector: (Float) -> K, valueTransform: (Float) -> V): M
inline fun <K, V, M : MutableMap<in K, in V>> IntArray.associateByTo(destination: M, keySelector: (Int) -> K, valueTransform: (Int) -> V): M
inline fun <K, V, M : MutableMap<in K, in V>> LongArray.associateByTo(destination: M, keySelector: (Long) -> K, valueTransform: (Long) -> V): M
inline fun <K, V, M : MutableMap<in K, in V>> ShortArray.associateByTo(destination: M, keySelector: (Short) -> K, valueTransform: (Short) -> V): M

Populates and returns the destination mutable map with key-value pairs, where key is provided by the keySelector function and and value is provided by the valueTransform function applied to elements of the given array.

Since Kotlin 1.0
inline fun <T, K, V, M : MutableMap<in K, in V>> Iterable<T>.associateByTo(destination: M, keySelector: (T) -> K, valueTransform: (T) -> V): M

Populates and returns the destination mutable map with key-value pairs, where key is provided by the keySelector function and and value is provided by the valueTransform function applied to elements of the given collection.

Since Kotlin 1.0
Link copied to clipboard
inline fun <T, K, V, M : MutableMap<in K, in V>> Array<out T>.associateTo(destination: M, transform: (T) -> Pair<K, V>): M
inline fun <K, V, M : MutableMap<in K, in V>> BooleanArray.associateTo(destination: M, transform: (Boolean) -> Pair<K, V>): M
inline fun <K, V, M : MutableMap<in K, in V>> ByteArray.associateTo(destination: M, transform: (Byte) -> Pair<K, V>): M
inline fun <K, V, M : MutableMap<in K, in V>> CharArray.associateTo(destination: M, transform: (Char) -> Pair<K, V>): M
inline fun <K, V, M : MutableMap<in K, in V>> DoubleArray.associateTo(destination: M, transform: (Double) -> Pair<K, V>): M
inline fun <K, V, M : MutableMap<in K, in V>> FloatArray.associateTo(destination: M, transform: (Float) -> Pair<K, V>): M
inline fun <K, V, M : MutableMap<in K, in V>> IntArray.associateTo(destination: M, transform: (Int) -> Pair<K, V>): M
inline fun <K, V, M : MutableMap<in K, in V>> LongArray.associateTo(destination: M, transform: (Long) -> Pair<K, V>): M
inline fun <K, V, M : MutableMap<in K, in V>> ShortArray.associateTo(destination: M, transform: (Short) -> Pair<K, V>): M

Populates and returns the destination mutable map with key-value pairs provided by transform function applied to each element of the given array.

Since Kotlin 1.0
inline fun <T, K, V, M : MutableMap<in K, in V>> Iterable<T>.associateTo(destination: M, transform: (T) -> Pair<K, V>): M

Populates and returns the destination mutable map with key-value pairs provided by transform function applied to each element of the given collection.

Since Kotlin 1.0
Link copied to clipboard
inline fun <K, V> Array<out K>.associateWith(valueSelector: (K) -> V): Map<K, V>
inline fun <V> BooleanArray.associateWith(valueSelector: (Boolean) -> V): Map<Boolean, V>
inline fun <V> ByteArray.associateWith(valueSelector: (Byte) -> V): Map<Byte, V>
inline fun <V> CharArray.associateWith(valueSelector: (Char) -> V): Map<Char, V>
inline fun <V> DoubleArray.associateWith(valueSelector: (Double) -> V): Map<Double, V>
inline fun <V> FloatArray.associateWith(valueSelector: (Float) -> V): Map<Float, V>
inline fun <V> IntArray.associateWith(valueSelector: (Int) -> V): Map<Int, V>
inline fun <V> LongArray.associateWith(valueSelector: (Long) -> V): Map<Long, V>
inline fun <V> ShortArray.associateWith(valueSelector: (Short) -> V): Map<Short, V>
inline fun <V> UByteArray.associateWith(valueSelector: (UByte) -> V): Map<UByte, V>
inline fun <V> UIntArray.associateWith(valueSelector: (UInt) -> V): Map<UInt, V>
inline fun <V> ULongArray.associateWith(valueSelector: (ULong) -> V): Map<ULong, V>
inline fun <V> UShortArray.associateWith(valueSelector: (UShort) -> V): Map<UShort, V>

Returns a Map where keys are elements from the given array and values are produced by the valueSelector function applied to each element.

Since Kotlin 1.4
inline fun <K, V> Iterable<K>.associateWith(valueSelector: (K) -> V): Map<K, V>

Returns a Map where keys are elements from the given collection and values are produced by the valueSelector function applied to each element.

Since Kotlin 1.3
Link copied to clipboard
inline fun <K, V, M : MutableMap<in K, in V>> Array<out K>.associateWithTo(destination: M, valueSelector: (K) -> V): M
inline fun <V, M : MutableMap<in Boolean, in V>> BooleanArray.associateWithTo(destination: M, valueSelector: (Boolean) -> V): M
inline fun <V, M : MutableMap<in Byte, in V>> ByteArray.associateWithTo(destination: M, valueSelector: (Byte) -> V): M
inline fun <V, M : MutableMap<in Char, in V>> CharArray.associateWithTo(destination: M, valueSelector: (Char) -> V): M
inline fun <V, M : MutableMap<in Double, in V>> DoubleArray.associateWithTo(destination: M, valueSelector: (Double) -> V): M
inline fun <V, M : MutableMap<in Float, in V>> FloatArray.associateWithTo(destination: M, valueSelector: (Float) -> V): M
inline fun <V, M : MutableMap<in Int, in V>> IntArray.associateWithTo(destination: M, valueSelector: (Int) -> V): M
inline fun <V, M : MutableMap<in Long, in V>> LongArray.associateWithTo(destination: M, valueSelector: (Long) -> V): M
inline fun <V, M : MutableMap<in Short, in V>> ShortArray.associateWithTo(destination: M, valueSelector: (Short) -> V): M
inline fun <V, M : MutableMap<in UByte, in V>> UByteArray.associateWithTo(destination: M, valueSelector: (UByte) -> V): M
inline fun <V, M : MutableMap<in UInt, in V>> UIntArray.associateWithTo(destination: M, valueSelector: (UInt) -> V): M
inline fun <V, M : MutableMap<in ULong, in V>> ULongArray.associateWithTo(destination: M, valueSelector: (ULong) -> V): M
inline fun <V, M : MutableMap<in UShort, in V>> UShortArray.associateWithTo(destination: M, valueSelector: (UShort) -> V): M

Populates and returns the destination mutable map with key-value pairs for each element of the given array, where key is the element itself and value is provided by the valueSelector function applied to that key.

Since Kotlin 1.4
inline fun <K, V, M : MutableMap<in K, in V>> Iterable<K>.associateWithTo(destination: M, valueSelector: (K) -> V): M

Populates and returns the destination mutable map with key-value pairs for each element of the given collection, where key is the element itself and value is provided by the valueSelector function applied to that key.

Since Kotlin 1.3
Link copied to clipboard

Returns an array of type UByteArray, which is a view of this array where each element is an unsigned reinterpretation of the corresponding element of this array.

Since Kotlin 1.3
Link copied to clipboard

Returns an array of type UIntArray, which is a view of this array where each element is an unsigned reinterpretation of the corresponding element of this array.

Since Kotlin 1.3
Link copied to clipboard

Returns an array of type ULongArray, which is a view of this array where each element is an unsigned reinterpretation of the corresponding element of this array.

Since Kotlin 1.3
Link copied to clipboard

Returns an array of type UShortArray, which is a view of this array where each element is an unsigned reinterpretation of the corresponding element of this array.

Since Kotlin 1.3
Link copied to clipboard
@JvmName(name = "averageOfByte")
fun Array<out Byte>.average(): Double
@JvmName(name = "averageOfDouble")
fun Array<out Double>.average(): Double
@JvmName(name = "averageOfFloat")
fun Array<out Float>.average(): Double
@JvmName(name = "averageOfInt")
fun Array<out Int>.average(): Double
@JvmName(name = "averageOfLong")
fun Array<out Long>.average(): Double
@JvmName(name = "averageOfShort")
fun Array<out Short>.average(): Double

Returns an average value of elements in the array.

Since Kotlin 1.0
@JvmName(name = "averageOfByte")
fun Iterable<Byte>.average(): Double
@JvmName(name = "averageOfDouble")
fun Iterable<Double>.average(): Double
@JvmName(name = "averageOfFloat")
fun Iterable<Float>.average(): Double
@JvmName(name = "averageOfInt")
fun Iterable<Int>.average(): Double
@JvmName(name = "averageOfLong")
fun Iterable<Long>.average(): Double
@JvmName(name = "averageOfShort")
fun Iterable<Short>.average(): Double

Returns an average value of elements in the collection.

Since Kotlin 1.0
Link copied to clipboard
fun <T> List<T>.binarySearch(fromIndex: Int = 0, toIndex: Int = size, comparison: (T) -> Int): Int

Searches this list or its range for an element for which the given comparison function returns zero using the binary search algorithm.

Since Kotlin 1.0
fun <T : Comparable<T>> List<T?>.binarySearch(element: T?, fromIndex: Int = 0, toIndex: Int = size): Int

Searches this list or its range for the provided element using the binary search algorithm. The list is expected to be sorted into ascending order according to the Comparable natural ordering of its elements, otherwise the result is undefined.

Since Kotlin 1.0
fun <T> List<T>.binarySearch(element: T, comparator: Comparator<in T>, fromIndex: Int = 0, toIndex: Int = size): Int

Searches this list or its range for the provided element using the binary search algorithm. The list is expected to be sorted into ascending order according to the specified comparator, otherwise the result is undefined.

Since Kotlin 1.0
fun <T> Array<out T>.binarySearch(element: T, fromIndex: Int = 0, toIndex: Int = size): Int
fun ByteArray.binarySearch(element: Byte, fromIndex: Int = 0, toIndex: Int = size): Int
fun CharArray.binarySearch(element: Char, fromIndex: Int = 0, toIndex: Int = size): Int
fun DoubleArray.binarySearch(element: Double, fromIndex: Int = 0, toIndex: Int = size): Int
fun FloatArray.binarySearch(element: Float, fromIndex: Int = 0, toIndex: Int = size): Int
fun IntArray.binarySearch(element: Int, fromIndex: Int = 0, toIndex: Int = size): Int
fun LongArray.binarySearch(element: Long, fromIndex: Int = 0, toIndex: Int = size): Int
fun ShortArray.binarySearch(element: Short, fromIndex: Int = 0, toIndex: Int = size): Int

Searches the array or the range of the array for the provided element using the binary search algorithm. The array is expected to be sorted, otherwise the result is undefined.

Since Kotlin 1.0
fun UByteArray.binarySearch(element: UByte, fromIndex: Int = 0, toIndex: Int = size): Int
fun UIntArray.binarySearch(element: UInt, fromIndex: Int = 0, toIndex: Int = size): Int
fun ULongArray.binarySearch(element: ULong, fromIndex: Int = 0, toIndex: Int = size): Int
fun UShortArray.binarySearch(element: UShort, fromIndex: Int = 0, toIndex: Int = size): Int

Searches the array or the range of the array for the provided element using the binary search algorithm. The array is expected to be sorted, otherwise the result is undefined.

Since Kotlin 1.3
fun <T> Array<out T>.binarySearch(element: T, comparator: Comparator<in T>, fromIndex: Int = 0, toIndex: Int = size): Int

Searches the array or the range of the array for the provided element using the binary search algorithm. The array is expected to be sorted according to the specified comparator, otherwise the result is undefined.

Since Kotlin 1.0
Link copied to clipboard
inline fun <T, K : Comparable<K>> List<T>.binarySearchBy(key: K?, fromIndex: Int = 0, toIndex: Int = size, crossinline selector: (T) -> K?): Int

Searches this list or its range for an element having the key returned by the specified selector function equal to the provided key value using the binary search algorithm. The list is expected to be sorted into ascending order according to the Comparable natural ordering of keys of its elements. otherwise the result is undefined.

Since Kotlin 1.0
Link copied to clipboard
inline fun <E> buildList(builderAction: MutableList<E>.() -> Unit): List<E>
inline fun <E> buildList(capacity: Int, builderAction: MutableList<E>.() -> Unit): List<E>

Builds a new read-only List by populating a MutableList using the given builderAction and returning a read-only list with the same elements.

Since Kotlin 1.6
Link copied to clipboard
inline fun <K, V> buildMap(builderAction: MutableMap<K, V>.() -> Unit): Map<K, V>
inline fun <K, V> buildMap(capacity: Int, builderAction: MutableMap<K, V>.() -> Unit): Map<K, V>

Builds a new read-only Map by populating a MutableMap using the given builderAction and returning a read-only map with the same key-value pairs.

Since Kotlin 1.6
Link copied to clipboard
inline fun <E> buildSet(builderAction: MutableSet<E>.() -> Unit): Set<E>
inline fun <E> buildSet(capacity: Int, builderAction: MutableSet<E>.() -> Unit): Set<E>

Builds a new read-only Set by populating a MutableSet using the given builderAction and returning a read-only set with the same elements.

Since Kotlin 1.6
Link copied to clipboard
fun <T> Iterable<T>.chunked(size: Int): List<List<T>>

Splits this collection into a list of lists each not exceeding the given size.

Since Kotlin 1.2
fun <T, R> Iterable<T>.chunked(size: Int, transform: (List<T>) -> R): List<R>

Splits this collection into several lists each not exceeding the given size and applies the given transform function to an each.

Since Kotlin 1.2
Link copied to clipboard
inline operator fun <T> Array<out T>.component1(): T
inline operator fun BooleanArray.component1(): Boolean
inline operator fun ByteArray.component1(): Byte
inline operator fun CharArray.component1(): Char
inline operator fun DoubleArray.component1(): Double
inline operator fun FloatArray.component1(): Float
inline operator fun IntArray.component1(): Int
inline operator fun LongArray.component1(): Long
inline operator fun ShortArray.component1(): Short

Returns 1st element from the array.

Since Kotlin 1.0

Returns 1st element from the array.

Since Kotlin 1.3
inline operator fun <T> List<T>.component1(): T

Returns 1st element from the list.

Since Kotlin 1.0
inline operator fun <K, V> Map.Entry<K, V>.component1(): K

Returns the key component of the map entry.

Since Kotlin 1.0
Link copied to clipboard
inline operator fun <T> Array<out T>.component2(): T
inline operator fun BooleanArray.component2(): Boolean
inline operator fun ByteArray.component2(): Byte
inline operator fun CharArray.component2(): Char
inline operator fun DoubleArray.component2(): Double
inline operator fun FloatArray.component2(): Float
inline operator fun IntArray.component2(): Int
inline operator fun LongArray.component2(): Long
inline operator fun ShortArray.component2(): Short

Returns 2nd element from the array.

Since Kotlin 1.0

Returns 2nd element from the array.

Since Kotlin 1.3
inline operator fun <T> List<T>.component2(): T

Returns 2nd element from the list.

Since Kotlin 1.0
inline operator fun <K, V> Map.Entry<K, V>.component2(): V

Returns the value component of the map entry.

Since Kotlin 1.0
Link copied to clipboard
inline operator fun <T> Array<out T>.component3(): T
inline operator fun BooleanArray.component3(): Boolean
inline operator fun ByteArray.component3(): Byte
inline operator fun CharArray.component3(): Char
inline operator fun DoubleArray.component3(): Double
inline operator fun FloatArray.component3(): Float
inline operator fun IntArray.component3(): Int
inline operator fun LongArray.component3(): Long
inline operator fun ShortArray.component3(): Short

Returns 3rd element from the array.

Since Kotlin 1.0

Returns 3rd element from the array.

Since Kotlin 1.3
inline operator fun <T> List<T>.component3(): T

Returns 3rd element from the list.

Since Kotlin 1.0
Link copied to clipboard
inline operator fun <T> Array<out T>.component4(): T
inline operator fun BooleanArray.component4(): Boolean
inline operator fun ByteArray.component4(): Byte
inline operator fun CharArray.component4(): Char
inline operator fun DoubleArray.component4(): Double
inline operator fun FloatArray.component4(): Float
inline operator fun IntArray.component4(): Int
inline operator fun LongArray.component4(): Long
inline operator fun ShortArray.component4(): Short

Returns 4th element from the array.

Since Kotlin 1.0

Returns 4th element from the array.

Since Kotlin 1.3
inline operator fun <T> List<T>.component4(): T

Returns 4th element from the list.

Since Kotlin 1.0
Link copied to clipboard
inline operator fun <T> Array<out T>.component5(): T
inline operator fun BooleanArray.component5(): Boolean
inline operator fun ByteArray.component5(): Byte
inline operator fun CharArray.component5(): Char
inline operator fun DoubleArray.component5(): Double
inline operator fun FloatArray.component5(): Float
inline operator fun IntArray.component5(): Int
inline operator fun LongArray.component5(): Long
inline operator fun ShortArray.component5(): Short

Returns 5th element from the array.

Since Kotlin 1.0

Returns 5th element from the array.

Since Kotlin 1.3
inline operator fun <T> List<T>.component5(): T

Returns 5th element from the list.

Since Kotlin 1.0
Link copied to clipboard
operator fun <T> Array<out T>.contains(element: T): Boolean
operator fun BooleanArray.contains(element: Boolean): Boolean
operator fun ByteArray.contains(element: Byte): Boolean
operator fun CharArray.contains(element: Char): Boolean
operator fun DoubleArray.contains(element: Double): Boolean
operator fun FloatArray.contains(element: Float): Boolean
operator fun IntArray.contains(element: Int): Boolean
operator fun LongArray.contains(element: Long): Boolean
operator fun ShortArray.contains(element: Short): Boolean

Returns true if element is found in the array.

Since Kotlin 1.0
operator fun <T> Iterable<T>.contains(element: T): Boolean

Returns true if element is found in the collection.

Since Kotlin 1.0
inline operator fun <K, V> Map<out K, V>.contains(key: K): Boolean

Checks if the map contains the given key.

Since Kotlin 1.0
Link copied to clipboard
inline fun <T> Collection<T>.containsAll(elements: Collection<T>): Boolean

Checks if all elements in the specified collection are contained in this collection.

Since Kotlin 1.0
Link copied to clipboard
inline fun <K> Map<out K, *>.containsKey(key: K): Boolean

Returns true if the map contains the specified key.

Since Kotlin 1.0
Link copied to clipboard
inline fun <K, V> Map<K, V>.containsValue(value: V): Boolean

Returns true if the map maps one or more keys to the specified value.

Since Kotlin 1.0
Link copied to clipboard
expect infix fun <T> Array<out T>.contentDeepEquals(other: Array<out T>): Boolean

Checks if the two specified arrays are deeply equal to one another.

Since Kotlin 1.1
expect infix fun <T> Array<out T>?.contentDeepEquals(other: Array<out T>?): Boolean

Checks if the two specified arrays are deeply equal to one another.

Since Kotlin 1.4
actual infix fun <T> Array<out T>.contentDeepEquals(other: Array<out T>): Boolean

Checks if the two specified arrays are deeply equal to one another.

Since Kotlin 1.1
actual infix fun <T> Array<out T>?.contentDeepEquals(other: Array<out T>?): Boolean

Checks if the two specified arrays are deeply equal to one another.

Since Kotlin 1.4
@JvmName(name = "contentDeepEqualsInline")
actual infix inline fun <T> Array<out T>.contentDeepEquals(other: Array<out T>): Boolean

Checks if the two specified arrays are deeply equal to one another.

Since Kotlin 1.1
@JvmName(name = "contentDeepEqualsNullable")
actual infix inline fun <T> Array<out T>?.contentDeepEquals(other: Array<out T>?): Boolean

Checks if the two specified arrays are deeply equal to one another.

Since Kotlin 1.4
actual infix fun <T> Array<out T>.contentDeepEquals(other: Array<out T>): Boolean

Checks if the two specified arrays are deeply equal to one another.

Since Kotlin 1.3
actual infix fun <T> Array<out T>?.contentDeepEquals(other: Array<out T>?): Boolean

Checks if the two specified arrays are deeply equal to one another.

Since Kotlin 1.4
actual infix fun <T> Array<out T>.contentDeepEquals(other: Array<out T>): Boolean
actual infix fun <T> Array<out T>?.contentDeepEquals(other: Array<out T>?): Boolean

Checks if the two specified arrays are deeply equal to one another.

Since Kotlin 1.8
actual infix fun <T> Array<out T>.contentDeepEquals(other: Array<out T>): Boolean
actual infix fun <T> Array<out T>?.contentDeepEquals(other: Array<out T>?): Boolean

Checks if the two specified arrays are deeply equal to one another.

Since Kotlin 1.8
Link copied to clipboard
expect fun <T> Array<out T>.contentDeepHashCode(): Int

Returns a hash code based on the contents of this array as if it is List. Nested arrays are treated as lists too.

Since Kotlin 1.1
expect fun <T> Array<out T>?.contentDeepHashCode(): Int

Returns a hash code based on the contents of this array as if it is List. Nested arrays are treated as lists too.

Since Kotlin 1.4
actual fun <T> Array<out T>.contentDeepHashCode(): Int

Returns a hash code based on the contents of this array as if it is List. Nested arrays are treated as lists too.

Since Kotlin 1.1
actual fun <T> Array<out T>?.contentDeepHashCode(): Int

Returns a hash code based on the contents of this array as if it is List. Nested arrays are treated as lists too.

Since Kotlin 1.4
@JvmName(name = "contentDeepHashCodeInline")
actual inline fun <T> Array<out T>.contentDeepHashCode(): Int

Returns a hash code based on the contents of this array as if it is List. Nested arrays are treated as lists too.

Since Kotlin 1.1
@JvmName(name = "contentDeepHashCodeNullable")
actual inline fun <T> Array<out T>?.contentDeepHashCode(): Int

Returns a hash code based on the contents of this array as if it is List. Nested arrays are treated as lists too.

Since Kotlin 1.4
actual fun <T> Array<out T>.contentDeepHashCode(): Int

Returns a hash code based on the contents of this array as if it is List. Nested arrays are treated as lists too.

Since Kotlin 1.3
actual fun <T> Array<out T>?.contentDeepHashCode(): Int

Returns a hash code based on the contents of this array as if it is List. Nested arrays are treated as lists too.

Since Kotlin 1.4
actual fun <T> Array<out T>.contentDeepHashCode(): Int
actual fun <T> Array<out T>?.contentDeepHashCode(): Int

Returns a hash code based on the contents of this array as if it is List. Nested arrays are treated as lists too.

Since Kotlin 1.8
actual fun <T> Array<out T>.contentDeepHashCode(): Int
actual fun <T> Array<out T>?.contentDeepHashCode(): Int

Returns a hash code based on the contents of this array as if it is List. Nested arrays are treated as lists too.

Since Kotlin 1.8
Link copied to clipboard
expect fun <T> Array<out T>.contentDeepToString(): String

Returns a string representation of the contents of this array as if it is a List. Nested arrays are treated as lists too.

Since Kotlin 1.1
expect fun <T> Array<out T>?.contentDeepToString(): String

Returns a string representation of the contents of this array as if it is a List. Nested arrays are treated as lists too.

Since Kotlin 1.4
actual fun <T> Array<out T>.contentDeepToString(): String

Returns a string representation of the contents of this array as if it is a List. Nested arrays are treated as lists too.

Since Kotlin 1.1
actual fun <T> Array<out T>?.contentDeepToString(): String

Returns a string representation of the contents of this array as if it is a List. Nested arrays are treated as lists too.

Since Kotlin 1.4
@JvmName(name = "contentDeepToStringInline")
actual inline fun <T> Array<out T>.contentDeepToString(): String

Returns a string representation of the contents of this array as if it is a List. Nested arrays are treated as lists too.

Since Kotlin 1.1
@JvmName(name = "contentDeepToStringNullable")
actual inline fun <T> Array<out T>?.contentDeepToString(): String

Returns a string representation of the contents of this array as if it is a List. Nested arrays are treated as lists too.

Since Kotlin 1.4
actual fun <T> Array<out T>.contentDeepToString(): String

Returns a string representation of the contents of this array as if it is a List. Nested arrays are treated as lists too.

Since Kotlin 1.3
actual fun <T> Array<out T>?.contentDeepToString(): String

Returns a string representation of the contents of this array as if it is a List. Nested arrays are treated as lists too.

Since Kotlin 1.4
actual fun <T> Array<out T>.contentDeepToString(): String
actual fun <T> Array<out T>?.contentDeepToString(): String

Returns a string representation of the contents of this array as if it is a List. Nested arrays are treated as lists too.

Since Kotlin 1.8
actual fun <T> Array<out T>.contentDeepToString(): String
actual fun <T> Array<out T>?.contentDeepToString(): String

Returns a string representation of the contents of this array as if it is a List. Nested arrays are treated as lists too.

Since Kotlin 1.8
Link copied to clipboard
expect infix fun <T> Array<out T>?.contentEquals(other: Array<out T>?): Boolean
expect infix fun BooleanArray?.contentEquals(other: BooleanArray?): Boolean
expect infix fun ByteArray?.contentEquals(other: ByteArray?): Boolean
expect infix fun CharArray?.contentEquals(other: CharArray?): Boolean
expect infix fun DoubleArray?.contentEquals(other: DoubleArray?): Boolean
expect infix fun FloatArray?.contentEquals(other: FloatArray?): Boolean
expect infix fun IntArray?.contentEquals(other: IntArray?): Boolean
expect infix fun LongArray?.contentEquals(other: LongArray?): Boolean
expect infix fun ShortArray?.contentEquals(other: ShortArray?): Boolean

Checks if the two specified arrays are structurally equal to one another.

Since Kotlin 1.4
actual infix fun <T> Array<out T>?.contentEquals(other: Array<out T>?): Boolean
actual infix fun BooleanArray?.contentEquals(other: BooleanArray?): Boolean
actual infix fun ByteArray?.contentEquals(other: ByteArray?): Boolean
actual infix fun CharArray?.contentEquals(other: CharArray?): Boolean
actual infix fun DoubleArray?.contentEquals(other: DoubleArray?): Boolean
actual infix fun FloatArray?.contentEquals(other: FloatArray?): Boolean
actual infix fun IntArray?.contentEquals(other: IntArray?): Boolean
actual infix fun LongArray?.contentEquals(other: LongArray?): Boolean
actual infix fun ShortArray?.contentEquals(other: ShortArray?): Boolean

Checks if the two specified arrays are structurally equal to one another.

Since Kotlin 1.4
actual infix inline fun <T> Array<out T>?.contentEquals(other: Array<out T>?): Boolean
actual infix inline fun BooleanArray?.contentEquals(other: BooleanArray?): Boolean
actual infix inline fun ByteArray?.contentEquals(other: ByteArray?): Boolean
actual infix inline fun CharArray?.contentEquals(other: CharArray?): Boolean
actual infix inline fun DoubleArray?.contentEquals(other: DoubleArray?): Boolean
actual infix inline fun FloatArray?.contentEquals(other: FloatArray?): Boolean
actual infix inline fun IntArray?.contentEquals(other: IntArray?): Boolean
actual infix inline fun LongArray?.contentEquals(other: LongArray?): Boolean
actual infix inline fun ShortArray?.contentEquals(other: ShortArray?): Boolean

Checks if the two specified arrays are structurally equal to one another.

Since Kotlin 1.4
infix fun <T> Array<out T>.contentEquals(other: Array<out T>): Boolean

Checks if the two specified arrays are structurally equal to one another.

Since Kotlin 1.3
actual infix fun <T> Array<out T>?.contentEquals(other: Array<out T>?): Boolean
actual infix fun BooleanArray?.contentEquals(other: BooleanArray?): Boolean
actual infix fun ByteArray?.contentEquals(other: ByteArray?): Boolean
actual infix fun CharArray?.contentEquals(other: CharArray?): Boolean
actual infix fun DoubleArray?.contentEquals(other: DoubleArray?): Boolean
actual infix fun FloatArray?.contentEquals(other: FloatArray?): Boolean
actual infix fun IntArray?.contentEquals(other: IntArray?): Boolean
actual infix fun LongArray?.contentEquals(other: LongArray?): Boolean
actual infix fun ShortArray?.contentEquals(other: ShortArray?): Boolean

Checks if the two specified arrays are structurally equal to one another.

Since Kotlin 1.4
infix fun <T> Array<out T>.contentEquals(other: Array<out T>): Boolean
actual infix fun <T> Array<out T>?.contentEquals(other: Array<out T>?): Boolean
actual infix fun BooleanArray?.contentEquals(other: BooleanArray?): Boolean
actual infix fun ByteArray?.contentEquals(other: ByteArray?): Boolean
actual infix fun CharArray?.contentEquals(other: CharArray?): Boolean
actual infix fun DoubleArray?.contentEquals(other: DoubleArray?): Boolean
actual infix fun FloatArray?.contentEquals(other: FloatArray?): Boolean
actual infix fun IntArray?.contentEquals(other: IntArray?): Boolean
actual infix fun LongArray?.contentEquals(other: LongArray?): Boolean
actual infix fun ShortArray?.contentEquals(other: ShortArray?): Boolean

Checks if the two specified arrays are structurally equal to one another.

Since Kotlin 1.8
infix fun <T> Array<out T>.contentEquals(other: Array<out T>): Boolean
actual infix fun <T> Array<out T>?.contentEquals(other: Array<out T>?): Boolean
actual infix fun BooleanArray?.contentEquals(other: BooleanArray?): Boolean
actual infix fun ByteArray?.contentEquals(other: ByteArray?): Boolean
actual infix fun CharArray?.contentEquals(other: CharArray?): Boolean
actual infix fun DoubleArray?.contentEquals(other: DoubleArray?): Boolean
actual infix fun FloatArray?.contentEquals(other: FloatArray?): Boolean
actual infix fun IntArray?.contentEquals(other: IntArray?): Boolean
actual infix fun LongArray?.contentEquals(other: LongArray?): Boolean
actual infix fun ShortArray?.contentEquals(other: ShortArray?): Boolean

Checks if the two specified arrays are structurally equal to one another.

Since Kotlin 1.8
Link copied to clipboard
actual fun <T> Array<out T>?.contentHashCode(): Int

Returns a hash code based on the contents of this array as if it is List.

Since Kotlin 1.4
actual inline fun <T> Array<out T>?.contentHashCode(): Int
actual inline fun BooleanArray?.contentHashCode(): Int
actual inline fun ByteArray?.contentHashCode(): Int
actual inline fun CharArray?.contentHashCode(): Int
actual inline fun DoubleArray?.contentHashCode(): Int
actual inline fun FloatArray?.contentHashCode(): Int
actual inline fun IntArray?.contentHashCode(): Int
actual inline fun LongArray?.contentHashCode(): Int
actual inline fun ShortArray?.contentHashCode(): Int

Returns a hash code based on the contents of this array as if it is List.

Since Kotlin 1.4
Link copied to clipboard
actual fun <T> Array<out T>?.contentToString(): String

Returns a string representation of the contents of the specified array as if it is List.

Since Kotlin 1.4
actual inline fun <T> Array<out T>?.contentToString(): String
actual inline fun BooleanArray?.contentToString(): String
actual inline fun ByteArray?.contentToString(): String
actual inline fun CharArray?.contentToString(): String
actual inline fun DoubleArray?.contentToString(): String
actual inline fun FloatArray?.contentToString(): String
actual inline fun IntArray?.contentToString(): String
actual inline fun LongArray?.contentToString(): String
actual inline fun ShortArray?.contentToString(): String

Returns a string representation of the contents of the specified array as if it is List.

Since Kotlin 1.4
Link copied to clipboard
expect fun <T> Array<out T>.copyInto(destination: Array<T>, destinationOffset: Int = 0, startIndex: Int = 0, endIndex: Int = size): Array<T>
expect fun BooleanArray.copyInto(destination: BooleanArray, destinationOffset: Int = 0, startIndex: Int = 0, endIndex: Int = size): BooleanArray
expect fun ByteArray.copyInto(destination: ByteArray, destinationOffset: Int = 0, startIndex: Int = 0, endIndex: Int = size): ByteArray
expect fun CharArray.copyInto(destination: CharArray, destinationOffset: Int = 0, startIndex: Int = 0, endIndex: Int = size): CharArray
expect fun DoubleArray.copyInto(destination: DoubleArray, destinationOffset: Int = 0, startIndex: Int = 0, endIndex: Int = size): DoubleArray
expect fun FloatArray.copyInto(destination: FloatArray, destinationOffset: Int = 0, startIndex: Int = 0, endIndex: Int = size): FloatArray
expect fun IntArray.copyInto(destination: IntArray, destinationOffset: Int = 0, startIndex: Int = 0, endIndex: Int = size): IntArray
expect fun LongArray.copyInto(destination: LongArray, destinationOffset: Int = 0, startIndex: Int = 0, endIndex: Int = size): LongArray
expect fun ShortArray.copyInto(destination: ShortArray, destinationOffset: Int = 0, startIndex: Int = 0, endIndex: Int = size): ShortArray
inline fun UByteArray.copyInto(destination: UByteArray, destinationOffset: Int = 0, startIndex: Int = 0, endIndex: Int = size): UByteArray
inline fun UIntArray.copyInto(destination: UIntArray, destinationOffset: Int = 0, startIndex: Int = 0, endIndex: Int = size): UIntArray
inline fun ULongArray.copyInto(destination: ULongArray, destinationOffset: Int = 0, startIndex: Int = 0, endIndex: Int = size): ULongArray
inline fun UShortArray.copyInto(destination: UShortArray, destinationOffset: Int = 0, startIndex: Int = 0, endIndex: Int = size): UShortArray

Copies this array or its subrange into the destination array and returns that array.

Since Kotlin 1.3
actual inline fun <T> Array<out T>.copyInto(destination: Array<T>, destinationOffset: Int = 0, startIndex: Int = 0, endIndex: Int = size): Array<T>
actual inline fun BooleanArray.copyInto(destination: BooleanArray, destinationOffset: Int = 0, startIndex: Int = 0, endIndex: Int = size): BooleanArray
actual inline fun ByteArray.copyInto(destination: ByteArray, destinationOffset: Int = 0, startIndex: Int = 0, endIndex: Int = size): ByteArray
actual inline fun CharArray.copyInto(destination: CharArray, destinationOffset: Int = 0, startIndex: Int = 0, endIndex: Int = size): CharArray
actual inline fun DoubleArray.copyInto(destination: DoubleArray, destinationOffset: Int = 0, startIndex: Int = 0, endIndex: Int = size): DoubleArray
actual inline fun FloatArray.copyInto(destination: FloatArray, destinationOffset: Int = 0, startIndex: Int = 0, endIndex: Int = size): FloatArray
actual inline fun IntArray.copyInto(destination: IntArray, destinationOffset: Int = 0, startIndex: Int = 0, endIndex: Int = size): IntArray
actual inline fun LongArray.copyInto(destination: LongArray, destinationOffset: Int = 0, startIndex: Int = 0, endIndex: Int = size): LongArray
actual inline fun ShortArray.copyInto(destination: ShortArray, destinationOffset: Int = 0, startIndex: Int = 0, endIndex: Int = size): ShortArray

Copies this array or its subrange into the destination array and returns that array.

Since Kotlin 1.3
actual fun <T> Array<out T>.copyInto(destination: Array<T>, destinationOffset: Int = 0, startIndex: Int = 0, endIndex: Int = size): Array<T>
actual fun BooleanArray.copyInto(destination: BooleanArray, destinationOffset: Int = 0, startIndex: Int = 0, endIndex: Int = size): BooleanArray
actual fun ByteArray.copyInto(destination: ByteArray, destinationOffset: Int = 0, startIndex: Int = 0, endIndex: Int = size): ByteArray
actual fun CharArray.copyInto(destination: CharArray, destinationOffset: Int = 0, startIndex: Int = 0, endIndex: Int = size): CharArray
actual fun DoubleArray.copyInto(destination: DoubleArray, destinationOffset: Int = 0, startIndex: Int = 0, endIndex: Int = size): DoubleArray
actual fun FloatArray.copyInto(destination: FloatArray, destinationOffset: Int = 0, startIndex: Int = 0, endIndex: Int = size): FloatArray
actual fun IntArray.copyInto(destination: IntArray, destinationOffset: Int = 0, startIndex: Int = 0, endIndex: Int = size): IntArray
actual fun LongArray.copyInto(destination: LongArray, destinationOffset: Int = 0, startIndex: Int = 0, endIndex: Int = size): LongArray
actual fun ShortArray.copyInto(destination: ShortArray, destinationOffset: Int = 0, startIndex: Int = 0, endIndex: Int = size): ShortArray

Copies this array or its subrange into the destination array and returns that array.

Since Kotlin 1.3
actual fun <T> Array<out T>.copyInto(destination: Array<T>, destinationOffset: Int = 0, startIndex: Int = 0, endIndex: Int = size): Array<T>
actual fun BooleanArray.copyInto(destination: BooleanArray, destinationOffset: Int = 0, startIndex: Int = 0, endIndex: Int = size): BooleanArray
actual fun ByteArray.copyInto(destination: ByteArray, destinationOffset: Int = 0, startIndex: Int = 0, endIndex: Int = size): ByteArray
actual fun CharArray.copyInto(destination: CharArray, destinationOffset: Int = 0, startIndex: Int = 0, endIndex: Int = size): CharArray
actual fun DoubleArray.copyInto(destination: DoubleArray, destinationOffset: Int = 0, startIndex: Int = 0, endIndex: Int = size): DoubleArray
actual fun FloatArray.copyInto(destination: FloatArray, destinationOffset: Int = 0, startIndex: Int = 0, endIndex: Int = size): FloatArray
actual fun IntArray.copyInto(destination: IntArray, destinationOffset: Int = 0, startIndex: Int = 0, endIndex: Int = size): IntArray
actual fun LongArray.copyInto(destination: LongArray, destinationOffset: Int = 0, startIndex: Int = 0, endIndex: Int = size): LongArray
actual fun ShortArray.copyInto(destination: ShortArray, destinationOffset: Int = 0, startIndex: Int = 0, endIndex: Int = size): ShortArray

Copies this array or its subrange into the destination array and returns that array.

Since Kotlin 1.3
actual fun <T> Array<out T>.copyInto(destination: Array<T>, destinationOffset: Int = 0, startIndex: Int = 0, endIndex: Int = size): Array<T>
actual fun BooleanArray.copyInto(destination: BooleanArray, destinationOffset: Int = 0, startIndex: Int = 0, endIndex: Int = size): BooleanArray
actual fun ByteArray.copyInto(destination: ByteArray, destinationOffset: Int = 0, startIndex: Int = 0, endIndex: Int = size): ByteArray
actual fun CharArray.copyInto(destination: CharArray, destinationOffset: Int = 0, startIndex: Int = 0, endIndex: Int = size): CharArray
actual fun DoubleArray.copyInto(destination: DoubleArray, destinationOffset: Int = 0, startIndex: Int = 0, endIndex: Int = size): DoubleArray
actual fun FloatArray.copyInto(destination: FloatArray, destinationOffset: Int = 0, startIndex: Int = 0, endIndex: Int = size): FloatArray
actual fun IntArray.copyInto(destination: IntArray, destinationOffset: Int = 0, startIndex: Int = 0, endIndex: Int = size): IntArray
actual fun LongArray.copyInto(destination: LongArray, destinationOffset: Int = 0, startIndex: Int = 0, endIndex: Int = size): LongArray
actual fun ShortArray.copyInto(destination: ShortArray, destinationOffset: Int = 0, startIndex: Int = 0, endIndex: Int = size): ShortArray

Copies this array or its subrange into the destination array and returns that array.

Since Kotlin 1.8
actual fun <T> Array<out T>.copyInto(destination: Array<T>, destinationOffset: Int = 0, startIndex: Int = 0, endIndex: Int = size): Array<T>
actual fun BooleanArray.copyInto(destination: BooleanArray, destinationOffset: Int = 0, startIndex: Int = 0, endIndex: Int = size): BooleanArray
actual fun ByteArray.copyInto(destination: ByteArray, destinationOffset: Int = 0, startIndex: Int = 0, endIndex: Int = size): ByteArray
actual fun CharArray.copyInto(destination: CharArray, destinationOffset: Int = 0, startIndex: Int = 0, endIndex: Int = size): CharArray
actual fun DoubleArray.copyInto(destination: DoubleArray, destinationOffset: Int = 0, startIndex: Int = 0, endIndex: Int = size): DoubleArray
actual fun FloatArray.copyInto(destination: FloatArray, destinationOffset: Int = 0, startIndex: Int = 0, endIndex: Int = size): FloatArray
actual fun IntArray.copyInto(destination: IntArray, destinationOffset: Int = 0, startIndex: Int = 0, endIndex: Int = size): IntArray
actual fun LongArray.copyInto(destination: LongArray, destinationOffset: Int = 0, startIndex: Int = 0, endIndex: Int = size): LongArray
actual fun ShortArray.copyInto(destination: ShortArray, destinationOffset: Int = 0, startIndex: Int = 0, endIndex: Int = size): ShortArray

Copies this array or its subrange into the destination array and returns that array.

Since Kotlin 1.8
Link copied to clipboard
expect fun <T> Array<T>.copyOf(): Array<T>
expect fun ByteArray.copyOf(): ByteArray
expect fun CharArray.copyOf(): CharArray
expect fun IntArray.copyOf(): IntArray
expect fun LongArray.copyOf(): LongArray

Returns new array which is a copy of the original array.

Since Kotlin 1.0

Returns new array which is a copy of the original array.

Since Kotlin 1.3
expect fun <T> Array<T>.copyOf(newSize: Int): Array<T?>

Returns new array which is a copy of the original array, resized to the given newSize. The copy is either truncated or padded at the end with null values if necessary.

Since Kotlin 1.0
expect fun BooleanArray.copyOf(newSize: Int): BooleanArray

Returns new array which is a copy of the original array, resized to the given newSize. The copy is either truncated or padded at the end with false values if necessary.

Since Kotlin 1.0
expect fun ByteArray.copyOf(newSize: Int): ByteArray
expect fun DoubleArray.copyOf(newSize: Int): DoubleArray
expect fun FloatArray.copyOf(newSize: Int): FloatArray
expect fun IntArray.copyOf(newSize: Int): IntArray
expect fun LongArray.copyOf(newSize: Int): LongArray
expect fun ShortArray.copyOf(newSize: Int): ShortArray

Returns new array which is a copy of the original array, resized to the given newSize. The copy is either truncated or padded at the end with zero values if necessary.

Since Kotlin 1.0
expect fun CharArray.copyOf(newSize: Int): CharArray

Returns new array which is a copy of the original array, resized to the given newSize. The copy is either truncated or padded at the end with null char (\u0000) values if necessary.

Since Kotlin 1.0

Returns new array which is a copy of the original array, resized to the given newSize. The copy is either truncated or padded at the end with zero values if necessary.

Since Kotlin 1.3
actual inline fun <T> Array<T>.copyOf(): Array<T>
actual inline fun ByteArray.copyOf(): ByteArray
actual fun CharArray.copyOf(): CharArray
actual inline fun DoubleArray.copyOf(): DoubleArray
actual inline fun FloatArray.copyOf(): FloatArray
actual inline fun IntArray.copyOf(): IntArray
actual fun LongArray.copyOf(): LongArray
actual inline fun ShortArray.copyOf(): ShortArray

Returns new array which is a copy of the original array.

Since Kotlin 1.1
actual fun <T> Array<T>.copyOf(newSize: Int): Array<T?>

Returns new array which is a copy of the original array, resized to the given newSize. The copy is either truncated or padded at the end with null values if necessary.

Since Kotlin 1.1
actual fun BooleanArray.copyOf(newSize: Int): BooleanArray

Returns new array which is a copy of the original array, resized to the given newSize. The copy is either truncated or padded at the end with false values if necessary.

Since Kotlin 1.1
actual fun ByteArray.copyOf(newSize: Int): ByteArray
actual fun DoubleArray.copyOf(newSize: Int): DoubleArray
actual fun FloatArray.copyOf(newSize: Int): FloatArray
actual fun IntArray.copyOf(newSize: Int): IntArray
actual fun LongArray.copyOf(newSize: Int): LongArray
actual fun ShortArray.copyOf(newSize: Int): ShortArray

Returns new array which is a copy of the original array, resized to the given newSize. The copy is either truncated or padded at the end with zero values if necessary.

Since Kotlin 1.1
actual fun CharArray.copyOf(newSize: Int): CharArray

Returns new array which is a copy of the original array, resized to the given newSize. The copy is either truncated or padded at the end with null char (\u0000) values if necessary.

Since Kotlin 1.1
actual inline fun <T> Array<T>.copyOf(): Array<T>
actual inline fun BooleanArray.copyOf(): BooleanArray
actual inline fun ByteArray.copyOf(): ByteArray
actual inline fun CharArray.copyOf(): CharArray
actual inline fun DoubleArray.copyOf(): DoubleArray
actual inline fun FloatArray.copyOf(): FloatArray
actual inline fun IntArray.copyOf(): IntArray
actual inline fun LongArray.copyOf(): LongArray
actual inline fun ShortArray.copyOf(): ShortArray

Returns new array which is a copy of the original array.

Since Kotlin 1.0
actual inline fun <T> Array<T>.copyOf(newSize: Int): Array<T?>

Returns new array which is a copy of the original array, resized to the given newSize. The copy is either truncated or padded at the end with null values if necessary.

Since Kotlin 1.0
actual inline fun BooleanArray.copyOf(newSize: Int): BooleanArray

Returns new array which is a copy of the original array, resized to the given newSize. The copy is either truncated or padded at the end with false values if necessary.

Since Kotlin 1.0
actual inline fun ByteArray.copyOf(newSize: Int): ByteArray
actual inline fun DoubleArray.copyOf(newSize: Int): DoubleArray
actual inline fun FloatArray.copyOf(newSize: Int): FloatArray
actual inline fun IntArray.copyOf(newSize: Int): IntArray
actual inline fun LongArray.copyOf(newSize: Int): LongArray
actual inline fun ShortArray.copyOf(newSize: Int): ShortArray

Returns new array which is a copy of the original array, resized to the given newSize. The copy is either truncated or padded at the end with zero values if necessary.

Since Kotlin 1.0
actual inline fun CharArray.copyOf(newSize: Int): CharArray

Returns new array which is a copy of the original array, resized to the given newSize. The copy is either truncated or padded at the end with null char (\u0000) values if necessary.

Since Kotlin 1.0
actual fun <T> Array<T>.copyOf(): Array<T>
actual fun ByteArray.copyOf(): ByteArray
actual fun CharArray.copyOf(): CharArray
actual fun IntArray.copyOf(): IntArray
actual fun LongArray.copyOf(): LongArray
actual fun ShortArray.copyOf