Package-level declarations
Collection types, such as Iterable, Collection, List, Set, Map and related top-level and extension functions.
Types
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.
Provides a skeletal implementation of the MutableList interface.
An iterator over a sequence of values of type Boolean
.
An iterator over a sequence of values of type Byte
.
An iterator over a sequence of values of type Char
.
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.
An iterator over a sequence of values of type Double
.
An iterator over a sequence of values of type Float
.
Data class representing a value from a collection or sequence, along with its index in that collection or sequence.
An iterator over a sequence of values of type Int
.
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.
An iterator over a collection that supports indexed access.
An iterator over a sequence of values of type Long
.
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.
A generic collection of elements that supports adding and removing elements.
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.
An iterator over a mutable collection. Provides the ability to remove elements while iterating.
A generic ordered collection of elements that supports adding and removing elements.
An iterator over a mutable collection that supports indexed access. Provides the ability to add, modify and remove elements while iterating.
A generic unordered collection of elements that does not support duplicate elements, and supports adding and removing elements.
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.
An iterator over a sequence of values of type Short
.
Properties
Returns the range of valid indices for the array.
Returns an IntRange of the valid indices for this collection.
Returns the last valid index for the array.
Returns the index of the last item in the list or -1 if the list is empty.
Functions
Adds all elements of the given elements array to this MutableCollection.
Adds all elements of the given elements collection to this MutableCollection.
Adds all elements of the given elements sequence to this MutableCollection.
Returns true
if array has at least one element.
Returns true
if collection has at least one element.
Returns true
if map has at least one entry.
Returns true
if at least one element matches the given predicate.
Returns true
if at least one entry matches the given predicate.
Returns a List that wraps the original array.
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.
Creates a Sequence instance that wraps the original array returning its elements when being iterated.
Creates a Sequence instance that wraps the original collection returning its elements when being iterated.
Creates a Sequence instance that wraps the original map returning its entries when being iterated.
Returns a Map containing the elements from the given array indexed by the key returned from keySelector function applied to each element.
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 array.
Returns a Map containing the values provided by valueTransform and indexed by keySelector functions applied to elements of the given collection.
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.
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.
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.
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.
Populates and returns the destination mutable map with key-value pairs provided by transform function applied to each element of the given array.
Populates and returns the destination mutable map with key-value pairs provided by transform function applied to each element of the given collection.
Returns an average value of elements in the array.
Returns an average value of elements in the collection.
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.
Searches this list or its range for an element for which the given comparison function returns zero using the binary search algorithm.
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.
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.
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.
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.
Returns 1st element from the array.
Returns 1st element from the list.
Returns the key component of the map entry.
Returns 2nd element from the array.
Returns 2nd element from the list.
Returns the value component of the map entry.
Returns 3rd element from the array.
Returns 3rd element from the list.
Returns 4th element from the array.
Returns 4th element from the list.
Returns 5th element from the array.
Returns 5th element from the list.
Checks if all elements in the specified collection are contained in this collection.
Returns new array which is a copy of the original array.
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.
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.
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.
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 a new array which is a copy of the specified range of the original array.
Returns the number of elements in this array.
Returns the number of elements in this collection.
Returns the number of entries in this map.
Returns the number of elements matching the given predicate.
Returns the number of entries matching the given predicate.
Returns a list containing only distinct elements from the given array.
Returns a list containing only distinct elements from the given collection.
Returns a list containing all elements except first n elements.
Returns a list containing all elements except last n elements.
Returns a list containing all elements except last elements that satisfy the given predicate.
Returns a list containing all elements except first elements that satisfy the given predicate.
Returns an element at the given index or throws an IndexOutOfBoundsException if the index is out of bounds of this array.
Returns an element at the given index or throws an IndexOutOfBoundsException if the index is out of bounds of this collection.
Returns an element at the given index or throws an IndexOutOfBoundsException if the index is out of bounds of this list.
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.
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.
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.
Fills this array or its subrange with the specified element value.
Returns a list containing only elements matching the given predicate.
Appends all elements matching the given predicate to the given destination.
Returns a list containing all elements that are instances of specified type parameter R.
Returns a list containing all elements that are instances of specified class.
Appends all elements that are instances of specified type parameter R to the given destination.
Appends all elements that are instances of specified class to the given destination.
Appends all elements that are not null
to the given destination.
Appends all elements not matching the given predicate to the given destination.
Appends all entries not matching the given predicate into the given destination.
Appends all elements matching the given predicate to the given destination.
Appends all entries matching the given predicate into the mutable map given as destination parameter.
Returns the first element matching the given predicate, or null
if no such element was found.
Returns the last element matching the given predicate, or null
if no such element was found.
Returns first element.
Returns the first element matching the given predicate.
Returns the first element, or null
if the array is empty.
Returns the first element, or null
if the collection is empty.
Returns the first element, or null
if the list is empty.
Returns the first element matching the given predicate, or null
if element was not found.
Returns a single list of all elements yielded from results of transform function being invoked on each element of original array.
Returns a single list of all elements yielded from results of transform function being invoked on each element of original collection.
Returns a single list of all elements yielded from results of transform function being invoked on each entry of original map.
Appends all elements yielded from results of transform function being invoked on each element of original array, to the given destination.
Appends all elements yielded from results of transform function being invoked on each element of original collection, to the given destination.
Appends all elements yielded from results of transform function being invoked on each entry of original map, to the given destination.
Accumulates value starting with initial value and applying operation from left to right to current accumulator value and each element with its index in the original array.
Accumulates value starting with initial value and applying operation from left to right to current accumulator value and each element with its index in the original collection.
Accumulates value starting with initial value and applying operation from right to left to each element with its index in the original array and current accumulator value.
Accumulates value starting with initial value and applying operation from right to left to each element with its index in the original list and current accumulator value.
Performs the given action on each element, providing sequential index with the element.
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.
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.
Returns the value for the given key, or the result of the defaultValue function if there was no entry for the given key.
Concurrent getOrPut, that is safe for concurrent maps.
Returns the value for the given key. If the key is not found in the map, calls the defaultValue function, puts its result into the map under the given key and returns it.
Returns the value of the property for the given object from this read-only map.
Returns the value of the property for the given object from this mutable map.
Groups elements of the original array by the key returned by the given keySelector function applied to each element and returns a map where each group key is associated with a list of corresponding elements.
Groups elements of the original collection by the key returned by the given keySelector function applied to each element and returns a map where each group key is associated with a list of corresponding elements.
Groups values returned by the valueTransform function applied to each element of the original array by the key returned by the given keySelector function applied to the element and returns a map where each group key is associated with a list of corresponding values.
Groups values returned by the valueTransform function applied to each element of the original collection by the key returned by the given keySelector function applied to the element and returns a map where each group key is associated with a list of corresponding values.
Groups elements of the original array by the key returned by the given keySelector function applied to each element and puts to the destination map each group key associated with a list of corresponding elements.
Groups elements of the original collection by the key returned by the given keySelector function applied to each element and puts to the destination map each group key associated with a list of corresponding elements.
Groups values returned by the valueTransform function applied to each element of the original array by the key returned by the given keySelector function applied to the element and puts to the destination map each group key associated with a list of corresponding values.
Groups values returned by the valueTransform function applied to each element of the original collection by the key returned by the given keySelector function applied to the element and puts to the destination map each group key associated with a list of corresponding values.
Returns index of the first element matching the given predicate, or -1 if the array does not contain such element.
Returns index of the first element matching the given predicate, or -1 if the collection does not contain such element.
Returns index of the first element matching the given predicate, or -1 if the list does not contain such element.
Returns index of the last element matching the given predicate, or -1 if the array does not contain such element.
Returns index of the last element matching the given predicate, or -1 if the collection does not contain such element.
Returns index of the last element matching the given predicate, or -1 if the list does not contain such element.
Returns a set containing all elements that are contained by both this array and the specified collection.
Returns a set containing all elements that are contained by both this collection and the specified collection.
Returns true
if the array is empty.
Returns true
if the array is not empty.
Returns true
if the collection is not empty.
Returns true
if this map is not empty.
Creates an Iterator for an java.util.Enumeration, allowing to use it in for
loops.
Returns the given iterator itself. This allows to use an instance of iterator in a for
loop.
Returns a MutableIterator over the mutable entries in the MutableMap.
Appends the string from all the elements separated using separator and using the given prefix and postfix if supplied.
Creates a string from all the elements separated using separator and using the given prefix and postfix if supplied.
Returns the last element.
Returns the last element matching the given predicate.
Returns the last element, or null
if the array is empty.
Returns the last element, or null
if the collection is empty.
Returns the last element, or null
if the list is empty.
Returns the last element matching the given predicate, or null
if no such element was found.
Returns a new LinkedHashMap with the specified contents, given as a list of pairs where the first component is the key and the second is the value.
Returns a new LinkedHashSet with the given elements. Elements of the set are iterated in the order they were specified.
Returns an empty read-only list. The returned list is serializable (JVM).
Returns an immutable list containing only the specified object element. The returned list is serializable.
Returns a new read-only list of given elements. The returned list is serializable (JVM).