ImmutableList
classin packageklyn.collections
public class ImmutableList<T> extends Object implements IList<T>:
└ ImmutableList
All Implemented Interfaces: IList

Immutable homogeneous ordered collection.

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

@param <T> Element type.

Properties
Modifier and Type Member Description
public override readonly native property size
size as ULong
Number of elements in this list.
Properties inherited from Object: type
Properties inherited 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 override join
join(separator as String) as String:
Joins list values with a separator.
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.
Methods inherited from Object: fromJson, toDict, toJson, toString, toXml
Methods inherited from IList: count, join
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.
Operators inherited from IList: operator in(item as T) as Boolean, operator[](index as Int) as T