class MutableArray
source · line 73public
public class MutableArray<T> : List<T>, IndexSet<Long, T>
- Supertype
List<T> - Supertype
IndexSet<Long, T>
A fixed-size array with replaceable element slots and zero-based Long indexing. Use ArrayList when the number of elements must change.
Extensions
@Unsafe public fun <T : value, R> MutableArray<T>.withDataPointer(block: (Ptr<T>, Long) -> R): R· scoop:scoop.core:0.1.0
type parameter T
source · line 73public
T
function get
source · line 89public
public override operator fun get(index: Long): T
Reads the element at a zero-based index; out-of-range indices throw IndexOutOfBoundsException.
parameter index
source · line 89public
index: Long
property size
source · line 80public
public override val size: Long
- Overrides
size
get: public read-only
The current number of element slots visible through the list interface.
getter get
source · line 80public
get(): Long
function toArray
source · line 102public
@Intrinsic("array_to_immutable")
public fun toArray(): Array<T>
Copies the elements into independent immutable array slots.
function set
source · line 97public
public override operator fun set(index: Long, value: T): Unit
- Overrides
set· IndexSet
Replaces an existing element; out-of-range indices throw IndexOutOfBoundsException.
parameter value
source · line 97public
value: T
parameter index
source · line 97public
index: Long
function iterator
source · line 108public
public override operator fun iterator(): Iterator<T>
- Overrides
iterator· Iterable
Traverses the elements in index order and remains exhausted after reaching the end.