Type Hierarchy:
Satisfied Interfaces: Category, Cloneable<List<Element>>, Collection<Element>, Correspondence<Integer,Element>, Iterable<Element,Nothing>, List<Element>, Ranged<Integer,List<Element>>, Sequence<Element>, Sequential<Element>

An immutable Sequence implemented using the platform's native array type. Where possible copying of the underlying array is avoided. Direct use of this type is discouraged.

Initializer
ArraySequence({Element+} elements)
Attributes
cloneSource Code
shared actual ArraySequence<Element> clone

Obtain a clone of this object. For a mutable object, this should return a copy of the object. For an immutable object, it is acceptable to return the object itself.

Refined declaration: clone
firstSource Code
shared actual Element first

The first element returned by the iterator, if any, of null if the iterable object is empty.

Refined declaration: first
hashSource Code
shared actual Integer hash

The hash value of the value, which allows the value to be an element of a hash-based set or key of a hash-based map. Implementations must respect the constraint that if x==y then x.hash==y.hash.

Refined declaration: hash
lastSource Code
shared actual Element last

The last element returned by the iterator, if any, of null if the iterable object is empty. Iterable objects are potentially infinite, so calling this might never return; also, this implementation will iterate through all the elements, which might be very time-consuming.

Refined declaration: last
lastIndexSource Code
shared actual Integer lastIndex

The index of the last element of the list, or null if the list is empty.

Refined declaration: lastIndex
restSource Code

Returns an iterable object containing all but the first element of this container.

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

Reverse this list, returning a new list.

Refined declaration: reversed
sizeSource Code
shared actual Integer size

The number of elements returned by the iterator of this iterable object, if the iterator terminates. In the case of an iterable whose elements are not countable, this operation never terminates.

Refined declaration: size
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>
Attributes inherited from: [Element+]
Attributes inherited from: Element[]
Methods
containsSource Code
shared actual Boolean contains(Object element)

Determines if the given value belongs to this Category, that is, if it is an element of this Category.

For most Categorys, if x==y, then category.contains(x) evaluates to the same value as category.contains(y). However, it is possible to form a Category consistent with some other equivalence relation, for example ===. Therefore implementations of contains() which do not satisfy this relationship are tolerated.

Refined declaration: contains
countSource Code

Return the number of elements in this Iterable that satisfy the predicate function.

Refined declaration: count
definesSource Code
shared actual Boolean defines(Integer key)

Determines if there is a value defined for the given key.

Refined declaration: defines
equalsSource Code
shared actual Boolean equals(Object other)

Determine if two values are equal. Implementations should respect the constraints that:

  • if x===y then x==y (reflexivity),
  • if x==y then y==x (symmetry),
  • if x==y and y==z then x==z (transitivity).

Furthermore it is recommended that implementations ensure that if x==y then x and y have the same concrete class.

Refined declaration: equals
getSource Code

Returns the value defined for the given key, or null if there is no value defined for the given key.

Refined declaration: get
iteratorSource Code
shared actual Iterator<Element> iterator()

An iterator for the elements belonging to this container.

Refined declaration: iterator
segmentSource Code

Obtain a segment containing the mapped values starting from the given index, with the given length.

Refined declaration: segment
spanSource Code

Obtain a span containing the mapped values between the two given indices.

Refined declaration: span
spanFromSource Code

Obtain a span containing the mapped values between the starting index and the end of the receiver.

Refined declaration: spanFrom
spanToSource Code

Obtain a span containing the mapped values between the start of the receiver and the end index.

Refined declaration: spanTo
Inherited Methods
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>