ImmutableList
class in package klyn.collections

    public class ImmutableList<T> extends Object implements IList<T>:

Object
└ ImmutableList
All Implemented Interfaces: IList

Immutable homogeneous ordered collection.

    values as IList<Int> = i:[10, 20, 30]
    print(values[1])   # 20

Properties

Modifier and Type | Member | Description
--- | --- | ---
public override readonly native property | size `size as ULong` | Number of elements in this list.

Inherited Properties
property Inherited Properties from Object: type
property Inherited Properties from IList: size
Constructors

Modifier and Type | Member | Description
--- | --- | ---
public native | ImmutableList `ImmutableList(values as IList<T> = [])` | Builds an immutable list by copying the provided read-only list.

Methods

Modifier and Type | Member | Description
--- | --- | ---
public override | count `count(item as T) as ULong:` | Counts occurrences of the given value.
public native | indexOf `indexOf(item as T, start as Int = 0) as Int` | Returns the first index of the given value.
public override | join `join(separator as String) as String:` | Joins list values with a separator.
public native | lastIndexOf `lastIndexOf(item as T, start as Int = -1) as Int` | Returns the last index of the given value.
public native | sortNew `sortNew() as ImmutableList<T>` | Returns a sorted immutable copy of this list.
public native override | toString `toString() as String` | Returns a normalized textual representation using the immutable literal syntax.

Inherited Methods
method Inherited Methods from Object: deepCopy, fromJson, toDict, toJson, toString, toXml
method Inherited Methods from IList: count, indexOf, join, lastIndexOf
Operators

Modifier and Type | Member | Description
--- | --- | ---
public override | operator in(item as T) as Boolean: | Returns true when the list contains the given value.
public override readonly native | operator[](index as Int) as T | Returns the value at the given index.

Inherited Operators
operator Inherited Operators from IList: operator in(item as T) as Boolean, operator[](index as Int) as T