Spec-Zone.ru › Kotlin 2

component4

kotlin-stdlib/kotlin.collections/component4

Начиная с Kotlin: 1.0

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

Возвращает 4-й элемент массива.

Если размер этого массива меньше 4, выбрасывается IndexOutOfBoundsException, за исключением Kotlin/JS, где поведение не определено, и Kotlin/Wasm, где вместо этого будет вызвана ловушка, если при компоновке исполняемого файла не был указан флаг компилятора -Xwasm-enable-array-range-checks.


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

Возвращает 4-й элемент списка.

Выбрасывает IndexOutOfBoundsException, если размер этого списка меньше 4.


@ExperimentalUnsignedTypes
inline operator fun UIntArray.component4(): UInt
@ExperimentalUnsignedTypes
inline operator fun ULongArray.component4(): ULong
@ExperimentalUnsignedTypes
inline operator fun UByteArray.component4(): UByte
@ExperimentalUnsignedTypes
inline operator fun UShortArray.component4(): UShort

Возвращает 4-й элемент массива.

Если размер этого массива меньше 4, выбрасывается IndexOutOfBoundsException, за исключением Kotlin/JS, где поведение не определено, и Kotlin/Wasm, где вместо этого будет вызвана ловушка, если при компоновке исполняемого файла не был указан флаг компилятора -Xwasm-enable-array-range-checks.

© 2010–2026 JetBrains s.r.o. and Kotlin Programming Language contributors
Licensed under the Apache License, Version 2.0.
https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/component4.html

Spec-Zone.ru

Настройки Оффлайн Что нового Помощь О нас
Spec-Zone .ru
спецификации, руководства, описания, API