Methods

concat (other:Collection<T>):Sequence<T>

reverse ():Void

Reverses the positions of the items in the sequence.

slice (index:Int, ?endIndex:Int):Sequence<T>

sort (?comparer:T ‑> T ‑> Int):Void

Sorts the items.

If the items implement Comparable, it will use that for ordering.

Parameters:

comparer

Optional comparison function. If not given, Reflect.compare is used instead.

Inherited Variables

Defined by Collection

read onlylength:Int

Number of items in the collection.

Inherited Methods

Defined by Sequence

contentEquals (other:BaseSequence<T>):Bool

Returns whether the given contains the same items in order.

This method accepts items implementing Equatable.

Parameters:

other

Another ordered sequence.

first ():T

Returns the first item in the sequence.

If the sequence is empty, OutOfBoundsException is thrown.

firstOption ():Option<T>

Returns the first item in the sequence.

indexOf (item:T, ?fromIndex:Int):Option<Int>

Returns the position of first occurrence of the given item.

This method accepts items implementing Equatable.

Parameters:

item

Item to be searched.

fromIndex

If given, the search begins at the given index. Otherwise, the search starts at index 0.

isEmpty ():Bool

Returns whether the sequence is empty.

last ():T

Returns the length - 1-th item in the sequence.

If the sequence is empty, OutOfBoundsException is thrown.

lastIndexOf (item:T, ?fromIndex:Int):Option<Int>

Returns the position of last occurrence of the given item.

This method accepts items implementing Equatable.

Parameters:

item

Item to be searched.

fromIndex

If given, the search begins at the given index. Otherwise, the search starts at index length - 1.

lastOption ():Option<T>

Returns the length - 1-th item in the sequence.

Defined by BaseSequence

get (index:Int):T

Returns the item at the given position.

The sequence is addressed by indexes from 0 to length - 1 inclusive. If a negative index is provided, it is computed to be an offset from the end of the sequence (length - index). If the computed index is not valid, OutOfBoundsException is thrown.

Parameters:

index

Position of item.

Defined by Collection

contains (item:T):Bool

Returns whether the given item is in the collection.

get_length ():Int

Defined by IIterable