Type Hierarchy:
Satisfied Interfaces: Category, Cloneable<List<Element>>, Collection<Element>, Correspondence<Integer,Element>, Iterable<Element,Null>, List<Element>, Ranged<Integer,Array<Element>>

A fixed-size array of elements. An array may have zero size (an empty array). Arrays are mutable. Any element of an array may be set to a new value.

This class is provided primarily to support interoperation with Java, and for some performance-critical low-level programming tasks.

Initializer
Array({Element*} elements)
Attributes
restSource Code
shared actual Array<Element> rest

The rest of the array, without the first element.

Refined declaration: rest
reversedSource Code
shared actual Array<Element> reversed

Reverse this array, returning a new array.

Refined declaration: reversed
Inherited Attributes
Attributes inherited from: Object
Attributes inherited from: Cloneable<Clone>
Attributes inherited from: Collection<Element>
Attributes inherited from: Correspondence<Key,Item>
Attributes inherited from: Iterable<Element,Absent>
Attributes inherited from: List<Element>
Methods
copyToSource Code
shared void copyTo(Array<Element> other, Integer sourcePosition = 0, Integer destinationPosition = 0, Integer length = ...)

Efficiently copy the elements in the segment sourcePosition:length of this array to the segment destinationPosition:length of the given array.

Parameters:
  • other

    The array into which to copy the elements.

  • sourcePosition = 0

    The index of the first element in this array to copy.

  • destinationPosition = 0

    The index in the given array into which to copy the first element.

  • length = size-sourcePosition

    The number of elements to copy.

setSource Code
shared void set(Integer index, Element element)

Replace the existing element at the specified index with the given element. Does nothing if the specified index is negative or larger than the index of the last element in the array.

Parameters:
  • index

    The index of the element to replace.

  • element

    The new element.

Inherited Methods
Methods inherited from: Object
Methods inherited from: Category
Methods inherited from: Correspondence<Key,Item>
Methods inherited from: Iterable<Element,Absent>
Methods inherited from: List<Element>
Methods inherited from: Ranged<Index,Span>