Package kotlin.collections
Collection types, such as Iterable, Collection, List, Set, Map and related top-level and extension functions.
Types
AbstractCollection
Provides a skeletal implementation of the read-only Collection interface.
abstract class AbstractCollection<out E> : Collection<E>
AbstractIterator
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.
abstract class AbstractIterator<T> : Iterator<T>
AbstractList
Provides a skeletal implementation of the read-only List interface.
abstract class AbstractList<out E> :
AbstractCollection<E>,
List<E>
AbstractMutableCollection
Provides a skeletal implementation of the MutableCollection interface.
abstract class AbstractMutableCollection<E> :
MutableCollection<E>
abstract class AbstractMutableCollection<E> :
MutableCollection<E>,
AbstractCollection<E>
abstract class AbstractMutableCollection<E> :
MutableCollection<E>,
AbstractCollection<E>
AbstractMutableList
Provides a skeletal implementation of the MutableList interface.
abstract class AbstractMutableList<E> : MutableList<E>
abstract class AbstractMutableList<E> :
MutableList<E>,
AbstractList<E>
abstract class AbstractMutableList<E> :
AbstractMutableCollection<E>,
MutableList<E>
AbstractMutableMap
Provides a skeletal implementation of the MutableMap interface.
abstract class AbstractMutableMap<K, V> : MutableMap<K, V>
abstract class AbstractMutableMap<K, V> :
MutableMap<K, V>,
AbstractMap<K, V>
abstract class AbstractMutableMap<K, V> :
AbstractMap<K, V>,
MutableMap<K, V>
AbstractMutableSet
Provides a skeletal implementation of the MutableSet interface.
abstract class AbstractMutableSet<E> : MutableSet<E>
abstract class AbstractMutableSet<E> :
MutableSet<E>,
AbstractSet<E>
abstract class AbstractMutableSet<E> :
AbstractMutableCollection<E>,
MutableSet<E>
AbstractSet
Provides a skeletal implementation of the read-only Set interface.
abstract class AbstractSet<out E> :
AbstractCollection<E>,
Set<E>
ArrayDeque
Resizable-array implementation of the deque data structure.
class ArrayDeque<E> : AbstractMutableList<E>
ArrayList
Provides a MutableList implementation, which uses a resizable array as its backing storage.
class ArrayList<E> : MutableList<E>, RandomAccess
typealias ArrayList<E> = ArrayList<E>
open class ArrayList<E> :
AbstractMutableList<E>,
MutableList<E>,
RandomAccess
class ArrayList<E> :
MutableList<E>,
RandomAccess,
AbstractMutableList<E>
BooleanIterator
An iterator over a sequence of values of type Boolean
.
abstract class BooleanIterator : Iterator<Boolean>
ByteIterator
An iterator over a sequence of values of type Byte
.
abstract class ByteIterator : Iterator<Byte>
CharIterator
An iterator over a sequence of values of type Char
.
abstract class CharIterator : Iterator<Char>
Collection
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.
interface Collection<out E> : Iterable<E>
DoubleIterator
An iterator over a sequence of values of type Double
.
abstract class DoubleIterator : Iterator<Double>
FloatIterator
An iterator over a sequence of values of type Float
.
abstract class FloatIterator : Iterator<Float>
Grouping
Represents a source of elements with a keyOf function, which can be applied to each element to get its key.
interface Grouping<T, out K>
HashMap
Hash table based implementation of the MutableMap interface.
class HashMap<K, V> : MutableMap<K, V>
typealias HashMap<K, V> = HashMap<K, V>
open class HashMap<K, V> :
AbstractMutableMap<K, V>,
MutableMap<K, V>
HashSet
The implementation of the MutableSet interface, backed by a InternalMap implementation.
class HashSet<E> : MutableSet<E>
typealias HashSet<E> = HashSet<E>
open class HashSet<E> : AbstractMutableSet<E>, MutableSet<E>
class HashSet<E> :
MutableSet<E>,
KonanSet<E>,
AbstractMutableSet<E>
IndexedValue
Data class representing a value from a collection or sequence, along with its index in that collection or sequence.
data class IndexedValue<out T>
IntIterator
An iterator over a sequence of values of type Int
.
abstract class IntIterator : Iterator<Int>
Iterable
Classes that inherit from this interface can be represented as a sequence of elements that can be iterated over.
interface Iterable<out T>
Iterator
An iterator over a collection or another entity that can be represented as a sequence of elements. Allows to sequentially access the elements.
interface Iterator<out T>
LinkedHashMap
Hash table based implementation of the MutableMap interface, which additionally preserves the insertion order of entries during the iteration.
class LinkedHashMap<K, V> : MutableMap<K, V>
typealias LinkedHashMap<K, V> = LinkedHashMap<K, V>
open class LinkedHashMap<K, V> :
HashMap<K, V>,
MutableMap<K, V>
typealias LinkedHashMap<K, V> = HashMap<K, V>
LinkedHashSet
The implementation of the MutableSet interface, backed by a InternalMap implementation.
class LinkedHashSet<E> : MutableSet<E>
typealias LinkedHashSet<E> = LinkedHashSet<E>
open class LinkedHashSet<E> : HashSet<E>, MutableSet<E>
typealias LinkedHashSet<V> = HashSet<V>
List
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.
interface List<out E> : Collection<E>
ListIterator
An iterator over a collection that supports indexed access.
interface ListIterator<out T> : Iterator<T>
LongIterator
An iterator over a sequence of values of type Long
.
abstract class LongIterator : Iterator<Long>
Map
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.
interface Map<K, out V>
MutableCollection
A generic collection of elements that supports adding and removing elements.
interface MutableCollection<E> :
Collection<E>,
MutableIterable<E>
MutableIterable
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.
interface MutableIterable<out T> : Iterable<T>
MutableIterator
An iterator over a mutable collection. Provides the ability to remove elements while iterating.
interface MutableIterator<out T> : Iterator<T>
MutableList
A generic ordered collection of elements that supports adding and removing elements.
interface MutableList<E> : List<E>, MutableCollection<E>
MutableListIterator
An iterator over a mutable collection that supports indexed access. Provides the ability to add, modify and remove elements while iterating.
interface MutableListIterator<T> :
ListIterator<T>,
MutableIterator<T>
MutableMap
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.
interface MutableMap<K, V> : Map<K, V>
MutableSet
A generic unordered collection of elements that does not support duplicate elements, and supports adding and removing elements.
interface MutableSet<E> : Set<E>, MutableCollection<E>
RandomAccess
Marker interface indicating that the List implementation supports fast indexed access.
interface RandomAccess
typealias RandomAccess = RandomAccess
Set
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.
interface Set<out E> : Collection<E>
ShortIterator
An iterator over a sequence of values of type Short
.
abstract class ShortIterator : Iterator<Short>
Extensions for External Classes
Properties
indices
Returns the range of valid indices for the array.
val <T> Array<out T>.indices: IntRange
val ShortArray.indices: IntRange
val FloatArray.indices: IntRange
val DoubleArray.indices: IntRange
val BooleanArray.indices: IntRange
val ULongArray.indices: IntRange
val UByteArray.indices: IntRange
val UShortArray.indices: IntRange
Returns an IntRange of the valid indices for this collection.
val Collection<*>.indices: IntRange
lastIndex
Returns the last valid index for the array.
val <T> Array<out T>.lastIndex: Int
val ByteArray.lastIndex: Int
val ShortArray.lastIndex: Int
val IntArray.lastIndex: Int
val LongArray.lastIndex: Int
val FloatArray.lastIndex: Int
val DoubleArray.lastIndex: Int
val BooleanArray.lastIndex: Int
val CharArray.lastIndex: Int
val UIntArray.lastIndex: Int
val ULongArray.lastIndex: Int
val UByteArray.lastIndex: Int
val UShortArray.lastIndex: Int
Returns the index of the last item in the list or -1 if the list is empty.
val <T> List<T>.lastIndex: Int
Functions
addAll
Adds all elements of the given elements collection to this MutableCollection.
fun <T> MutableCollection<in T>.addAll(
elements: Iterable<T>
): Boolean
Adds all elements of the given elements sequence to this MutableCollection.
fun <T> MutableCollection<in T>.addAll(
elements: Sequence<T>
): Boolean
Adds all elements of the given elements array to this MutableCollection.
fun <T> MutableCollection<in T>.addAll(
elements: Array<out T>
): Boolean
aggregate
aggregateTo
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.
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
all
Returns true
if all elements match the given predicate.
fun <T> Array<out T>.all(predicate: (T) -> Boolean): Boolean
fun ByteArray.all(predicate: (Byte) -> Boolean): Boolean
fun ShortArray.all(predicate: (Short) -> Boolean): Boolean
fun IntArray.all(predicate: (Int) -> Boolean): Boolean
fun LongArray.all(predicate: (Long) -> Boolean): Boolean
fun FloatArray.all(predicate: (Float) -> Boolean): Boolean
fun DoubleArray.all(predicate: (Double) -> Boolean): Boolean
fun BooleanArray.all(
predicate: (Boolean) -> Boolean
): Boolean
fun CharArray.all(predicate: (Char) -> Boolean): Boolean
fun <T> Iterable<T>.all(predicate: (T) -> Boolean): Boolean
fun ULongArray.all(predicate: (ULong) -> Boolean): Boolean
fun UByteArray.all(predicate: (UByte) -> Boolean): Boolean
fun UShortArray.all(predicate: (UShort) -> Boolean): Boolean
any
Returns true
if array has at least one element.
fun <T> Array<out T>.any(): Boolean
fun ByteArray.any(): Boolean
fun ShortArray.any(): Boolean
fun IntArray.any(): Boolean
fun LongArray.any(): Boolean
fun FloatArray.any(): Boolean
fun DoubleArray.any(): Boolean
fun BooleanArray.any(): Boolean
fun CharArray.any(): Boolean
fun UIntArray.any(): Boolean
fun ULongArray.any(): Boolean
fun UByteArray.any(): Boolean
fun UShortArray.any(): Boolean
Returns true
if at least one element matches the given predicate.
fun <T> Array<out T>.any(predicate: (T) -> Boolean): Boolean
fun ByteArray.any(predicate: (Byte) -> Boolean): Boolean
fun ShortArray.any(predicate: (Short) -> Boolean): Boolean
fun IntArray.any(predicate: (Int) -> Boolean): Boolean
fun LongArray.any(predicate: (Long) -> Boolean): Boolean
fun FloatArray.any(predicate: (Float) -> Boolean): Boolean
fun DoubleArray.any(predicate: (Double) -> Boolean): Boolean
fun BooleanArray.any(
predicate: (Boolean) -> Boolean
): Boolean
fun CharArray.any(predicate: (Char) -> Boolean): Boolean
fun <T> Iterable<T>.any(predicate: (T) -> Boolean): Boolean
fun ULongArray.any(predicate: (ULong) -> Boolean): Boolean
fun UByteArray.any(predicate: (UByte) -> Boolean): Boolean
fun UShortArray.any(predicate: (UShort) -> Boolean): Boolean
Returns true
if collection has at least one element.
fun <T> Iterable<T>.any(): Boolean
Returns true
if map has at least one entry.
fun <K, V> Map<out K, V>.any(): Boolean
asByteArray
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.
fun UByteArray.asByteArray(): ByteArray
asIterable
asList
Returns a List that wraps the original array.
fun <ERROR CLASS>.asList(): List<<ERROR CLASS>>
fun <T> Array<out T>.asList(): List<T>
fun ShortArray.asList(): List<Short>
fun FloatArray.asList(): List<Float>
fun DoubleArray.asList(): List<Double>
fun BooleanArray.asList(): List<Boolean>
fun ULongArray.asList(): List<ULong>
fun UByteArray.asList(): List<UByte>
fun UShortArray.asList(): List<UShort>
asLongArray
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.
fun ULongArray.asLongArray(): LongArray
asReversed
Returns a reversed read-only view of the original List. All changes made in the original list will be reflected in the reversed one.
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.
fun <T> MutableList<T>.asReversed(): MutableList<T>
asSequence
Creates a Sequence instance that wraps the original array returning its elements when being iterated.
fun <T> any_array<T>.asSequence(): Sequence<T>
Creates a Sequence instance that wraps the original collection returning its elements when being iterated.
asShortArray
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.
fun UShortArray.asShortArray(): ShortArray
associate
associateBy
Returns a Map containing the elements from the given array indexed by the key returned from keySelector function applied to each element.
fun <T, K> any_array<T>.associateBy(
keySelector: (T) -> K
): Map<K, T>
Returns a Map containing the values provided by valueTransform and indexed by keySelector functions applied to elements of the given array.
fun <T, K, V> any_array<T>.associateBy(
keySelector: (T) -> K,
valueTransform: (T) -> V
): Map<K, V>
Returns a Map containing the elements from the given collection indexed by the key returned from keySelector function applied to each element.
Returns a Map containing the values provided by valueTransform and indexed by keySelector functions applied to elements of the given collection.
associateByTo
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.
fun <T, K, M : MutableMap<in K, in T>> any_array<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 and and value is provided by the valueTransform function applied to elements of the given array.
fun <T, K, V, M : MutableMap<in K, in V>> any_array<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 applied to each element of the given collection and value is the element itself.
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 and and value is provided by the valueTransform function applied to elements of the given collection.
fun <T, K, V, M : MutableMap<in K, in V>> Iterable<T>.associateByTo(
destination: M,
keySelector: (T) -> K,
valueTransform: (T) -> V
): M
associateTo
Populates and returns the destination mutable map with key-value pairs provided by transform function applied to each element of the given array.
fun <T, K, V, M : MutableMap<in K, in V>> any_array<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.
fun <T, K, V, M : MutableMap<in K, in V>> Iterable<T>.associateTo(
destination: M,
transform: (T) -> Pair<K, V>
): M
associateWith
Returns a Map where keys are elements from the given array and values are produced by the valueSelector function applied to each element.
fun <K, V> Array<out K>.associateWith(
valueSelector: (K) -> V
): Map<K, V>
fun <V> ShortArray.associateWith(
valueSelector: (Short) -> V
): Map<Short, V>
fun <V> FloatArray.associateWith(
valueSelector: (Float) -> V
): Map<Float, V>
fun <V> DoubleArray.associateWith(
valueSelector: (Double) -> V
): Map<Double, V>
fun <V> BooleanArray.associateWith(
valueSelector: (Boolean) -> V
): Map<Boolean, V>
fun <V> ULongArray.associateWith(
valueSelector: (ULong) -> V
): Map<ULong, V>
fun <V> UByteArray.associateWith(
valueSelector: (UByte) -> V
): Map<UByte, V>
fun <V> UShortArray.associateWith(
valueSelector: (UShort) -> V
): Map<UShort, V>
Returns a Map where keys are elements from the given collection and values are produced by the valueSelector function applied to each element.
associateWithTo
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.
fun <K, V, M : MutableMap<in K, in V>> Array<out K>.associateWithTo(
destination: M,
valueSelector: (K) -> V
): M
fun <V, M : MutableMap<in Byte, in V>> ByteArray.associateWithTo(
destination: M,
valueSelector: (Byte) -> V
): M
fun <V, M : MutableMap<in Short, in V>> ShortArray.associateWithTo(
destination: M,
valueSelector: (Short) -> V
): M
fun <V, M : MutableMap<in Int, in V>> IntArray.associateWithTo(
destination: M,
valueSelector: (Int) -> V
): M
fun <V, M : MutableMap<in Long, in V>> LongArray.associateWithTo(
destination: M,
valueSelector: (Long) -> V
): M
fun <V, M : MutableMap<in Float, in V>> FloatArray.associateWithTo(
destination: M,
valueSelector: (Float) -> V
): M
fun <V, M : MutableMap<in Double, in V>> DoubleArray.associateWithTo(
destination: M,
valueSelector: (Double) -> V
): M
fun <V, M : MutableMap<in Boolean, in V>> BooleanArray.associateWithTo(
destination: M,
valueSelector: (Boolean) -> V
): M
fun <V, M : MutableMap<in Char, in V>> CharArray.associateWithTo(
destination: M,
valueSelector: (Char) -> V
): M
fun <V, M : MutableMap<in UInt, in V>> UIntArray.associateWithTo(
destination: M,
valueSelector: (UInt) -> V
): M
fun <V, M : MutableMap<in ULong, in V>> ULongArray.associateWithTo(
destination: M,
valueSelector: (ULong) -> V
): M
fun <V, M : MutableMap<in UByte, in V>> UByteArray.associateWithTo(
destination: M,
valueSelector: (UByte) -> V
): M
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 collection, where key is the element itself and value is provided by the valueSelector function applied to that key.
fun <K, V, M : MutableMap<in K, in V>> Iterable<K>.associateWithTo(
destination: M,
valueSelector: (K) -> V
): M
asUByteArray
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.
fun ByteArray.asUByteArray(): UByteArray
asULongArray
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.
fun LongArray.asULongArray(): ULongArray
asUShortArray
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.
fun ShortArray.asUShortArray(): UShortArray
average
Returns an average value of elements in the array.
fun Array<out Byte>.average(): Double
fun Array<out Short>.average(): Double
fun Array<out Int>.average(): Double
fun Array<out Long>.average(): Double
fun Array<out Float>.average(): Double
fun Array<out Double>.average(): Double
fun ByteArray.average(): Double
fun ShortArray.average(): Double
fun IntArray.average(): Double
fun LongArray.average(): Double
fun FloatArray.average(): Double
fun DoubleArray.average(): Double
binarySearch
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.
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 specified comparator, otherwise the result is undefined.
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 an element for which the given comparison function returns zero using the binary search algorithm.
fun <T> List<T>.binarySearch(
fromIndex: Int = 0,
toIndex: Int = size,
comparison: (T) -> Int
): 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.
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, otherwise the result is undefined.
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 ShortArray.binarySearch(
element: Short,
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 FloatArray.binarySearch(
element: Float,
fromIndex: Int = 0,
toIndex: Int = size
): Int
fun DoubleArray.binarySearch(
element: Double,
fromIndex: Int = 0,
toIndex: Int = size
): Int
fun CharArray.binarySearch(
element: Char,
fromIndex: Int = 0,
toIndex: Int = size
): Int
fun ULongArray.binarySearch(
element: ULong,
fromIndex: Int = 0,
toIndex: Int = size
): Int
fun UByteArray.binarySearch(
element: UByte,
fromIndex: Int = 0,
toIndex: Int = size
): Int
fun UShortArray.binarySearch(
element: UShort,
fromIndex: Int = 0,
toIndex: Int = size
): Int
binarySearchBy
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.
fun <T, K : Comparable<K>> List<T>.binarySearchBy(
key: K?,
fromIndex: Int = 0,
toIndex: Int = size,
selector: (T) -> K?
): Int
buildList
Builds a new read-only List by populating a MutableList using the given builderAction and returning a read-only list with the same elements.
fun <E> buildList(
builderAction: MutableList<E>.() -> Unit
): List<E>
fun <E> buildList(
capacity: Int,
builderAction: MutableList<E>.() -> Unit
): List<E>
buildMap
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.
fun <K, V> buildMap(
builderAction: MutableMap<K, V>.() -> Unit
): Map<K, V>
fun <K, V> buildMap(
capacity: Int,
builderAction: MutableMap<K, V>.() -> Unit
): Map<K, V>
buildSet
Builds a new read-only Set by populating a MutableSet using the given builderAction and returning a read-only set with the same elements.
fun <E> buildSet(
builderAction: MutableSet<E>.() -> Unit
): Set<E>
fun <E> buildSet(
capacity: Int,
builderAction: MutableSet<E>.() -> Unit
): Set<E>
component1
Returns 1st element from the array.
operator fun <T> Array<out T>.component1(): T
operator fun ByteArray.component1(): Byte
operator fun ShortArray.component1(): Short
operator fun IntArray.component1(): Int
operator fun LongArray.component1(): Long
operator fun FloatArray.component1(): Float
operator fun DoubleArray.component1(): Double
operator fun BooleanArray.component1(): Boolean
operator fun CharArray.component1(): Char
operator fun ULongArray.component1(): ULong
operator fun UByteArray.component1(): UByte
operator fun UShortArray.component1(): UShort
Returns 1st element from the list.
operator fun <T> List<T>.component1(): T
Returns the key component of the map entry.
operator fun <K, V> Entry<K, V>.component1(): K
component2
Returns 2nd element from the array.
operator fun <T> Array<out T>.component2(): T
operator fun ByteArray.component2(): Byte
operator fun ShortArray.component2(): Short
operator fun IntArray.component2(): Int
operator fun LongArray.component2(): Long
operator fun FloatArray.component2(): Float
operator fun DoubleArray.component2(): Double
operator fun BooleanArray.component2(): Boolean
operator fun CharArray.component2(): Char
operator fun ULongArray.component2(): ULong
operator fun UByteArray.component2(): UByte
operator fun UShortArray.component2(): UShort
Returns 2nd element from the list.
operator fun <T> List<T>.component2(): T
Returns the value component of the map entry.
operator fun <K, V> Entry<K, V>.component2(): V
component3
Returns 3rd element from the array.
operator fun <T> Array<out T>.component3(): T
operator fun ByteArray.component3(): Byte
operator fun ShortArray.component3(): Short
operator fun IntArray.component3(): Int
operator fun LongArray.component3(): Long
operator fun FloatArray.component3(): Float
operator fun DoubleArray.component3(): Double
operator fun BooleanArray.component3(): Boolean
operator fun CharArray.component3(): Char
operator fun ULongArray.component3(): ULong
operator fun UByteArray.component3(): UByte
operator fun UShortArray.component3(): UShort
Returns 3rd element from the list.
operator fun <T> List<T>.component3(): T
component4
Returns 4th element from the array.
operator fun <T> Array<out T>.component4(): T
operator fun ByteArray.component4(): Byte
operator fun ShortArray.component4(): Short
operator fun IntArray.component4(): Int
operator fun LongArray.component4(): Long
operator fun FloatArray.component4(): Float
operator fun DoubleArray.component4(): Double
operator fun BooleanArray.component4(): Boolean
operator fun CharArray.component4(): Char
operator fun ULongArray.component4(): ULong
operator fun UByteArray.component4(): UByte
operator fun UShortArray.component4(): UShort
Returns 4th element from the list.
operator fun <T> List<T>.component4(): T
component5
Returns 5th element from the array.
operator fun <T> Array<out T>.component5(): T
operator fun ByteArray.component5(): Byte
operator fun ShortArray.component5(): Short
operator fun IntArray.component5(): Int
operator fun LongArray.component5(): Long
operator fun FloatArray.component5(): Float
operator fun DoubleArray.component5(): Double
operator fun BooleanArray.component5(): Boolean
operator fun CharArray.component5(): Char
operator fun ULongArray.component5(): ULong
operator fun UByteArray.component5(): UByte
operator fun UShortArray.component5(): UShort
Returns 5th element from the list.
operator fun <T> List<T>.component5(): T
contains
Returns true
if element is found in the array.
operator fun <T> any_array<T>.contains(element: T): Boolean
Returns true
if element is found in the collection.
operator fun <T> Iterable<T>.contains(element: T): Boolean
Checks if the map contains the given key.
operator fun <K, V> Map<out K, V>.contains(key: K): Boolean
containsAll
Checks if all elements in the specified collection are contained in this collection.
fun <T> Collection<T>.containsAll(
elements: Collection<T>
): Boolean
contentDeepEquals
Checks if the two specified arrays are deeply equal to one another.
infix fun <T> any_array<T>.contentDeepEquals(
other: Array<out T>
): Boolean
contentDeepHashCode
Returns a hash code based on the contents of this array as if it is List. Nested arrays are treated as lists too.
fun <T> any_array<T>.contentDeepHashCode(): Int
contentDeepToString
Returns a string representation of the contents of this array as if it is a List. Nested arrays are treated as lists too.
fun <T> any_array<T>.contentDeepToString(): String
contentEquals
Checks if the two specified arrays are structurally equal to one another.
infix fun ULongArray?.contentEquals(
other: ULongArray?
): Boolean
infix fun UByteArray?.contentEquals(
other: UByteArray?
): Boolean
infix fun UShortArray?.contentEquals(
other: UShortArray?
): Boolean
infix fun <T> Array<out T>.contentEquals(
other: Array<out T>
): Boolean
infix fun ShortArray.contentEquals(
other: ShortArray
): Boolean
infix fun FloatArray.contentEquals(
other: FloatArray
): Boolean
infix fun DoubleArray.contentEquals(
other: DoubleArray
): Boolean
infix fun BooleanArray.contentEquals(
other: BooleanArray
): Boolean
infix fun ULongArray.contentEquals(
other: ULongArray
): Boolean
infix fun UByteArray.contentEquals(
other: UByteArray
): Boolean
infix fun UShortArray.contentEquals(
other: UShortArray
): Boolean
infix fun <T> Array<out T>?.contentEquals(
other: Array<out T>?
): Boolean
infix fun ShortArray?.contentEquals(
other: ShortArray?
): Boolean
infix fun FloatArray?.contentEquals(
other: FloatArray?
): Boolean
infix fun DoubleArray?.contentEquals(
other: DoubleArray?
): Boolean
infix fun BooleanArray?.contentEquals(
other: BooleanArray?
): Boolean
contentHashCode
Returns a hash code based on the contents of this array as if it is List.
fun UIntArray?.contentHashCode(): Int
fun ULongArray?.contentHashCode(): Int
fun UByteArray?.contentHashCode(): Int
fun UShortArray?.contentHashCode(): Int
fun <T> Array<out T>.contentHashCode(): Int
fun ByteArray.contentHashCode(): Int
fun ShortArray.contentHashCode(): Int
fun IntArray.contentHashCode(): Int
fun LongArray.contentHashCode(): Int
fun FloatArray.contentHashCode(): Int
fun DoubleArray.contentHashCode(): Int
fun BooleanArray.contentHashCode(): Int
fun CharArray.contentHashCode(): Int
fun UIntArray.contentHashCode(): Int
fun ULongArray.contentHashCode(): Int
fun UByteArray.contentHashCode(): Int
fun UShortArray.contentHashCode(): Int
fun <T> Array<out T>?.contentHashCode(): Int
fun ByteArray?.contentHashCode(): Int
fun ShortArray?.contentHashCode(): Int
fun IntArray?.contentHashCode(): Int
fun LongArray?.contentHashCode(): Int
fun FloatArray?.contentHashCode(): Int
fun DoubleArray?.contentHashCode(): Int
fun BooleanArray?.contentHashCode(): Int
fun CharArray?.contentHashCode(): Int
contentToString
Returns a string representation of the contents of the specified array as if it is List.
fun UIntArray?.contentToString(): String
fun ULongArray?.contentToString(): String
fun UByteArray?.contentToString(): String
fun UShortArray?.contentToString(): String
fun <T> Array<out T>.contentToString(): String
fun ByteArray.contentToString(): String
fun ShortArray.contentToString(): String
fun IntArray.contentToString(): String
fun LongArray.contentToString(): String
fun FloatArray.contentToString(): String
fun DoubleArray.contentToString(): String
fun BooleanArray.contentToString(): String
fun CharArray.contentToString(): String
fun UIntArray.contentToString(): String
fun ULongArray.contentToString(): String
fun UByteArray.contentToString(): String
fun UShortArray.contentToString(): String
fun <T> Array<out T>?.contentToString(): String
fun ByteArray?.contentToString(): String
fun ShortArray?.contentToString(): String
fun IntArray?.contentToString(): String
fun LongArray?.contentToString(): String
fun FloatArray?.contentToString(): String
fun DoubleArray?.contentToString(): String
fun BooleanArray?.contentToString(): String
fun CharArray?.contentToString(): String
copyInto
Copies this array or its subrange into the destination array and returns that array.
fun ULongArray.copyInto(
destination: ULongArray,
destinationOffset: Int = 0,
startIndex: Int = 0,
endIndex: Int = size
): ULongArray
fun UByteArray.copyInto(
destination: UByteArray,
destinationOffset: Int = 0,
startIndex: Int = 0,
endIndex: Int = size
): UByteArray
fun UShortArray.copyInto(
destination: UShortArray,
destinationOffset: Int = 0,
startIndex: Int = 0,
endIndex: Int = size
): UShortArray
fun <T> Array<out T>.copyInto(
destination: Array<T>,
destinationOffset: Int = 0,
startIndex: Int = 0,
endIndex: Int = size
): Array<T>
fun ShortArray.copyInto(
destination: ShortArray,
destinationOffset: Int = 0,
startIndex: Int = 0,
endIndex: Int = size
): ShortArray
fun FloatArray.copyInto(
destination: FloatArray,
destinationOffset: Int = 0,
startIndex: Int = 0,
endIndex: Int = size
): FloatArray
fun DoubleArray.copyInto(
destination: DoubleArray,
destinationOffset: Int = 0,
startIndex: Int = 0,
endIndex: Int = size
): DoubleArray
fun BooleanArray.copyInto(
destination: BooleanArray,
destinationOffset: Int = 0,
startIndex: Int = 0,
endIndex: Int = size
): BooleanArray
copyOf
Returns new array which is a copy of the original array.
fun ULongArray.copyOf(): ULongArray
fun UByteArray.copyOf(): UByteArray
fun UShortArray.copyOf(): UShortArray
fun <T> Array<T>.copyOf(): Array<T>
fun <T> Array<out T>.copyOf(): Array<T>
fun ShortArray.copyOf(): ShortArray
fun FloatArray.copyOf(): FloatArray
fun DoubleArray.copyOf(): DoubleArray
fun BooleanArray.copyOf(): 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 zero values if necessary.
fun ULongArray.copyOf(newSize: Int): ULongArray
fun UByteArray.copyOf(newSize: Int): UByteArray
fun UShortArray.copyOf(newSize: Int): UShortArray
fun ShortArray.copyOf(newSize: Int): ShortArray
fun FloatArray.copyOf(newSize: Int): FloatArray
fun DoubleArray.copyOf(newSize: Int): DoubleArray
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.
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 null char (\u0000
) values if necessary.
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.
fun <T> any_array<T>.copyOf(newSize: Int): Array<T?>
copyOfRange
Returns a new array which is a copy of the specified range of the original array.
fun ULongArray.copyOfRange(
fromIndex: Int,
toIndex: Int
): ULongArray
fun UByteArray.copyOfRange(
fromIndex: Int,
toIndex: Int
): UByteArray
fun UShortArray.copyOfRange(
fromIndex: Int,
toIndex: Int
): UShortArray
fun <T> Array<T>.copyOfRange(
fromIndex: Int,
toIndex: Int
): Array<T>
fun <T> Array<out T>.copyOfRange(
fromIndex: Int,
toIndex: Int
): Array<T>
fun ShortArray.copyOfRange(
fromIndex: Int,
toIndex: Int
): ShortArray
fun FloatArray.copyOfRange(
fromIndex: Int,
toIndex: Int
): FloatArray
fun DoubleArray.copyOfRange(
fromIndex: Int,
toIndex: Int
): DoubleArray
fun BooleanArray.copyOfRange(
fromIndex: Int,
toIndex: Int
): BooleanArray
count
Returns the number of elements in this array.
fun <T> any_array<T>.count(): Int
Returns the number of elements matching the given predicate.
fun <T> Array<out T>.count(predicate: (T) -> Boolean): Int
fun ByteArray.count(predicate: (Byte) -> Boolean): Int
fun ShortArray.count(predicate: (Short) -> Boolean): Int
fun IntArray.count(predicate: (Int) -> Boolean): Int
fun LongArray.count(predicate: (Long) -> Boolean): Int
fun FloatArray.count(predicate: (Float) -> Boolean): Int
fun DoubleArray.count(predicate: (Double) -> Boolean): Int
fun BooleanArray.count(predicate: (Boolean) -> Boolean): Int
fun CharArray.count(predicate: (Char) -> Boolean): Int
fun <T> Iterable<T>.count(predicate: (T) -> Boolean): Int
fun ULongArray.count(predicate: (ULong) -> Boolean): Int
fun UByteArray.count(predicate: (UByte) -> Boolean): Int
fun UShortArray.count(predicate: (UShort) -> Boolean): Int
Returns the number of elements in this collection.
fun <T> Iterable<T>.count(): Int
fun <T> Collection<T>.count(): Int
Returns the number of entries in this map.
fun <K, V> Map<out K, V>.count(): Int
distinct
Returns a list containing only distinct elements from the given array.
fun <T> any_array<T>.distinct(): List<T>
distinctBy
drop
Returns a list containing all elements except first n elements.
fun <T> Array<out T>.drop(n: Int): List<T>
fun ShortArray.drop(n: Int): List<Short>
fun FloatArray.drop(n: Int): List<Float>
fun DoubleArray.drop(n: Int): List<Double>
fun BooleanArray.drop(n: Int): List<Boolean>
fun ULongArray.drop(n: Int): List<ULong>
fun UByteArray.drop(n: Int): List<UByte>
fun UShortArray.drop(n: Int): List<UShort>
dropLast
Returns a list containing all elements except last n elements.
fun <T> Array<out T>.dropLast(n: Int): List<T>
fun ShortArray.dropLast(n: Int): List<Short>
fun FloatArray.dropLast(n: Int): List<Float>
fun DoubleArray.dropLast(n: Int): List<Double>
fun BooleanArray.dropLast(n: Int): List<Boolean>
fun ULongArray.dropLast(n: Int): List<ULong>
fun UByteArray.dropLast(n: Int): List<UByte>
fun UShortArray.dropLast(n: Int): List<UShort>
dropLastWhile
Returns a list containing all elements except last elements that satisfy the given predicate.
fun <T> Array<out T>.dropLastWhile(
predicate: (T) -> Boolean
): List<T>
fun ShortArray.dropLastWhile(
predicate: (Short) -> Boolean
): List<Short>
fun FloatArray.dropLastWhile(
predicate: (Float) -> Boolean
): List<Float>
fun DoubleArray.dropLastWhile(
predicate: (Double) -> Boolean
): List<Double>
fun BooleanArray.dropLastWhile(
predicate: (Boolean) -> Boolean
): List<Boolean>
fun ULongArray.dropLastWhile(
predicate: (ULong) -> Boolean
): List<ULong>
fun UByteArray.dropLastWhile(
predicate: (UByte) -> Boolean
): List<UByte>
fun UShortArray.dropLastWhile(
predicate: (UShort) -> Boolean
): List<UShort>
dropWhile
Returns a list containing all elements except first elements that satisfy the given predicate.
fun <T> Array<out T>.dropWhile(
predicate: (T) -> Boolean
): List<T>
fun ShortArray.dropWhile(
predicate: (Short) -> Boolean
): List<Short>
fun FloatArray.dropWhile(
predicate: (Float) -> Boolean
): List<Float>
fun DoubleArray.dropWhile(
predicate: (Double) -> Boolean
): List<Double>
fun BooleanArray.dropWhile(
predicate: (Boolean) -> Boolean
): List<Boolean>
fun ULongArray.dropWhile(
predicate: (ULong) -> Boolean
): List<ULong>
fun UByteArray.dropWhile(
predicate: (UByte) -> Boolean
): List<UByte>
fun UShortArray.dropWhile(
predicate: (UShort) -> Boolean
): List<UShort>
eachCount
eachCountTo
Groups elements from the Grouping source by key and counts elements in each group to the given destination map.
fun <T, K, M : MutableMap<in K, Int>> Grouping<T, K>.eachCountTo(
destination: M
): M
elementAt
Returns an element at the given index or throws an IndexOutOfBoundsException if the index is out of bounds of this collection.
fun <T> Iterable<T>.elementAt(index: Int): T
Returns an element at the given index or throws an IndexOutOfBoundsException if the index is out of bounds of this list.
fun <T> List<T>.elementAt(index: Int): T
Returns an element at the given index or throws an IndexOutOfBoundsException if the index is out of bounds of this array.
fun <ERROR CLASS>.elementAt(index: Int): <ERROR CLASS>
fun <T> Array<out T>.elementAt(index: Int): T
fun ByteArray.elementAt(index: Int): Byte
fun ShortArray.elementAt(index: Int): Short
fun IntArray.elementAt(index: Int): Int
fun LongArray.elementAt(index: Int): Long
fun FloatArray.elementAt(index: Int): Float
fun DoubleArray.elementAt(index: Int): Double
fun BooleanArray.elementAt(index: Int): Boolean
fun CharArray.elementAt(index: Int): Char
fun ULongArray.elementAt(index: Int): ULong
fun UByteArray.elementAt(index: Int): UByte
fun UShortArray.elementAt(index: Int): UShort
elementAtOrElse
Returns an element at the given index or the result of calling the defaultValue function if the index is out of bounds of this array.
fun <T> Array<out T>.elementAtOrElse(
index: Int,
defaultValue: (Int) -> T
): T
fun ByteArray.elementAtOrElse(
index: Int,
defaultValue: (Int) -> Byte
): Byte
fun ShortArray.elementAtOrElse(
index: Int,
defaultValue: (Int) -> Short
): Short
fun IntArray.elementAtOrElse(
index: Int,
defaultValue: (Int) -> Int
): Int
fun LongArray.elementAtOrElse(
index: Int,
defaultValue: (Int) -> Long
): Long
fun FloatArray.elementAtOrElse(
index: Int,
defaultValue: (Int) -> Float
): Float
fun DoubleArray.elementAtOrElse(
index: Int,
defaultValue: (Int) -> Double
): Double
fun BooleanArray.elementAtOrElse(
index: Int,
defaultValue: (Int) -> Boolean
): Boolean
fun CharArray.elementAtOrElse(
index: Int,
defaultValue: (Int) -> Char
): Char
fun ULongArray.elementAtOrElse(
index: Int,
defaultValue: (Int) -> ULong
): ULong
fun UByteArray.elementAtOrElse(
index: Int,
defaultValue: (Int) -> UByte
): UByte
fun UShortArray.elementAtOrElse(
index: Int,
defaultValue: (Int) -> UShort
): UShort
Returns an element at the given index or the result of calling the defaultValue function if the index is out of bounds of this collection.
fun <T> Iterable<T>.elementAtOrElse(
index: Int,
defaultValue: (Int) -> T
): T
Returns an element at the given index or the result of calling the defaultValue function if the index is out of bounds of this list.
fun <T> List<T>.elementAtOrElse(
index: Int,
defaultValue: (Int) -> T
): T
elementAtOrNull
Returns an element at the given index or null
if the index is out of bounds of this array.
fun <T> Array<out T>.elementAtOrNull(index: Int): T?
fun ByteArray.elementAtOrNull(index: Int): Byte?
fun ShortArray.elementAtOrNull(index: Int): Short?
fun IntArray.elementAtOrNull(index: Int): Int?
fun LongArray.elementAtOrNull(index: Int): Long?
fun FloatArray.elementAtOrNull(index: Int): Float?
fun DoubleArray.elementAtOrNull(index: Int): Double?
fun BooleanArray.elementAtOrNull(index: Int): Boolean?
fun CharArray.elementAtOrNull(index: Int): Char?
fun ULongArray.elementAtOrNull(index: Int): ULong?
fun UByteArray.elementAtOrNull(index: Int): UByte?
fun UShortArray.elementAtOrNull(index: Int): UShort?
emptyList
Returns an empty read-only list. The returned list is serializable (JVM).
fun <T> emptyList(): List<T>
emptySet
Returns an empty read-only set. The returned set is serializable (JVM).
fun <T> emptySet(): Set<T>
fill
Fills this array or its subrange with the specified element value.
fun ULongArray.fill(
element: ULong,
fromIndex: Int = 0,
toIndex: Int = size)
fun UByteArray.fill(
element: UByte,
fromIndex: Int = 0,
toIndex: Int = size)
fun UShortArray.fill(
element: UShort,
fromIndex: Int = 0,
toIndex: Int = size)
fun <T> Array<T>.fill(
element: T,
fromIndex: Int = 0,
toIndex: Int = size)
fun ByteArray.fill(
element: Byte,
fromIndex: Int = 0,
toIndex: Int = size)
fun ShortArray.fill(
element: Short,
fromIndex: Int = 0,
toIndex: Int = size)
fun IntArray.fill(
element: Int,
fromIndex: Int = 0,
toIndex: Int = size)
fun LongArray.fill(
element: Long,
fromIndex: Int = 0,
toIndex: Int = size)
fun FloatArray.fill(
element: Float,
fromIndex: Int = 0,
toIndex: Int = size)
fun DoubleArray.fill(
element: Double,
fromIndex: Int = 0,
toIndex: Int = size)
fun BooleanArray.fill(
element: Boolean,
fromIndex: Int = 0,
toIndex: Int = size)
fun CharArray.fill(
element: Char,
fromIndex: Int = 0,
toIndex: Int = size)
Fills the list with the provided value.
fun <T> MutableList<T>.fill(value: T)
filter
Returns a list containing only elements matching the given predicate.
fun <T> Array<out T>.filter(
predicate: (T) -> Boolean
): List<T>
fun ShortArray.filter(
predicate: (Short) -> Boolean
): List<Short>
fun FloatArray.filter(
predicate: (Float) -> Boolean
): List<Float>
fun DoubleArray.filter(
predicate: (Double) -> Boolean
): List<Double>
fun BooleanArray.filter(
predicate: (Boolean) -> Boolean
): List<Boolean>
fun ULongArray.filter(
predicate: (ULong) -> Boolean
): List<ULong>
fun UByteArray.filter(
predicate: (UByte) -> Boolean
): List<UByte>
fun UShortArray.filter(
predicate: (UShort) -> Boolean
): List<UShort>
filterIndexed
Returns a list containing only elements matching the given predicate.
fun <T> Array<out T>.filterIndexed(
predicate: (index: Int, T) -> Boolean
): List<T>
fun ShortArray.filterIndexed(
predicate: (index: Int, Short) -> Boolean
): List<Short>
fun FloatArray.filterIndexed(
predicate: (index: Int, Float) -> Boolean
): List<Float>
fun DoubleArray.filterIndexed(
predicate: (index: Int, Double) -> Boolean
): List<Double>
fun BooleanArray.filterIndexed(
predicate: (index: Int, Boolean) -> Boolean
): List<Boolean>
fun ULongArray.filterIndexed(
predicate: (index: Int, ULong) -> Boolean
): List<ULong>
fun UByteArray.filterIndexed(
predicate: (index: Int, UByte) -> Boolean
): List<UByte>
fun UShortArray.filterIndexed(
predicate: (index: Int, UShort) -> Boolean
): List<UShort>
filterIndexedTo
Appends all elements matching the given predicate to the given destination.
fun <T, C : MutableCollection<in T>> Array<out T>.filterIndexedTo(
destination: C,
predicate: (index: Int, T) -> Boolean
): C
fun <C : MutableCollection<in Byte>> ByteArray.filterIndexedTo(
destination: C,
predicate: (index: Int, Byte) -> Boolean
): C
fun <C : MutableCollection<in Short>> ShortArray.filterIndexedTo(
destination: C,
predicate: (index: Int, Short) -> Boolean
): C
fun <C : MutableCollection<in Int>> IntArray.filterIndexedTo(
destination: C,
predicate: (index: Int, Int) -> Boolean
): C
fun <C : MutableCollection<in Long>> LongArray.filterIndexedTo(
destination: C,
predicate: (index: Int, Long) -> Boolean
): C
fun <C : MutableCollection<in Float>> FloatArray.filterIndexedTo(
destination: C,
predicate: (index: Int, Float) -> Boolean
): C
fun <C : MutableCollection<in Double>> DoubleArray.filterIndexedTo(
destination: C,
predicate: (index: Int, Double) -> Boolean
): C
fun <C : MutableCollection<in Boolean>> BooleanArray.filterIndexedTo(
destination: C,
predicate: (index: Int, Boolean) -> Boolean
): C
fun <C : MutableCollection<in Char>> CharArray.filterIndexedTo(
destination: C,
predicate: (index: Int, Char) -> Boolean
): C
fun <T, C : MutableCollection<in T>> Iterable<T>.filterIndexedTo(
destination: C,
predicate: (index: Int, T) -> Boolean
): C
fun <C : MutableCollection<in UInt>> UIntArray.filterIndexedTo(
destination: C,
predicate: (index: Int, UInt) -> Boolean
): C
fun <C : MutableCollection<in ULong>> ULongArray.filterIndexedTo(
destination: C,
predicate: (index: Int, ULong) -> Boolean
): C
fun <C : MutableCollection<in UByte>> UByteArray.filterIndexedTo(
destination: C,
predicate: (index: Int, UByte) -> Boolean
): C
fun <C : MutableCollection<in UShort>> UShortArray.filterIndexedTo(
destination: C,
predicate: (index: Int, UShort) -> Boolean
): C
filterIsInstance
Returns a list containing all elements that are instances of specified type parameter R.
fun <R> Array<*>.filterIsInstance(): List<R>
filterIsInstanceTo
Appends all elements that are instances of specified type parameter R to the given destination.
fun <R, C : MutableCollection<in R>> Array<*>.filterIsInstanceTo(
destination: C
): C
fun <R, C : MutableCollection<in R>> Iterable<*>.filterIsInstanceTo(
destination: C
): C
Appends all elements that are instances of specified class to the given destination.
fun <C : MutableCollection<in R>, R> Array<*>.filterIsInstanceTo(
destination: C,
klass: Class<R>
): C
fun <C : MutableCollection<in R>, R> Iterable<*>.filterIsInstanceTo(
destination: C,
klass: Class<R>
): C
filterNot
Returns a list containing all elements not matching the given predicate.
fun <T> Array<out T>.filterNot(
predicate: (T) -> Boolean
): List<T>
fun ShortArray.filterNot(
predicate: (Short) -> Boolean
): List<Short>
fun FloatArray.filterNot(
predicate: (Float) -> Boolean
): List<Float>
fun DoubleArray.filterNot(
predicate: (Double) -> Boolean
): List<Double>
fun BooleanArray.filterNot(
predicate: (Boolean) -> Boolean
): List<Boolean>
fun ULongArray.filterNot(
predicate: (ULong) -> Boolean
): List<ULong>
fun UByteArray.filterNot(
predicate: (UByte) -> Boolean
): List<UByte>
fun UShortArray.filterNot(
predicate: (UShort) -> Boolean
): List<UShort>
filterNotNullTo
Appends all elements that are not null
to the given destination.
fun <C : MutableCollection<in T>, T : Any> Array<out T?>.filterNotNullTo(
destination: C
): C
fun <C : MutableCollection<in T>, T : Any> Iterable<T?>.filterNotNullTo(
destination: C
): C
filterNotTo
Appends all elements not matching the given predicate to the given destination.
fun <T, C : MutableCollection<in T>> Array<out T>.filterNotTo(
destination: C,
predicate: (T) -> Boolean
): C
fun <C : MutableCollection<in Byte>> ByteArray.filterNotTo(
destination: C,
predicate: (Byte) -> Boolean
): C
fun <C : MutableCollection<in Short>> ShortArray.filterNotTo(
destination: C,
predicate: (Short) -> Boolean
): C
fun <C : MutableCollection<in Int>> IntArray.filterNotTo(
destination: C,
predicate: (Int) -> Boolean
): C
fun <C : MutableCollection<in Long>> LongArray.filterNotTo(
destination: C,
predicate: (Long) -> Boolean
): C
fun <C : MutableCollection<in Float>> FloatArray.filterNotTo(
destination: C,
predicate: (Float) -> Boolean
): C
fun <C : MutableCollection<in Double>> DoubleArray.filterNotTo(
destination: C,
predicate: (Double) -> Boolean
): C
fun <C : MutableCollection<in Boolean>> BooleanArray.filterNotTo(
destination: C,
predicate: (Boolean) -> Boolean
): C
fun <C : MutableCollection<in Char>> CharArray.filterNotTo(
destination: C,
predicate: (Char) -> Boolean
): C
fun <T, C : MutableCollection<in T>> Iterable<T>.filterNotTo(
destination: C,
predicate: (T) -> Boolean
): C
fun <C : MutableCollection<in UInt>> UIntArray.filterNotTo(
destination: C,
predicate: (UInt) -> Boolean
): C
fun <C : MutableCollection<in ULong>> ULongArray.filterNotTo(
destination: C,
predicate: (ULong) -> Boolean
): C
fun <C : MutableCollection<in UByte>> UByteArray.filterNotTo(
destination: C,
predicate: (UByte) -> Boolean
): C
fun <C : MutableCollection<in UShort>> UShortArray.filterNotTo(
destination: C,
predicate: (UShort) -> Boolean
): C
Appends all entries not matching the given predicate into the given destination.
fun <K, V, M : MutableMap<in K, in V>> Map<out K, V>.filterNotTo(
destination: M,
predicate: (Entry<K, V>) -> Boolean
): M
filterTo
Appends all elements matching the given predicate to the given destination.
fun <T, C : MutableCollection<in T>> Array<out T>.filterTo(
destination: C,
predicate: (T) -> Boolean
): C
fun <C : MutableCollection<in Byte>> ByteArray.filterTo(
destination: C,
predicate: (Byte) -> Boolean
): C
fun <C : MutableCollection<in Short>> ShortArray.filterTo(
destination: C,
predicate: (Short) -> Boolean
): C
fun <C : MutableCollection<in Int>> IntArray.filterTo(
destination: C,
predicate: (Int) -> Boolean
): C
fun <C : MutableCollection<in Long>> LongArray.filterTo(
destination: C,
predicate: (Long) -> Boolean
): C
fun <C : MutableCollection<in Float>> FloatArray.filterTo(
destination: C,
predicate: (Float) -> Boolean
): C
fun <C : MutableCollection<in Double>> DoubleArray.filterTo(
destination: C,
predicate: (Double) -> Boolean
): C
fun <C : MutableCollection<in Boolean>> BooleanArray.filterTo(
destination: C,
predicate: (Boolean) -> Boolean
): C
fun <C : MutableCollection<in Char>> CharArray.filterTo(
destination: C,
predicate: (Char) -> Boolean
): C
fun <T, C : MutableCollection<in T>> Iterable<T>.filterTo(
destination: C,
predicate: (T) -> Boolean
): C
fun <C : MutableCollection<in UInt>> UIntArray.filterTo(
destination: C,
predicate: (UInt) -> Boolean
): C
fun <C : MutableCollection<in ULong>> ULongArray.filterTo(
destination: C,
predicate: (ULong) -> Boolean
): C
fun <C : MutableCollection<in UByte>> UByteArray.filterTo(
destination: C,
predicate: (UByte) -> Boolean
): C
fun <C : MutableCollection<in UShort>> UShortArray.filterTo(
destination: C,
predicate: (UShort) -> Boolean
): C
Appends all entries matching the given predicate into the mutable map given as destination parameter.
fun <K, V, M : MutableMap<in K, in V>> Map<out K, V>.filterTo(
destination: M,
predicate: (Entry<K, V>) -> Boolean
): M
find
Returns the first element matching the given predicate, or null
if no such element was found.
fun <T> Array<out T>.find(predicate: (T) -> Boolean): T?
fun ByteArray.find(predicate: (Byte) -> Boolean): Byte?
fun ShortArray.find(predicate: (Short) -> Boolean): Short?
fun IntArray.find(predicate: (Int) -> Boolean): Int?
fun LongArray.find(predicate: (Long) -> Boolean): Long?
fun FloatArray.find(predicate: (Float) -> Boolean): Float?
fun DoubleArray.find(predicate: (Double) -> Boolean): Double?
fun BooleanArray.find(
predicate: (Boolean) -> Boolean
): Boolean?
fun CharArray.find(predicate: (Char) -> Boolean): Char?
fun <T> Iterable<T>.find(predicate: (T) -> Boolean): T?
fun ULongArray.find(predicate: (ULong) -> Boolean): ULong?
fun UByteArray.find(predicate: (UByte) -> Boolean): UByte?
fun UShortArray.find(predicate: (UShort) -> Boolean): UShort?
findLast
Returns the last element matching the given predicate, or null
if no such element was found.
fun <T> Array<out T>.findLast(predicate: (T) -> Boolean): T?
fun ByteArray.findLast(predicate: (Byte) -> Boolean): Byte?
fun ShortArray.findLast(
predicate: (Short) -> Boolean
): Short?
fun IntArray.findLast(predicate: (Int) -> Boolean): Int?
fun LongArray.findLast(predicate: (Long) -> Boolean): Long?
fun FloatArray.findLast(
predicate: (Float) -> Boolean
): Float?
fun DoubleArray.findLast(
predicate: (Double) -> Boolean
): Double?
fun BooleanArray.findLast(
predicate: (Boolean) -> Boolean
): Boolean?
fun CharArray.findLast(predicate: (Char) -> Boolean): Char?
fun <T> Iterable<T>.findLast(predicate: (T) -> Boolean): T?
fun <T> List<T>.findLast(predicate: (T) -> Boolean): T?
fun ULongArray.findLast(
predicate: (ULong) -> Boolean
): ULong?
fun UByteArray.findLast(
predicate: (UByte) -> Boolean
): UByte?
fun UShortArray.findLast(
predicate: (UShort) -> Boolean
): UShort?
first
Returns the first element.
fun <T> Array<out T>.first(): T
fun ByteArray.first(): Byte
fun ShortArray.first(): Short
fun IntArray.first(): Int
fun LongArray.first(): Long
fun FloatArray.first(): Float
fun DoubleArray.first(): Double
fun BooleanArray.first(): Boolean
fun CharArray.first(): Char
fun <T> Iterable<T>.first(): T
fun <T> List<T>.first(): T
fun ULongArray.first(): ULong
fun UByteArray.first(): UByte
fun UShortArray.first(): UShort
Returns the first element matching the given predicate.
fun <T> Array<out T>.first(predicate: (T) -> Boolean): T
fun ByteArray.first(predicate: (Byte) -> Boolean): Byte
fun ShortArray.first(predicate: (Short) -> Boolean): Short
fun IntArray.first(predicate: (Int) -> Boolean): Int
fun LongArray.first(predicate: (Long) -> Boolean): Long
fun FloatArray.first(predicate: (Float) -> Boolean): Float
fun DoubleArray.first(predicate: (Double) -> Boolean): Double
fun BooleanArray.first(
predicate: (Boolean) -> Boolean
): Boolean
fun CharArray.first(predicate: (Char) -> Boolean): Char
fun <T> Iterable<T>.first(predicate: (T) -> Boolean): T
fun ULongArray.first(predicate: (ULong) -> Boolean): ULong
fun UByteArray.first(predicate: (UByte) -> Boolean): UByte
fun UShortArray.first(predicate: (UShort) -> Boolean): UShort
firstNotNullOf
Returns the first non-null value produced by transform function being applied to elements of this array in iteration order, or throws NoSuchElementException if no non-null value was produced.
fun <T, R : Any> Array<out T>.firstNotNullOf(
transform: (T) -> R?
): R
Returns the first non-null value produced by transform function being applied to elements of this collection in iteration order, or throws NoSuchElementException if no non-null value was produced.
fun <T, R : Any> Iterable<T>.firstNotNullOf(
transform: (T) -> R?
): R
Returns the first non-null value produced by transform function being applied to entries of this map in iteration order, or throws NoSuchElementException if no non-null value was produced.
firstNotNullOfOrNull
Returns the first non-null value produced by transform function being applied to elements of this array in iteration order,
or null
if no non-null value was produced.
fun <T, R : Any> Array<out T>.firstNotNullOfOrNull(
transform: (T) -> R?
): R?
firstOrNull
Returns the first element, or null
if the array is empty.
fun <T> Array<out T>.firstOrNull(): T?
fun ByteArray.firstOrNull(): Byte?
fun ShortArray.firstOrNull(): Short?
fun IntArray.firstOrNull(): Int?
fun LongArray.firstOrNull(): Long?
fun FloatArray.firstOrNull(): Float?
fun DoubleArray.firstOrNull(): Double?
fun BooleanArray.firstOrNull(): Boolean?
fun CharArray.firstOrNull(): Char?
fun ULongArray.firstOrNull(): ULong?
fun UByteArray.firstOrNull(): UByte?
fun UShortArray.firstOrNull(): UShort?
Returns the first element matching the given predicate, or null
if element was not found.
fun <T> Array<out T>.firstOrNull(
predicate: (T) -> Boolean
): T?
fun ByteArray.firstOrNull(
predicate: (Byte) -> Boolean
): Byte?
fun ShortArray.firstOrNull(
predicate: (Short) -> Boolean
): Short?
fun IntArray.firstOrNull(predicate: (Int) -> Boolean): Int?
fun LongArray.firstOrNull(
predicate: (Long) -> Boolean
): Long?
fun FloatArray.firstOrNull(
predicate: (Float) -> Boolean
): Float?
fun DoubleArray.firstOrNull(
predicate: (Double) -> Boolean
): Double?
fun BooleanArray.firstOrNull(
predicate: (Boolean) -> Boolean
): Boolean?
fun CharArray.firstOrNull(
predicate: (Char) -> Boolean
): Char?
fun <T> Iterable<T>.firstOrNull(
predicate: (T) -> Boolean
): T?
fun ULongArray.firstOrNull(
predicate: (ULong) -> Boolean
): ULong?
fun UByteArray.firstOrNull(
predicate: (UByte) -> Boolean
): UByte?
fun UShortArray.firstOrNull(
predicate: (UShort) -> Boolean
): UShort?
Returns the first element, or null
if the collection is empty.
fun <T> Iterable<T>.firstOrNull(): T?
Returns the first element, or null
if the list is empty.
fun <T> List<T>.firstOrNull(): T?
flatMap
Returns a single list of all elements yielded from results of transform function being invoked on each element of original array.
fun <R> ShortArray.flatMap(
transform: (Short) -> Iterable<R>
): List<R>
fun <R> FloatArray.flatMap(
transform: (Float) -> Iterable<R>
): List<R>
fun <R> DoubleArray.flatMap(
transform: (Double) -> Iterable<R>
): List<R>
fun <R> BooleanArray.flatMap(
transform: (Boolean) -> Iterable<R>
): List<R>
fun <R> ULongArray.flatMap(
transform: (ULong) -> Iterable<R>
): List<R>
fun <R> UByteArray.flatMap(
transform: (UByte) -> Iterable<R>
): List<R>
fun <R> UShortArray.flatMap(
transform: (UShort) -> Iterable<R>
): List<R>
Returns a single list of all elements yielded from results of transform function being invoked on each element of original collection.
flatMapIndexed
Returns a single list of all elements yielded from results of transform function being invoked on each element and its index in the original array.
fun <R> ShortArray.flatMapIndexed(
transform: (index: Int, Short) -> Iterable<R>
): List<R>
fun <R> FloatArray.flatMapIndexed(
transform: (index: Int, Float) -> Iterable<R>
): List<R>
fun <R> DoubleArray.flatMapIndexed(
transform: (index: Int, Double) -> Iterable<R>
): List<R>
fun <R> BooleanArray.flatMapIndexed(
transform: (index: Int, Boolean) -> Iterable<R>
): List<R>
fun <R> ULongArray.flatMapIndexed(
transform: (index: Int, ULong) -> Iterable<R>
): List<R>
fun <R> UByteArray.flatMapIndexed(
transform: (index: Int, UByte) -> Iterable<R>
): List<R>
fun <R> UShortArray.flatMapIndexed(
transform: (index: Int, UShort) -> Iterable<R>
): List<R>
Returns a single list of all elements yielded from results of transform function being invoked on each element and its index in the original collection.
flatMapIndexedTo
Appends all elements yielded from results of transform function being invoked on each element and its index in the original array, to the given destination.
fun <T, R, C : MutableCollection<in R>> Array<out T>.flatMapIndexedTo(
destination: C,
transform: (index: Int, T) -> Iterable<R>
): C
fun <R, C : MutableCollection<in R>> ByteArray.flatMapIndexedTo(
destination: C,
transform: (index: Int, Byte) -> Iterable<R>
): C
fun <R, C : MutableCollection<in R>> ShortArray.flatMapIndexedTo(
destination: C,
transform: (index: Int, Short) -> Iterable<R>
): C
fun <R, C : MutableCollection<in R>> IntArray.flatMapIndexedTo(
destination: C,
transform: (index: Int, Int) -> Iterable<R>
): C
fun <R, C : MutableCollection<in R>> LongArray.flatMapIndexedTo(
destination: C,
transform: (index: Int, Long) -> Iterable<R>
): C
fun <R, C : MutableCollection<in R>> FloatArray.flatMapIndexedTo(
destination: C,
transform: (index: Int, Float) -> Iterable<R>
): C
fun <R, C : MutableCollection<in R>> DoubleArray.flatMapIndexedTo(
destination: C,
transform: (index: Int, Double) -> Iterable<R>
): C
fun <R, C : MutableCollection<in R>> BooleanArray.flatMapIndexedTo(
destination: C,
transform: (index: Int, Boolean) -> Iterable<R>
): C
fun <R, C : MutableCollection<in R>> CharArray.flatMapIndexedTo(
destination: C,
transform: (index: Int, Char) -> Iterable<R>
): C
fun <T, R, C : MutableCollection<in R>> Array<out T>.flatMapIndexedTo(
destination: C,
transform: (index: Int, T) -> Sequence<R>
): C
fun <R, C : MutableCollection<in R>> UIntArray.flatMapIndexedTo(
destination: C,
transform: (index: Int, UInt) -> Iterable<R>
): C
fun <R, C : MutableCollection<in R>> ULongArray.flatMapIndexedTo(
destination: C,
transform: (index: Int, ULong) -> Iterable<R>
): C
fun <R, C : MutableCollection<in R>> UByteArray.flatMapIndexedTo(
destination: C,
transform: (index: Int, UByte) -> Iterable<R>
): C
fun <R, C : MutableCollection<in R>> UShortArray.flatMapIndexedTo(
destination: C,
transform: (index: Int, UShort) -> Iterable<R>
): C
Appends all elements yielded from results of transform function being invoked on each element and its index in the original collection, to the given destination.
fun <T, R, C : MutableCollection<in R>> Iterable<T>.flatMapIndexedTo(
destination: C,
transform: (index: Int, T) -> Iterable<R>
): C
fun <T, R, C : MutableCollection<in R>> Iterable<T>.flatMapIndexedTo(
destination: C,
transform: (index: Int, T) -> Sequence<R>
): C
flatMapTo
Appends all elements yielded from results of transform function being invoked on each element of original array, to the given destination.
fun <T, R, C : MutableCollection<in R>> Array<out T>.flatMapTo(
destination: C,
transform: (T) -> Iterable<R>
): C
fun <R, C : MutableCollection<in R>> ByteArray.flatMapTo(
destination: C,
transform: (Byte) -> Iterable<R>
): C
fun <R, C : MutableCollection<in R>> ShortArray.flatMapTo(
destination: C,
transform: (Short) -> Iterable<R>
): C
fun <R, C : MutableCollection<in R>> IntArray.flatMapTo(
destination: C,
transform: (Int) -> Iterable<R>
): C
fun <R, C : MutableCollection<in R>> LongArray.flatMapTo(
destination: C,
transform: (Long) -> Iterable<R>
): C
fun <R, C : MutableCollection<in R>> FloatArray.flatMapTo(
destination: C,
transform: (Float) -> Iterable<R>
): C
fun <R, C : MutableCollection<in R>> DoubleArray.flatMapTo(
destination: C,
transform: (Double) -> Iterable<R>
): C
fun <R, C : MutableCollection<in R>> BooleanArray.flatMapTo(
destination: C,
transform: (Boolean) -> Iterable<R>
): C
fun <R, C : MutableCollection<in R>> CharArray.flatMapTo(
destination: C,
transform: (Char) -> Iterable<R>
): C
fun <T, R, C : MutableCollection<in R>> Array<out T>.flatMapTo(
destination: C,
transform: (T) -> Sequence<R>
): C
fun <R, C : MutableCollection<in R>> UIntArray.flatMapTo(
destination: C,
transform: (UInt) -> Iterable<R>
): C
fun <R, C : MutableCollection<in R>> ULongArray.flatMapTo(
destination: C,
transform: (ULong) -> Iterable<R>
): C
fun <R, C : MutableCollection<in R>> UByteArray.flatMapTo(
destination: C,
transform: (UByte) -> Iterable<R>
): C