A possibly-empty, immutable sequence of values. The type
Sequential<Element>
may be abbreviated [Element*]
or
Element[]
.
Sequential
has two enumerated subtypes:
Tuple
no type hierarchy
Attributes | |
keys | Source Codeshared actual default Integer[] keys A sequence containing all indexes of this sequence. |
rest | Source Codeshared formal Element[] rest The rest of the sequence, without the first element. |
reversed | Source Codeshared formal Element[] reversed A list containing the elements of this list in reverse
order to the order in which they occur in this list.
For every list.reversed[index]==list[size-1-index] This is a lazy operation returning a view of this list. Refines List.reversed |
string | Source Codeshared actual default String string A string of form |
Inherited Attributes |
Attributes inherited from: Object |
Attributes inherited from: Collection<Element> |
Attributes inherited from: Correspondence<Key,Item> |
Attributes inherited from: Iterable<Element,Absent> |
Attributes inherited from: List<Element> |
Methods | |
append | Source Codeshared formal <Element|Other>[] append<Other>(Other[] elements) Return a sequence containing the elements of this
sequence, in the order in which they occur in this
sequence, followed by the given See also prepend() , withTrailing() , concatenate() , Iterable.chain() |
clone | Source Codeshared actual default Element[] clone() This sequence. |
initial | Source Codeshared actual default Element[] initial(Integer length) Select the first elements of this sequence, returning a sequence no longer than the given length. If this sequence is shorter than the given length, return this sequence. Otherwise return a sequence of the given length. Refines List.initial |
prepend | Source Codeshared formal <Element|Other>[] prepend<Other>(Other[] elements) Return a sequence containing the given See also append() , withLeading() , concatenate() |
repeat | Source Codeshared formal Element[] repeat(Integer times) Produces a stream formed by repeating the elements of
this stream the given number of times, or an
empty stream if For example, the expression { 1, 2 }.repeat(3) evaluates to the stream |
sequence | Source Codeshared actual default Element[] sequence() This sequence. Refines Iterable.sequence |
slice | Source Codeshared actual default [Element[], Element[]] slice(Integer index) Return two sequences, the first containing the elements
that occur before the given Refines List.slice |
terminal | Source Codeshared actual default Element[] terminal(Integer length) Select the last elements of the sequence, returning a sequence no longer than the given length. If this sequence is shorter than the given length, return this sequence. Otherwise return a sequence of the given length. Refines List.terminal |
trim | Source Codeshared actual default Element[] trim(Boolean trimming(Element&Object elem)) Trim the elements satisfying the given predicate function from the start and end of this sequence, returning a sequence no longer than this sequence. Refines List.trim |
trimLeading | Source Codeshared actual default Element[] trimLeading(Boolean trimming(Element&Object elem)) Trim the elements satisfying the given predicate function from the start of this sequence, returning a sequence no longer than this sequence. Refines List.trimLeading |
trimTrailing | Source Codeshared actual default Element[] trimTrailing(Boolean trimming(Element&Object elem)) Trim the elements satisfying the given predicate function from the end of this sequence, returning a sequence no longer than this sequence. Refines List.trimTrailing |
withLeading | Source Codeshared formal [Other, Element*] withLeading<Other>(Other element) Returns a new sequence that starts with the specified
Parameters:
See also prepend() , withTrailing() , Iterable.follow() |
withTrailing | Source Codeshared formal [<Element|Other>+] withTrailing<Other>(Other element) Returns a new sequence that starts with the elements of
this sequence, in the order they occur in this sequence,
and ends with the specified Parameters:
See also append() , withLeading() |