UShortArray

value class UShortArray : Collection<UShort>

Constructors

UShortArray
Link copied to clipboard
fun UShortArray(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: UShort): Boolean
containsAll
Link copied to clipboard
open override fun containsAll(elements: Collection<UShort>): Boolean
get
Link copied to clipboard
operator fun get(index: Int): UShort

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<UShort>

Creates an iterator over the elements of the array.

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

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 UShortArray.all(predicate: (UShort) -> Boolean): Boolean

Returns true if all elements match the given predicate.

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

Returns true if array has at least one element.

inline fun UShortArray.any(predicate: (UShort) -> Boolean): Boolean

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

asList
Link copied to clipboard
expect fun UShortArray.asList(): List<UShort>

Returns a List that wraps the original array.

@ExperimentalUnsignedTypes
actual fun UShortArray.asList(): List<UShort>

Returns a List that wraps the original array.

@ExperimentalUnsignedTypes
actual fun UShortArray.asList(): List<UShort>

Returns a List that wraps the original array.

@ExperimentalUnsignedTypes
actual fun UShortArray.asList(): List<UShort>

Returns a List that wraps the original array.

asShortArray
Link copied to clipboard
inline fun UShortArray.asShortArray(): ShortArray

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.

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

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

associateWithTo
Link copied to clipboard
inline fun <V, M : MutableMap<in UShort, in V>> UShortArray.associateWithTo(destination: M, valueSelector: (UShort) -> V): M

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

binarySearch
Link copied to clipboard
@ExperimentalUnsignedTypes
fun UShortArray.binarySearch(element: UShort, fromIndex: Int = 0, toIndex: Int = size): Int

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

component1
Link copied to clipboard
inline operator fun UShortArray.component1(): UShort

Returns 1st element from the array.

component2
Link copied to clipboard
inline operator fun UShortArray.component2(): UShort

Returns 2nd element from the array.

component3
Link copied to clipboard
inline operator fun UShortArray.component3(): UShort

Returns 3rd element from the array.

component4
Link copied to clipboard
inline operator fun UShortArray.component4(): UShort

Returns 4th element from the array.

component5
Link copied to clipboard
inline operator fun UShortArray.component5(): UShort

Returns 5th element from the array.

contentEquals
Link copied to clipboard
infix fun UShortArray.contentEquals(other: UShortArray): Boolean
infix fun UShortArray?.contentEquals(other: UShortArray?): 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 UShortArray.contentHashCode(): Int
fun UShortArray?.contentHashCode(): Int

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

contentToString
Link copied to clipboard
fun UShortArray.contentToString(): String
fun UShortArray?.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 UShortArray.copyInto(destination: UShortArray, destinationOffset: Int = 0, startIndex: Int = 0, endIndex: Int = size): UShortArray

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

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

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

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

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 UShortArray.copyOfRange(fromIndex: Int, toIndex: Int): UShortArray

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

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

Returns the number of elements matching the given predicate.

drop
Link copied to clipboard
fun UShortArray.drop(n: Int): List<UShort>

Returns a list containing all elements except first n elements.

dropLast
Link copied to clipboard
fun UShortArray.dropLast(n: Int): List<UShort>

Returns a list containing all elements except last n elements.

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

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

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

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

elementAt
Link copied to clipboard
expect fun UShortArray.elementAt(index: Int): UShort

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 UShortArray.elementAt(index: Int): UShort

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

@ExperimentalUnsignedTypes
actual fun UShortArray.elementAt(index: Int): UShort

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 UShortArray.elementAt(index: Int): UShort

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 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 array.

elementAtOrNull
Link copied to clipboard
inline fun UShortArray.elementAtOrNull(index: Int): UShort?

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 UShortArray.fill(element: UShort, fromIndex: Int = 0, toIndex: Int = size)

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

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

Returns a list containing only elements matching the given predicate.

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

Returns a list containing only elements matching the given predicate.

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

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

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

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

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

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

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

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

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

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

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

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

first
Link copied to clipboard
inline fun UShortArray.first(): UShort

Returns first element.

inline fun UShortArray.first(predicate: (UShort) -> Boolean): UShort

Returns the first element matching the given predicate.

firstOrNull
Link copied to clipboard
fun UShortArray.firstOrNull(): UShort?

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

inline fun UShortArray.firstOrNull(predicate: (UShort) -> Boolean): UShort?

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

flatMap
Link copied to clipboard
inline 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 array.

flatMapIndexed
Link copied to clipboard
inline 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 array.

flatMapIndexedTo
Link copied to clipboard
inline 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 array, to the given destination.

flatMapTo
Link copied to clipboard
inline fun <R, C : MutableCollection<in R>> UShortArray.flatMapTo(destination: C, transform: (UShort) -> 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> UShortArray.fold(initial: R, operation: (R, UShort) -> 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> UShortArray.foldIndexed(initial: R, operation: (index: Int, R, UShort) -> 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> UShortArray.foldRight(initial: R, operation: (UShort, 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> UShortArray.foldRightIndexed(initial: R, operation: (index: Int, UShort, 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 UShortArray.forEach(action: (UShort) -> Unit)

Performs the given action on each element.

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

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

getOrElse
Link copied to clipboard
inline fun UShortArray.getOrElse(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 array.

getOrNull
Link copied to clipboard
fun UShortArray.getOrNull(index: Int): UShort?

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> UShortArray.groupBy(keySelector: (UShort) -> K): Map<K, List<UShort>>

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> UShortArray.groupBy(keySelector: (UShort) -> K, valueTransform: (UShort) -> 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<UShort>>> UShortArray.groupByTo(destination: M, keySelector: (UShort) -> 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>>> UShortArray.groupByTo(destination: M, keySelector: (UShort) -> K, valueTransform: (UShort) -> 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 UShortArray.indexOf(element: UShort): Int

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

indexOfFirst
Link copied to clipboard
inline fun UShortArray.indexOfFirst(predicate: (UShort) -> 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 UShortArray.indexOfLast(predicate: (UShort) -> 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 UShortArray.indices: IntRange

Returns the range of valid indices for the array.

last
Link copied to clipboard
inline fun UShortArray.last(): UShort

Returns the last element.

inline fun UShortArray.last(predicate: (UShort) -> Boolean): UShort

Returns the last element matching the given predicate.

lastIndex
Link copied to clipboard
val UShortArray.lastIndex: Int

Returns the last valid index for the array.

lastIndexOf
Link copied to clipboard
inline fun UShortArray.lastIndexOf(element: UShort): Int

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

lastOrNull
Link copied to clipboard
fun UShortArray.lastOrNull(): UShort?

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

inline fun UShortArray.lastOrNull(predicate: (UShort) -> Boolean): UShort?

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

map
Link copied to clipboard
inline fun <R> UShortArray.map(transform: (UShort) -> 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> UShortArray.mapIndexed(transform: (index: Int, UShort) -> 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>> UShortArray.mapIndexedTo(destination: C, transform: (index: Int, UShort) -> 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>> UShortArray.mapTo(destination: C, transform: (UShort) -> 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 UShortArray.max(): UShort?
maxBy
Link copied to clipboard
@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5")
inline fun <R : Comparable<R>> UShortArray.maxBy(selector: (UShort) -> R): UShort?
maxByOrNull
Link copied to clipboard
inline fun <R : Comparable<R>> UShortArray.maxByOrNull(selector: (UShort) -> R): UShort?

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 UShortArray.maxOf(selector: (UShort) -> Double): Double
inline fun UShortArray.maxOf(selector: (UShort) -> Float): Float
inline fun <R : Comparable<R>> UShortArray.maxOf(selector: (UShort) -> 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 UShortArray.maxOfOrNull(selector: (UShort) -> Double): Double?
inline fun UShortArray.maxOfOrNull(selector: (UShort) -> Float): Float?
inline fun <R : Comparable<R>> UShortArray.maxOfOrNull(selector: (UShort) -> 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> UShortArray.maxOfWith(comparator: Comparator<in R>, selector: (UShort) -> 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> UShortArray.maxOfWithOrNull(comparator: Comparator<in R>, selector: (UShort) -> 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 UShortArray.maxOrNull(): UShort?

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

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

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 UShortArray.min(): UShort?
minBy
Link copied to clipboard
@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5")
inline fun <R : Comparable<R>> UShortArray.minBy(selector: (UShort) -> R): UShort?
minByOrNull
Link copied to clipboard
inline fun <R : Comparable<R>> UShortArray.minByOrNull(selector: (UShort) -> R): UShort?

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 UShortArray.minOf(selector: (UShort) -> Double): Double
inline fun UShortArray.minOf(selector: (UShort) -> Float): Float
inline fun <R : Comparable<R>> UShortArray.minOf(selector: (UShort) -> 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 UShortArray.minOfOrNull(selector: (UShort) -> Double): Double?
inline fun UShortArray.minOfOrNull(selector: (UShort) -> Float): Float?
inline fun <R : Comparable<R>> UShortArray.minOfOrNull(selector: (UShort) -> 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> UShortArray.minOfWith(comparator: Comparator<in R>, selector: (UShort) -> 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> UShortArray.minOfWithOrNull(comparator: Comparator<in R>, selector: (UShort) -> 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 UShortArray.minOrNull(): UShort?

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

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

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 UShortArray.none(): Boolean

Returns true if the array has no elements.

inline fun UShortArray.none(predicate: (UShort) -> Boolean): Boolean

Returns true if no elements match the given predicate.

onEach
Link copied to clipboard
inline fun UShortArray.onEach(action: (UShort) -> Unit): UShortArray

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

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

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 UShortArray.plus(element: UShort): UShortArray

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

operator fun UShortArray.plus(elements: Collection<UShort>): UShortArray

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

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

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 UShortArray.random(): UShort

Returns a random element from this array.

fun UShortArray.random(random: Random): UShort

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

randomOrNull
Link copied to clipboard
inline fun UShortArray.randomOrNull(): UShort?

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

fun UShortArray.randomOrNull(random: Random): UShort?

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 UShortArray.reduce(operation: (acc: UShort, UShort) -> UShort): UShort

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 UShortArray.reduceIndexed(operation: (index: Int, acc: UShort, UShort) -> UShort): UShort

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 UShortArray.reduceIndexedOrNull(operation: (index: Int, acc: UShort, UShort) -> UShort): UShort?

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 UShortArray.reduceOrNull(operation: (acc: UShort, UShort) -> UShort): UShort?

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 UShortArray.reduceRight(operation: (UShort, acc: UShort) -> UShort): UShort

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 UShortArray.reduceRightIndexed(operation: (index: Int, UShort, acc: UShort) -> UShort): UShort

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 UShortArray.reduceRightIndexedOrNull(operation: (index: Int, UShort, acc: UShort) -> UShort): UShort?

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 UShortArray.reduceRightOrNull(operation: (UShort, acc: UShort) -> UShort): UShort?

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 UShortArray.refTo(index: Int): CValuesRef<UShortVar>
reverse
Link copied to clipboard
inline fun UShortArray.reverse()

Reverses elements in the array in-place.

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

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

reversed
Link copied to clipboard
fun UShortArray.reversed(): List<UShort>

Returns a list with elements in reversed order.

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

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

runningFold
Link copied to clipboard
inline fun <R> UShortArray.runningFold(initial: R, operation: (R, UShort) -> 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> UShortArray.runningFoldIndexed(initial: R, operation: (index: Int, R, UShort) -> 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 UShortArray.runningReduce(operation: (acc: UShort, UShort) -> UShort): List<UShort>

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 UShortArray.runningReduceIndexed(operation: (index: Int, acc: UShort, UShort) -> UShort): List<UShort>

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> UShortArray.scan(initial: R, operation: (R, UShort) -> 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> UShortArray.scanIndexed(initial: R, operation: (index: Int, R, UShort) -> 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 UShortArray.shuffle()

Randomly shuffles elements in this array in-place.

fun UShortArray.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 UShortArray.single(): UShort

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

inline fun UShortArray.single(predicate: (UShort) -> Boolean): UShort

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 UShortArray.singleOrNull(): UShort?

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

inline fun UShortArray.singleOrNull(predicate: (UShort) -> Boolean): UShort?

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 UShortArray.slice(indices: IntRange): List<UShort>

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

fun UShortArray.slice(indices: Iterable<Int>): List<UShort>

Returns a list containing elements at specified indices.

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

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

fun UShortArray.sliceArray(indices: IntRange): UShortArray

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

sort
Link copied to clipboard
fun UShortArray.sort()

Sorts the array in-place.

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

Sorts a range in the array in-place.

sortDescending
Link copied to clipboard
fun UShortArray.sortDescending()

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

fun UShortArray.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 UShortArray.sorted(): List<UShort>

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

sortedArray
Link copied to clipboard

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

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

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

Returns the sum of all elements in the array.

sumBy
Link copied to clipboard
inline fun UShortArray.sumBy(selector: (UShort) -> 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 UShortArray.sumByDouble(selector: (UShort) -> 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 UShortArray.sumOf(selector: (UShort) -> Double): Double
inline fun UShortArray.sumOf(selector: (UShort) -> Int): Int
@JvmName(name = "sumOfLong")
inline fun UShortArray.sumOf(selector: (UShort) -> Long): Long
@JvmName(name = "sumOfUInt")
inline fun UShortArray.sumOf(selector: (UShort) -> UInt): UInt
@JvmName(name = "sumOfULong")
inline fun UShortArray.sumOf(selector: (UShort) -> 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 UShortArray.sumOf(selector: (UShort) -> BigDecimal): BigDecimal
@JvmName(name = "sumOfBigInteger")
@ExperimentalUnsignedTypes
inline fun UShortArray.sumOf(selector: (UShort) -> 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 UShortArray.take(n: Int): List<UShort>

Returns a list containing first n elements.

takeLast
Link copied to clipboard
fun UShortArray.takeLast(n: Int): List<UShort>

Returns a list containing last n elements.

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

Returns a list containing last elements satisfying the given predicate.

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

Returns a list containing first elements satisfying the given predicate.

toCValues
Link copied to clipboard
fun UShortArray.toCValues(): CValues<UShortVar>
toShortArray
Link copied to clipboard
inline fun UShortArray.toShortArray(): ShortArray

Returns an array of type ShortArray, 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

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> UShortArray.zip(other: Array<out R>): List<Pair<UShort, R>>
infix fun UShortArray.zip(other: UShortArray): List<Pair<UShort, UShort>>

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> UShortArray.zip(other: Array<out R>, transform: (a: UShort, 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> UShortArray.zip(other: Iterable<R>): List<Pair<UShort, 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> UShortArray.zip(other: Iterable<R>, transform: (a: UShort, 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> UShortArray.zip(other: UShortArray, transform: (a: UShort, b: UShort) -> 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.