Add documentation for Array and String get() function behavior
These docs are already added to big kotlin.
This commit is contained in:
committed by
Nikolay Igotti
parent
613084ad9b
commit
b654e84ca1
@@ -45,10 +45,12 @@ public final class Array<T> {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the array element at the specified [index]. This method can be called using the
|
* Returns the array element at the specified [index]. This method can be called using the
|
||||||
* index operator:
|
* index operator.
|
||||||
* ```
|
* ```
|
||||||
* value = arr[index]
|
* value = arr[index]
|
||||||
* ```
|
* ```
|
||||||
|
*
|
||||||
|
* If the [index] is out of bounds of this array, throws an [IndexOutOfBoundsException].
|
||||||
*/
|
*/
|
||||||
@SymbolName("Kotlin_Array_get")
|
@SymbolName("Kotlin_Array_get")
|
||||||
@PointsTo(0b0100, 0, 0b0001) // <this> points to <return>, <return> points to <this>.
|
@PointsTo(0b0100, 0, 0b0001) // <this> points to <return>, <return> points to <this>.
|
||||||
@@ -56,10 +58,12 @@ public final class Array<T> {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the array element at the specified [index] to the specified [value]. This method can
|
* Sets the array element at the specified [index] to the specified [value]. This method can
|
||||||
* be called using the index operator:
|
* be called using the index operator.
|
||||||
* ```
|
* ```
|
||||||
* arr[index] = value
|
* arr[index] = value
|
||||||
* ```
|
* ```
|
||||||
|
*
|
||||||
|
* If the [index] is out of bounds of this array, throws an [IndexOutOfBoundsException].
|
||||||
*/
|
*/
|
||||||
@SymbolName("Kotlin_Array_set")
|
@SymbolName("Kotlin_Array_set")
|
||||||
@PointsTo(0b0100, 0, 0b0001) // <this> points to <value>, <value> points to <this>.
|
@PointsTo(0b0100, 0, 0b0001) // <this> points to <value>, <value> points to <this>.
|
||||||
|
|||||||
@@ -35,9 +35,19 @@ public final class ByteArray {
|
|||||||
public val size: Int
|
public val size: Int
|
||||||
get() = getArrayLength()
|
get() = getArrayLength()
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the array element at the given [index]. This method can be called using the index operator.
|
||||||
|
*
|
||||||
|
* If the [index] is out of bounds of this array, throws an [IndexOutOfBoundsException].
|
||||||
|
*/
|
||||||
@SymbolName("Kotlin_ByteArray_get")
|
@SymbolName("Kotlin_ByteArray_get")
|
||||||
external public operator fun get(index: Int): Byte
|
external public operator fun get(index: Int): Byte
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the element at the given [index] to the given [value]. This method can be called using the index operator.
|
||||||
|
*
|
||||||
|
* If the [index] is out of bounds of this array, throws an [IndexOutOfBoundsException].
|
||||||
|
*/
|
||||||
@SymbolName("Kotlin_ByteArray_set")
|
@SymbolName("Kotlin_ByteArray_set")
|
||||||
external public operator fun set(index: Int, value: Byte): Unit
|
external public operator fun set(index: Int, value: Byte): Unit
|
||||||
|
|
||||||
@@ -87,9 +97,19 @@ public final class CharArray {
|
|||||||
public val size: Int
|
public val size: Int
|
||||||
get() = getArrayLength()
|
get() = getArrayLength()
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the array element at the given [index]. This method can be called using the index operator.
|
||||||
|
*
|
||||||
|
* If the [index] is out of bounds of this array, throws an [IndexOutOfBoundsException].
|
||||||
|
*/
|
||||||
@SymbolName("Kotlin_CharArray_get")
|
@SymbolName("Kotlin_CharArray_get")
|
||||||
external public operator fun get(index: Int): Char
|
external public operator fun get(index: Int): Char
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the element at the given [index] to the given [value]. This method can be called using the index operator.
|
||||||
|
*
|
||||||
|
* If the [index] is out of bounds of this array, throws an [IndexOutOfBoundsException].
|
||||||
|
*/
|
||||||
@SymbolName("Kotlin_CharArray_set")
|
@SymbolName("Kotlin_CharArray_set")
|
||||||
external public operator fun set(index: Int, value: Char): Unit
|
external public operator fun set(index: Int, value: Char): Unit
|
||||||
|
|
||||||
@@ -139,9 +159,19 @@ public final class ShortArray {
|
|||||||
public val size: Int
|
public val size: Int
|
||||||
get() = getArrayLength()
|
get() = getArrayLength()
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the array element at the given [index]. This method can be called using the index operator.
|
||||||
|
*
|
||||||
|
* If the [index] is out of bounds of this array, throws an [IndexOutOfBoundsException].
|
||||||
|
*/
|
||||||
@SymbolName("Kotlin_ShortArray_get")
|
@SymbolName("Kotlin_ShortArray_get")
|
||||||
external public operator fun get(index: Int): Short
|
external public operator fun get(index: Int): Short
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the element at the given [index] to the given [value]. This method can be called using the index operator.
|
||||||
|
*
|
||||||
|
* If the [index] is out of bounds of this array, throws an [IndexOutOfBoundsException].
|
||||||
|
*/
|
||||||
@SymbolName("Kotlin_ShortArray_set")
|
@SymbolName("Kotlin_ShortArray_set")
|
||||||
external public operator fun set(index: Int, value: Short): Unit
|
external public operator fun set(index: Int, value: Short): Unit
|
||||||
|
|
||||||
@@ -191,9 +221,19 @@ public final class IntArray {
|
|||||||
public val size: Int
|
public val size: Int
|
||||||
get() = getArrayLength()
|
get() = getArrayLength()
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the array element at the given [index]. This method can be called using the index operator.
|
||||||
|
*
|
||||||
|
* If the [index] is out of bounds of this array, throws an [IndexOutOfBoundsException].
|
||||||
|
*/
|
||||||
@SymbolName("Kotlin_IntArray_get")
|
@SymbolName("Kotlin_IntArray_get")
|
||||||
external public operator fun get(index: Int): Int
|
external public operator fun get(index: Int): Int
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the element at the given [index] to the given [value]. This method can be called using the index operator.
|
||||||
|
*
|
||||||
|
* If the [index] is out of bounds of this array, throws an [IndexOutOfBoundsException].
|
||||||
|
*/
|
||||||
@SymbolName("Kotlin_IntArray_set")
|
@SymbolName("Kotlin_IntArray_set")
|
||||||
external public operator fun set(index: Int, value: Int): Unit
|
external public operator fun set(index: Int, value: Int): Unit
|
||||||
|
|
||||||
@@ -243,9 +283,19 @@ public final class LongArray {
|
|||||||
public val size: Int
|
public val size: Int
|
||||||
get() = getArrayLength()
|
get() = getArrayLength()
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the array element at the given [index]. This method can be called using the index operator.
|
||||||
|
*
|
||||||
|
* If the [index] is out of bounds of this array, throws an [IndexOutOfBoundsException].
|
||||||
|
*/
|
||||||
@SymbolName("Kotlin_LongArray_get")
|
@SymbolName("Kotlin_LongArray_get")
|
||||||
external public operator fun get(index: Int): Long
|
external public operator fun get(index: Int): Long
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the element at the given [index] to the given [value]. This method can be called using the index operator.
|
||||||
|
*
|
||||||
|
* If the [index] is out of bounds of this array, throws an [IndexOutOfBoundsException].
|
||||||
|
*/
|
||||||
@SymbolName("Kotlin_LongArray_set")
|
@SymbolName("Kotlin_LongArray_set")
|
||||||
external public operator fun set(index: Int, value: Long): Unit
|
external public operator fun set(index: Int, value: Long): Unit
|
||||||
|
|
||||||
@@ -295,9 +345,19 @@ public final class FloatArray {
|
|||||||
public val size: Int
|
public val size: Int
|
||||||
get() = getArrayLength()
|
get() = getArrayLength()
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the array element at the given [index]. This method can be called using the index operator.
|
||||||
|
*
|
||||||
|
* If the [index] is out of bounds of this array, throws an [IndexOutOfBoundsException].
|
||||||
|
*/
|
||||||
@SymbolName("Kotlin_FloatArray_get")
|
@SymbolName("Kotlin_FloatArray_get")
|
||||||
external public operator fun get(index: Int): Float
|
external public operator fun get(index: Int): Float
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the element at the given [index] to the given [value]. This method can be called using the index operator.
|
||||||
|
*
|
||||||
|
* If the [index] is out of bounds of this array, throws an [IndexOutOfBoundsException].
|
||||||
|
*/
|
||||||
@SymbolName("Kotlin_FloatArray_set")
|
@SymbolName("Kotlin_FloatArray_set")
|
||||||
external public operator fun set(index: Int, value: Float): Unit
|
external public operator fun set(index: Int, value: Float): Unit
|
||||||
|
|
||||||
@@ -343,9 +403,19 @@ public final class DoubleArray {
|
|||||||
public val size: Int
|
public val size: Int
|
||||||
get() = getArrayLength()
|
get() = getArrayLength()
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the array element at the given [index]. This method can be called using the index operator.
|
||||||
|
*
|
||||||
|
* If the [index] is out of bounds of this array, throws an [IndexOutOfBoundsException].
|
||||||
|
*/
|
||||||
@SymbolName("Kotlin_DoubleArray_get")
|
@SymbolName("Kotlin_DoubleArray_get")
|
||||||
external public operator fun get(index: Int): Double
|
external public operator fun get(index: Int): Double
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the element at the given [index] to the given [value]. This method can be called using the index operator.
|
||||||
|
*
|
||||||
|
* If the [index] is out of bounds of this array, throws an [IndexOutOfBoundsException].
|
||||||
|
*/
|
||||||
@SymbolName("Kotlin_DoubleArray_set")
|
@SymbolName("Kotlin_DoubleArray_set")
|
||||||
external public operator fun set(index: Int, value: Double): Unit
|
external public operator fun set(index: Int, value: Double): Unit
|
||||||
|
|
||||||
@@ -391,9 +461,19 @@ public final class BooleanArray {
|
|||||||
public val size: Int
|
public val size: Int
|
||||||
get() = getArrayLength()
|
get() = getArrayLength()
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the array element at the given [index]. This method can be called using the index operator.
|
||||||
|
*
|
||||||
|
* If the [index] is out of bounds of this array, throws an [IndexOutOfBoundsException].
|
||||||
|
*/
|
||||||
@SymbolName("Kotlin_BooleanArray_get")
|
@SymbolName("Kotlin_BooleanArray_get")
|
||||||
external public operator fun get(index: Int): Boolean
|
external public operator fun get(index: Int): Boolean
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the element at the given [index] to the given [value]. This method can be called using the index operator.
|
||||||
|
*
|
||||||
|
* If the [index] is out of bounds of this array, throws an [IndexOutOfBoundsException].
|
||||||
|
*/
|
||||||
@SymbolName("Kotlin_BooleanArray_set")
|
@SymbolName("Kotlin_BooleanArray_set")
|
||||||
external public operator fun set(index: Int, value: Boolean): Unit
|
external public operator fun set(index: Int, value: Boolean): Unit
|
||||||
|
|
||||||
|
|||||||
@@ -16,6 +16,8 @@ public interface CharSequence {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the character at the specified [index] in this character sequence.
|
* Returns the character at the specified [index] in this character sequence.
|
||||||
|
*
|
||||||
|
* @throws [IndexOutOfBoundsException] if the [index] is out of bounds of this character sequence.
|
||||||
*/
|
*/
|
||||||
public operator fun get(index: Int): Char
|
public operator fun get(index: Int): Char
|
||||||
|
|
||||||
|
|||||||
@@ -28,6 +28,11 @@ public final class String : Comparable<String>, CharSequence {
|
|||||||
public override val length: Int
|
public override val length: Int
|
||||||
get() = getStringLength()
|
get() = getStringLength()
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the character of this string at the specified [index].
|
||||||
|
*
|
||||||
|
* If the [index] is out of bounds of this string, throws an [IndexOutOfBoundsException].
|
||||||
|
*/
|
||||||
@SymbolName("Kotlin_String_get")
|
@SymbolName("Kotlin_String_get")
|
||||||
external override public fun get(index: Int): Char
|
external override public fun get(index: Int): Char
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user