Spec-Zone.ru › Kotlin 1.6

copyInto

kotlin-stdlib / kotlin.collections / copyInto
Требования к платформе и версии: JVM (1.3), JS (1.3), Native (1.3)
fun <T> Array<out T>.copyInto(
    destination: Array<T>, 
    destinationOffset: Int = 0, 
    startIndex: Int = 0, 
    endIndex: Int = size
): Array<T>
fun ByteArray.copyInto(
    destination: ByteArray, 
    destinationOffset: Int = 0, 
    startIndex: Int = 0, 
    endIndex: Int = size
): ByteArray
fun ShortArray.copyInto(
    destination: ShortArray, 
    destinationOffset: Int = 0, 
    startIndex: Int = 0, 
    endIndex: Int = size
): ShortArray
fun IntArray.copyInto(
    destination: IntArray, 
    destinationOffset: Int = 0, 
    startIndex: Int = 0, 
    endIndex: Int = size
): IntArray
fun LongArray.copyInto(
    destination: LongArray, 
    destinationOffset: Int = 0, 
    startIndex: Int = 0, 
    endIndex: Int = size
): LongArray
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
fun CharArray.copyInto(
    destination: CharArray, 
    destinationOffset: Int = 0, 
    startIndex: Int = 0, 
    endIndex: Int = size
): CharArray

Копирует этот массив или его поддиапазон в массив destination и возвращает этот массив.

Разрешается передать тот же массив в destination и даже указать поддиапазон так, чтобы он перекрывался с целевым диапазоном.

Параметры

destination - массив для копирования.

destinationOffset - позиция в массиве destination для копирования, по умолчанию 0.

startIndex - начало (включительно) поддиапазона для копирования, по умолчанию 0.

endIndex - конец (исключительно) поддиапазона для копирования, по умолчанию размер этого массива.

Исключения

IndexOutOfBoundsException - или IllegalArgumentException, когда startIndex или endIndex выходит за пределы индексов этого массива или когда startIndex > endIndex.

IndexOutOfBoundsException - когда поддиапазон не помещается в массив destinationOffset, или когда этот индекс выходит за пределы диапазона индексов массива destination.

Возврат массив destination.

Требования к платформе и версии: JVM (1.3), JS (1.3), Native (1.3)
@ExperimentalUnsignedTypes fun UIntArray.copyInto(
    destination: UIntArray, 
    destinationOffset: Int = 0, 
    startIndex: Int = 0, 
    endIndex: Int = size
): UIntArray
@ExperimentalUnsignedTypes fun ULongArray.copyInto(
    destination: ULongArray, 
    destinationOffset: Int = 0, 
    startIndex: Int = 0, 
    endIndex: Int = size
): ULongArray
@ExperimentalUnsignedTypes fun UByteArray.copyInto(
    destination: UByteArray, 
    destinationOffset: Int = 0, 
    startIndex: Int = 0, 
    endIndex: Int = size
): UByteArray
@ExperimentalUnsignedTypes fun UShortArray.copyInto(
    destination: UShortArray, 
    destinationOffset: Int = 0, 
    startIndex: Int = 0, 
    endIndex: Int = size
): UShortArray

Копирует этот массив или его поддиапазон в массив destination и возвращает этот массив.

Разрешается передать тот же массив в destination и даже указать поддиапазон так, чтобы он перекрывался с целевым диапазоном.

Параметры

destination - массив для копирования.

destinationOffset - позиция в массиве destination для копирования, по умолчанию 0.

startIndex - начало (включительно) поддиапазона для копирования, по умолчанию 0.

endIndex - конец (исключительно) поддиапазона для копирования, по умолчанию размер этого массива.

Исключения

IndexOutOfBoundsException - или IllegalArgumentException, когда startIndex или endIndex выходит за пределы индексов этого массива или когда startIndex > endIndex.

IndexOutOfBoundsException - когда поддиапазон не помещается в массив destination начиная с указанного destinationOffset, или когда этот индекс выходит за пределы диапазона индексов массива destination.

Возврат массив destination.

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

Spec-Zone.ru

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