UIntArray

value class UIntArray : Collection<UInt>

Constructors

UIntArray
Link copied to clipboard
fun UIntArray(size: Int)

Creates a new array of the specified size, with all elements initialized to zero.

Functions

contains
Link copied to clipboard
open operator override fun contains(element: UInt): Boolean
containsAll
Link copied to clipboard
open override fun containsAll(elements: Collection<UInt>): Boolean
get
Link copied to clipboard
operator fun get(index: Int): UInt

Returns the array element at the given index. This method can be called using the index operator.

isEmpty
Link copied to clipboard
open override fun isEmpty(): Boolean
iterator
Link copied to clipboard
open operator override fun iterator(): Iterator<UInt>

Creates an iterator over the elements of the array.

set
Link copied to clipboard
operator fun set(index: Int, value: UInt)

Sets the element at the given index to the given value. This method can be called using the index operator.

Properties

size
Link copied to clipboard
open override val size: Int

Returns the number of elements in the array.

Extensions

all
Link copied to clipboard
inline fun UIntArray.all(predicate: (UInt) -> Boolean): Boolean

Returns true if all elements match the given predicate.

any
Link copied to clipboard
inline fun UIntArray.any(): Boolean

Returns true if array has at least one element.

inline fun UIntArray.any(predicate: (UInt) -> Boolean): Boolean

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

asIntArray
Link copied to clipboard
inline fun UIntArray.asIntArray(): IntArray

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.

asList
Link copied to clipboard
expect fun UIntArray.asList(): List<UInt>

Returns a List that wraps the original array.

@ExperimentalUnsignedTypes
actual fun UIntArray.asList(): List<UInt>

Returns a List that wraps the original array.

@ExperimentalUnsignedTypes
actual fun UIntArray.asList(): List<UInt>

Returns a List that wraps the original array.

@ExperimentalUnsignedTypes
actual fun UIntArray.asList(): List<UInt>

Returns a List that wraps the original array.

associateWith
Link copied to clipboard
inline fun <V> UIntArray.associateWith(valueSelector: (UInt) -> V): Map<UInt, V>

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

associateWithTo
Link copied to clipboard
inline fun <V, M : MutableMap<in UInt, in V>> UIntArray.associateWithTo(destination: M, valueSelector: (UInt) -> 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.

binarySearch
Link copied to clipboard
@ExperimentalUnsignedTypes
fun UIntArray.binarySearch(element: UInt, 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.

component1
Link copied to clipboard
inline operator fun UIntArray.component1(): UInt

Returns 1st element from the array.

component2
Link copied to clipboard
inline operator fun UIntArray.component2(): UInt

Returns 2nd element from the array.

component3
Link copied to clipboard
inline operator fun UIntArray.component3(): UInt

Returns 3rd element from the array.

component4
Link copied to clipboard
inline operator fun UIntArray.component4(): UInt

Returns 4th element from the array.

component5
Link copied to clipboard
inline operator fun UIntArray.component5(): UInt

Returns 5th element from the array.

contentEquals
Link copied to clipboard
infix fun UIntArray.contentEquals(other: UIntArray): Boolean
infix fun UIntArray?.contentEquals(other: UIntArray?): Boolean

Returns true if the two specified arrays are structurally equal to one another, i.e. contain the same number of the same elements in the same order.

contentHashCode
Link copied to clipboard
fun UIntArray.contentHashCode(): Int
fun UIntArray?.contentHashCode(): Int

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

contentToString
Link copied to clipboard
fun UIntArray.contentToString(): String
fun UIntArray?.contentToString(): String

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

copyInto
Link copied to clipboard
inline fun UIntArray.copyInto(destination: UIntArray, destinationOffset: Int = 0, startIndex: Int = 0, endIndex: Int = size): UIntArray

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

copyOf
Link copied to clipboard
inline fun UIntArray.copyOf(): UIntArray

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

inline fun UIntArray.copyOf(newSize: Int): UIntArray

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.

copyOfRange
Link copied to clipboard
inline fun UIntArray.copyOfRange(fromIndex: Int, toIndex: Int): UIntArray

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

count
Link copied to clipboard
inline fun UIntArray.count(predicate: (UInt) -> Boolean): Int

Returns the number of elements matching the given predicate.

drop
Link copied to clipboard
fun UIntArray.drop(n: Int): List<UInt>

Returns a list containing all elements except first n elements.

dropLast
Link copied to clipboard
fun UIntArray.dropLast(n: Int): List<UInt>

Returns a list containing all elements except last n elements.

dropLastWhile
Link copied to clipboard
inline fun UIntArray.dropLastWhile(predicate: (UInt) -> Boolean): List<UInt>

Returns a list containing all elements except last elements that satisfy the given predicate.

dropWhile
Link copied to clipboard
inline fun UIntArray.dropWhile(predicate: (UInt) -> Boolean): List<UInt>

Returns a list containing all elements except first elements that satisfy the given predicate.

elementAt
Link copied to clipboard
expect fun UIntArray.elementAt(index: Int): UInt

Returns an element at the given index or throws an IndexOutOfBoundsException if the index is out of bounds of this array.

@ExperimentalUnsignedTypes
actual inline fun UIntArray.elementAt(index: Int): UInt

Returns an element at the given index or throws an IndexOutOfBoundsException if the index is out of bounds of this array.

@ExperimentalUnsignedTypes
actual fun UIntArray.elementAt(index: Int): UInt

Returns an element at the given index or throws an IndexOutOfBoundsException if the index is out of bounds of this array.

@ExperimentalUnsignedTypes
actual inline fun UIntArray.elementAt(index: Int): UInt

Returns an element at the given index or throws an IndexOutOfBoundsException if the index is out of bounds of this array.

elementAtOrElse
Link copied to clipboard
inline fun UIntArray.elementAtOrElse(index: Int, defaultValue: (Int) -> UInt): UInt

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.

elementAtOrNull
Link copied to clipboard
inline fun UIntArray.elementAtOrNull(index: Int): UInt?

Returns an element at the given index or null if the index is out of bounds of this array.

fill
Link copied to clipboard
fun UIntArray.fill(element: UInt, fromIndex: Int = 0, toIndex: Int = size)

Fills this array or its subrange with the specified element value.

filter
Link copied to clipboard
inline fun UIntArray.filter(predicate: (UInt) -> Boolean): List<UInt>

Returns a list containing only elements matching the given predicate.

filterIndexed
Link copied to clipboard
inline fun UIntArray.filterIndexed(predicate: (index: Int, UInt) -> Boolean): List<UInt>

Returns a list containing only elements matching the given predicate.

filterIndexedTo
Link copied to clipboard
inline fun <C : MutableCollection<in UInt>> UIntArray.filterIndexedTo(destination: C, predicate: (index: Int, UInt) -> Boolean): C

Appends all elements matching the given predicate to the given destination.

filterNot
Link copied to clipboard
inline fun UIntArray.filterNot(predicate: (UInt) -> Boolean): List<UInt>

Returns a list containing all elements not matching the given predicate.

filterNotTo
Link copied to clipboard
inline fun <C : MutableCollection<in UInt>> UIntArray.filterNotTo(destination: C, predicate: (UInt) -> Boolean): C

Appends all elements not matching the given predicate to the given destination.

filterTo
Link copied to clipboard
inline fun <C : MutableCollection<in UInt>> UIntArray.filterTo(destination: C, predicate: (UInt) -> Boolean): C

Appends all elements matching the given predicate to the given destination.

find
Link copied to clipboard
inline fun UIntArray.find(predicate: (UInt) -> Boolean): UInt?

Returns the first element matching the given predicate, or null if no such element was found.

findLast
Link copied to clipboard
inline fun UIntArray.findLast(predicate: (UInt) -> Boolean): UInt?

Returns the last element matching the given predicate, or null if no such element was found.

first
Link copied to clipboard
inline fun UIntArray.first(): UInt

Returns first element.

inline fun UIntArray.first(predicate: (UInt) -> Boolean): UInt

Returns the first element matching the given predicate.

firstOrNull
Link copied to clipboard
fun UIntArray.firstOrNull(): UInt?

Returns the first element, or null if the array is empty.

inline fun UIntArray.firstOrNull(predicate: (UInt) -> Boolean): UInt?

Returns the first element matching the given predicate, or null if element was not found.

flatMap
Link copied to clipboard
inline fun <R> UIntArray.flatMap(transform: (UInt) -> Iterable<R>): List<R>

Returns a single list of all elements yielded from results of transform function being invoked on each element of original array.

flatMapIndexed
Link copied to clipboard
inline fun <R> UIntArray.flatMapIndexed(transform: (index: Int, UInt) -> 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 array.

flatMapIndexedTo
Link copied to clipboard
inline fun <R, C : MutableCollection<in R>> UIntArray.flatMapIndexedTo(destination: C, transform: (index: Int, UInt) -> Iterable<R>): C

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.

flatMapTo
Link copied to clipboard
inline fun <R, C : MutableCollection<in R>> UIntArray.flatMapTo(destination: C, transform: (UInt) -> Iterable<R>): C

Appends all elements yielded from results of transform function being invoked on each element of original array, to the given destination.

fold
Link copied to clipboard
inline fun <R> UIntArray.fold(initial: R, operation: (R, UInt) -> R): R

Accumulates value starting with initial value and applying operation from left to right to current accumulator value and each element.

foldIndexed
Link copied to clipboard
inline fun <R> UIntArray.foldIndexed(initial: R, operation: (index: Int, R, UInt) -> R): R

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.

foldRight
Link copied to clipboard
inline fun <R> UIntArray.foldRight(initial: R, operation: (UInt, R) -> R): R

Accumulates value starting with initial value and applying operation from right to left to each element and current accumulator value.

foldRightIndexed
Link copied to clipboard
inline fun <R> UIntArray.foldRightIndexed(initial: R, operation: (index: Int, UInt, R) -> R): R

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.

forEach
Link copied to clipboard
inline fun UIntArray.forEach(action: (UInt) -> Unit)

Performs the given action on each element.

forEachIndexed
Link copied to clipboard
inline fun UIntArray.forEachIndexed(action: (index: Int, UInt) -> Unit)

Performs the given action on each element, providing sequential index with the element.

getOrElse
Link copied to clipboard
inline fun UIntArray.getOrElse(index: Int, defaultValue: (Int) -> UInt): UInt

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.

getOrNull
Link copied to clipboard
fun UIntArray.getOrNull(index: Int): UInt?

Returns an element at the given index or null if the index is out of bounds of this array.

groupBy
Link copied to clipboard
inline fun <K> UIntArray.groupBy(keySelector: (UInt) -> K): Map<K, List<UInt>>

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.

inline fun <K, V> UIntArray.groupBy(keySelector: (UInt) -> K, valueTransform: (UInt) -> V): Map<K, List<V>>

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.

groupByTo
Link copied to clipboard
inline fun <K, M : MutableMap<in K, MutableList<UInt>>> UIntArray.groupByTo(destination: M, keySelector: (UInt) -> K): M

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.

inline fun <K, V, M : MutableMap<in K, MutableList<V>>> UIntArray.groupByTo(destination: M, keySelector: (UInt) -> K, valueTransform: (UInt) -> V): M

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.

indexOf
Link copied to clipboard
inline fun UIntArray.indexOf(element: UInt): Int

Returns first index of element, or -1 if the array does not contain element.

indexOfFirst
Link copied to clipboard
inline fun UIntArray.indexOfFirst(predicate: (UInt) -> Boolean): Int

Returns index of the first element matching the given predicate, or -1 if the array does not contain such element.

indexOfLast
Link copied to clipboard
inline fun UIntArray.indexOfLast(predicate: (UInt) -> Boolean): Int

Returns index of the last element matching the given predicate, or -1 if the array does not contain such element.

indices
Link copied to clipboard
val UIntArray.indices: IntRange

Returns the range of valid indices for the array.

last
Link copied to clipboard
inline fun UIntArray.last(): UInt

Returns the last element.

inline fun UIntArray.last(predicate: (UInt) -> Boolean): UInt

Returns the last element matching the given predicate.

lastIndex
Link copied to clipboard
val UIntArray.lastIndex: Int

Returns the last valid index for the array.

lastIndexOf
Link copied to clipboard
inline fun UIntArray.lastIndexOf(element: UInt): Int

Returns last index of element, or -1 if the array does not contain element.

lastOrNull
Link copied to clipboard
fun UIntArray.lastOrNull(): UInt?

Returns the last element, or null if the array is empty.

inline fun UIntArray.lastOrNull(predicate: (UInt) -> Boolean): UInt?

Returns the last element matching the given predicate, or null if no such element was found.

map
Link copied to clipboard
inline fun <R> UIntArray.map(transform: (UInt) -> R): List<R>

Returns a list containing the results of applying the given transform function to each element in the original array.

mapIndexed
Link copied to clipboard
inline fun <R> UIntArray.mapIndexed(transform: (index: Int, UInt) -> R): List<R>

Returns a list containing the results of applying the given transform function to each element and its index in the original array.

mapIndexedTo
Link copied to clipboard
inline fun <R, C : MutableCollection<in R>> UIntArray.mapIndexedTo(destination: C, transform: (index: Int, UInt) -> R): C

Applies the given transform function to each element and its index in the original array and appends the results to the given destination.

mapTo
Link copied to clipboard
inline fun <R, C : MutableCollection<in R>> UIntArray.mapTo(destination: C, transform: (UInt) -> R): C

Applies the given transform function to each element of the original array and appends the results to the given destination.

max
Link copied to clipboard
@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5")
fun UIntArray.max(): UInt?
maxBy
Link copied to clipboard
@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5")
inline fun <R : Comparable<R>> UIntArray.maxBy(selector: (UInt) -> R): UInt?
maxByOrNull
Link copied to clipboard
inline fun <R : Comparable<R>> UIntArray.maxByOrNull(selector: (UInt) -> R): UInt?

Returns the first element yielding the largest value of the given function or null if there are no elements.

maxOf
Link copied to clipboard
inline fun UIntArray.maxOf(selector: (UInt) -> Double): Double
inline fun UIntArray.maxOf(selector: (UInt) -> Float): Float
inline fun <R : Comparable<R>> UIntArray.maxOf(selector: (UInt) -> R): R

Returns the largest value among all values produced by selector function applied to each element in the array.

maxOfOrNull
Link copied to clipboard
inline fun UIntArray.maxOfOrNull(selector: (UInt) -> Double): Double?
inline fun UIntArray.maxOfOrNull(selector: (UInt) -> Float): Float?
inline fun <R : Comparable<R>> UIntArray.maxOfOrNull(selector: (UInt) -> R): R?

Returns the largest value among all values produced by selector function applied to each element in the array or null if there are no elements.

maxOfWith
Link copied to clipboard
inline fun <R> UIntArray.maxOfWith(comparator: Comparator<in R>, selector: (UInt) -> R): R

Returns the largest value according to the provided comparator among all values produced by selector function applied to each element in the array.

maxOfWithOrNull
Link copied to clipboard
inline fun <R> UIntArray.maxOfWithOrNull(comparator: Comparator<in R>, selector: (UInt) -> R): R?

Returns the largest value according to the provided comparator among all values produced by selector function applied to each element in the array or null if there are no elements.

maxOrNull
Link copied to clipboard
fun UIntArray.maxOrNull(): UInt?

Returns the largest element or null if there are no elements.

maxWith
Link copied to clipboard
@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5")
fun UIntArray.maxWith(comparator: Comparator<in UInt>): UInt?
maxWithOrNull
Link copied to clipboard
fun UIntArray.maxWithOrNull(comparator: Comparator<in UInt>): UInt?

Returns the first element having the largest value according to the provided comparator or null if there are no elements.

min
Link copied to clipboard
@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5")
fun UIntArray.min(): UInt?
minBy
Link copied to clipboard
@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5")
inline fun <R : Comparable<R>> UIntArray.minBy(selector: (UInt) -> R): UInt?
minByOrNull
Link copied to clipboard
inline fun <R : Comparable<R>> UIntArray.minByOrNull(selector: (UInt) -> R): UInt?

Returns the first element yielding the smallest value of the given function or null if there are no elements.

minOf
Link copied to clipboard
inline fun UIntArray.minOf(selector: (UInt) -> Double): Double
inline fun UIntArray.minOf(selector: (UInt) -> Float): Float
inline fun <R : Comparable<R>> UIntArray.minOf(selector: (UInt) -> R): R

Returns the smallest value among all values produced by selector function applied to each element in the array.

minOfOrNull
Link copied to clipboard
inline fun UIntArray.minOfOrNull(selector: (UInt) -> Double): Double?
inline fun UIntArray.minOfOrNull(selector: (UInt) -> Float): Float?
inline fun <R : Comparable<R>> UIntArray.minOfOrNull(selector: (UInt) -> R): R?

Returns the smallest value among all values produced by selector function applied to each element in the array or null if there are no elements.

minOfWith
Link copied to clipboard
inline fun <R> UIntArray.minOfWith(comparator: Comparator<in R>, selector: (UInt) -> R): R

Returns the smallest value according to the provided comparator among all values produced by selector function applied to each element in the array.

minOfWithOrNull
Link copied to clipboard
inline fun <R> UIntArray.minOfWithOrNull(comparator: Comparator<in R>, selector: (UInt) -> R): R?

Returns the smallest value according to the provided comparator among all values produced by selector function applied to each element in the array or null if there are no elements.

minOrNull
Link copied to clipboard
fun UIntArray.minOrNull(): UInt?

Returns the smallest element or null if there are no elements.

minWith
Link copied to clipboard
@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5")
fun UIntArray.minWith(comparator: Comparator<in UInt>): UInt?
minWithOrNull
Link copied to clipboard
fun UIntArray.minWithOrNull(comparator: Comparator<in UInt>): UInt?

Returns the first element having the smallest value according to the provided comparator or null if there are no elements.

none
Link copied to clipboard
inline fun UIntArray.none(): Boolean

Returns true if the array has no elements.

inline fun UIntArray.none(predicate: (UInt) -> Boolean): Boolean

Returns true if no elements match the given predicate.

onEach
Link copied to clipboard
inline fun UIntArray.onEach(action: (UInt) -> Unit): UIntArray

Performs the given action on each element and returns the array itself afterwards.

onEachIndexed
Link copied to clipboard
inline fun UIntArray.onEachIndexed(action: (index: Int, UInt) -> Unit): UIntArray

Performs the given action on each element, providing sequential index with the element, and returns the array itself afterwards.

plus
Link copied to clipboard
inline operator fun UIntArray.plus(element: UInt): UIntArray

Returns an array containing all elements of the original array and then the given element.

operator fun UIntArray.plus(elements: Collection<UInt>): UIntArray

Returns an array containing all elements of the original array and then all elements of the given elements collection.

inline operator fun UIntArray.plus(elements: UIntArray): UIntArray

Returns an array containing all elements of the original array and then all elements of the given elements array.

random
Link copied to clipboard
inline fun UIntArray.random(): UInt

Returns a random element from this array.

fun UIntArray.random(random: Random): UInt

Returns a random element from this array using the specified source of randomness.

randomOrNull
Link copied to clipboard
inline fun UIntArray.randomOrNull(): UInt?

Returns a random element from this array, or null if this array is empty.

fun UIntArray.randomOrNull(random: Random): UInt?

Returns a random element from this array using the specified source of randomness, or null if this array is empty.

reduce
Link copied to clipboard
inline fun UIntArray.reduce(operation: (acc: UInt, UInt) -> UInt): UInt

Accumulates value starting with the first element and applying operation from left to right to current accumulator value and each element.

reduceIndexed
Link copied to clipboard
inline fun UIntArray.reduceIndexed(operation: (index: Int, acc: UInt, UInt) -> UInt): UInt

Accumulates value starting with the first element and applying operation from left to right to current accumulator value and each element with its index in the original array.

reduceIndexedOrNull
Link copied to clipboard
inline fun UIntArray.reduceIndexedOrNull(operation: (index: Int, acc: UInt, UInt) -> UInt): UInt?

Accumulates value starting with the first element and applying operation from left to right to current accumulator value and each element with its index in the original array.

reduceOrNull
Link copied to clipboard
inline fun UIntArray.reduceOrNull(operation: (acc: UInt, UInt) -> UInt): UInt?

Accumulates value starting with the first element and applying operation from left to right to current accumulator value and each element.

reduceRight
Link copied to clipboard
inline fun UIntArray.reduceRight(operation: (UInt, acc: UInt) -> UInt): UInt

Accumulates value starting with the last element and applying operation from right to left to each element and current accumulator value.

reduceRightIndexed
Link copied to clipboard
inline fun UIntArray.reduceRightIndexed(operation: (index: Int, UInt, acc: UInt) -> UInt): UInt

Accumulates value starting with the last element and applying operation from right to left to each element with its index in the original array and current accumulator value.

reduceRightIndexedOrNull
Link copied to clipboard
inline fun UIntArray.reduceRightIndexedOrNull(operation: (index: Int, UInt, acc: UInt) -> UInt): UInt?

Accumulates value starting with the last element and applying operation from right to left to each element with its index in the original array and current accumulator value.

reduceRightOrNull
Link copied to clipboard
inline fun UIntArray.reduceRightOrNull(operation: (UInt, acc: UInt) -> UInt): UInt?

Accumulates value starting with the last element and applying operation from right to left to each element and current accumulator value.

refTo
Link copied to clipboard
fun UIntArray.refTo(index: Int): CValuesRef<UIntVar>
reverse
Link copied to clipboard
inline fun UIntArray.reverse()

Reverses elements in the array in-place.

inline fun UIntArray.reverse(fromIndex: Int, toIndex: Int)

Reverses elements of the array in the specified range in-place.

reversed
Link copied to clipboard
fun UIntArray.reversed(): List<UInt>

Returns a list with elements in reversed order.

reversedArray
Link copied to clipboard
inline fun UIntArray.reversedArray(): UIntArray

Returns an array with elements of this array in reversed order.

runningFold
Link copied to clipboard
inline fun <R> UIntArray.runningFold(initial: R, operation: (R, UInt) -> R): List<R>

Returns a list containing successive accumulation values generated by applying operation from left to right to each element and current accumulator value that starts with initial value.

runningFoldIndexed
Link copied to clipboard
inline fun <R> UIntArray.runningFoldIndexed(initial: R, operation: (index: Int, R, UInt) -> R): List<R>

Returns a list containing successive accumulation values generated by applying operation from left to right to each element, its index in the original array and current accumulator value that starts with initial value.

runningReduce
Link copied to clipboard
inline fun UIntArray.runningReduce(operation: (acc: UInt, UInt) -> UInt): List<UInt>

Returns a list containing successive accumulation values generated by applying operation from left to right to each element and current accumulator value that starts with the first element of this array.

runningReduceIndexed
Link copied to clipboard
inline fun UIntArray.runningReduceIndexed(operation: (index: Int, acc: UInt, UInt) -> UInt): List<UInt>

Returns a list containing successive accumulation values generated by applying operation from left to right to each element, its index in the original array and current accumulator value that starts with the first element of this array.

scan
Link copied to clipboard
inline fun <R> UIntArray.scan(initial: R, operation: (R, UInt) -> R): List<R>

Returns a list containing successive accumulation values generated by applying operation from left to right to each element and current accumulator value that starts with initial value.

scanIndexed
Link copied to clipboard
inline fun <R> UIntArray.scanIndexed(initial: R, operation: (index: Int, R, UInt) -> R): List<R>

Returns a list containing successive accumulation values generated by applying operation from left to right to each element, its index in the original array and current accumulator value that starts with initial value.

shuffle
Link copied to clipboard
fun UIntArray.shuffle()

Randomly shuffles elements in this array in-place.

fun UIntArray.shuffle(random: Random)

Randomly shuffles elements in this array in-place using the specified random instance as the source of randomness.

single
Link copied to clipboard
inline fun UIntArray.single(): UInt

Returns the single element, or throws an exception if the array is empty or has more than one element.

inline fun UIntArray.single(predicate: (UInt) -> Boolean): UInt

Returns the single element matching the given predicate, or throws exception if there is no or more than one matching element.

singleOrNull
Link copied to clipboard
fun UIntArray.singleOrNull(): UInt?

Returns single element, or null if the array is empty or has more than one element.

inline fun UIntArray.singleOrNull(predicate: (UInt) -> Boolean): UInt?

Returns the single element matching the given predicate, or null if element was not found or more than one element was found.

slice
Link copied to clipboard
fun UIntArray.slice(indices: IntRange): List<UInt>

Returns a list containing elements at indices in the specified indices range.

fun UIntArray.slice(indices: Iterable<Int>): List<UInt>

Returns a list containing elements at specified indices.

sliceArray
Link copied to clipboard
fun UIntArray.sliceArray(indices: Collection<Int>): UIntArray

Returns an array containing elements of this array at specified indices.

fun UIntArray.sliceArray(indices: IntRange): UIntArray

Returns an array containing elements at indices in the specified indices range.

sort
Link copied to clipboard
fun UIntArray.sort()

Sorts the array in-place.

fun UIntArray.sort(fromIndex: Int = 0, toIndex: Int = size)

Sorts a range in the array in-place.

sortDescending
Link copied to clipboard
fun UIntArray.sortDescending()

Sorts elements in the array in-place descending according to their natural sort order.

fun UIntArray.sortDescending(fromIndex: Int, toIndex: Int)

Sorts elements of the array in the specified range in-place. The elements are sorted descending according to their natural sort order.

sorted
Link copied to clipboard
fun UIntArray.sorted(): List<UInt>

Returns a list of all elements sorted according to their natural sort order.

sortedArray
Link copied to clipboard
fun UIntArray.sortedArray(): UIntArray

Returns an array with all elements of this array sorted according to their natural sort order.

sortedArrayDescending
Link copied to clipboard

Returns an array with all elements of this array sorted descending according to their natural sort order.

sortedDescending
Link copied to clipboard
fun UIntArray.sortedDescending(): List<UInt>

Returns a list of all elements sorted descending according to their natural sort order.

sum
Link copied to clipboard
inline fun UIntArray.sum(): UInt

Returns the sum of all elements in the array.

sumBy
Link copied to clipboard
inline fun UIntArray.sumBy(selector: (UInt) -> UInt): UInt

Returns the sum of all values produced by selector function applied to each element in the array.

sumByDouble
Link copied to clipboard
inline fun UIntArray.sumByDouble(selector: (UInt) -> Double): Double

Returns the sum of all values produced by selector function applied to each element in the array.

sumOf
Link copied to clipboard
@JvmName(name = "sumOfDouble")
inline fun UIntArray.sumOf(selector: (UInt) -> Double): Double
inline fun UIntArray.sumOf(selector: (UInt) -> Int): Int
@JvmName(name = "sumOfLong")
inline fun UIntArray.sumOf(selector: (UInt) -> Long): Long
@JvmName(name = "sumOfUInt")
inline fun UIntArray.sumOf(selector: (UInt) -> UInt): UInt
@JvmName(name = "sumOfULong")
inline fun UIntArray.sumOf(selector: (UInt) -> ULong): ULong

Returns the sum of all values produced by selector function applied to each element in the array.

@JvmName(name = "sumOfBigDecimal")
@ExperimentalUnsignedTypes
inline fun UIntArray.sumOf(selector: (UInt) -> BigDecimal): BigDecimal
@JvmName(name = "sumOfBigInteger")
@ExperimentalUnsignedTypes
inline fun UIntArray.sumOf(selector: (UInt) -> BigInteger): BigInteger

Returns the sum of all values produced by selector function applied to each element in the array.

take
Link copied to clipboard
fun UIntArray.take(n: Int): List<UInt>

Returns a list containing first n elements.

takeLast
Link copied to clipboard
fun UIntArray.takeLast(n: Int): List<UInt>

Returns a list containing last n elements.

takeLastWhile
Link copied to clipboard
inline fun UIntArray.takeLastWhile(predicate: (UInt) -> Boolean): List<UInt>

Returns a list containing last elements satisfying the given predicate.

takeWhile
Link copied to clipboard
inline fun UIntArray.takeWhile(predicate: (UInt) -> Boolean): List<UInt>

Returns a list containing first elements satisfying the given predicate.

toCValues
Link copied to clipboard
fun UIntArray.toCValues(): CValues<UIntVar>
toIntArray
Link copied to clipboard
inline fun UIntArray.toIntArray(): IntArray

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

toTypedArray
Link copied to clipboard
fun UIntArray.toTypedArray(): Array<UInt>

Returns a typed object array containing all of the elements of this primitive array.

withIndex
Link copied to clipboard

Returns a lazy Iterable that wraps each element of the original array into an IndexedValue containing the index of that element and the element itself.

zip
Link copied to clipboard
infix fun <R> UIntArray.zip(other: Array<out R>): List<Pair<UInt, R>>
infix fun UIntArray.zip(other: UIntArray): List<Pair<UInt, UInt>>

Returns a list of pairs built from the elements of this array and the other array with the same index. The returned list has length of the shortest collection.

inline fun <R, V> UIntArray.zip(other: Array<out R>, transform: (a: UInt, R) -> V): List<V>

Returns a list of values built from the elements of this array and the other array with the same index using the provided transform function applied to each pair of elements. The returned list has length of the shortest collection.

infix fun <R> UIntArray.zip(other: Iterable<R>): List<Pair<UInt, R>>

Returns a list of pairs built from the elements of this collection and other array with the same index. The returned list has length of the shortest collection.

inline fun <R, V> UIntArray.zip(other: Iterable<R>, transform: (a: UInt, R) -> V): List<V>

Returns a list of values built from the elements of this array and the other collection with the same index using the provided transform function applied to each pair of elements. The returned list has length of the shortest collection.

inline fun <V> UIntArray.zip(other: UIntArray, transform: (a: UInt, b: UInt) -> V): List<V>

Returns a list of values built from the elements of this array and the other array with the same index using the provided transform function applied to each pair of elements. The returned list has length of the shortest array.