ArrayList
classin packageklyn.collections
public class ArrayList<T> extends Object implements List<T>:
└ ArrayList
All Implemented Interfaces: List
Resizable array list. Native operator mapping: - `operator[]` is mapped to the native `klyn_collections_ArrayList_operator_index`. @param <T> Element type.
Properties
Modifier and Type Member Description
public override readonly native property size
size as ULong
Number of elements in the list.
Properties inherited from Object: type
Methods
Modifier and Type Member Description
public native add
add(item as T) as Void
Adds an element at the end.
public native append
append(item as T) as Void
Python-style alias for add.
public native clear
clear() as Void
Removes all elements.
public native contains
contains(item as Object) as Boolean
Returns true if the list contains the given element.
public native count
count(item as Object) as ULong
Counts occurrences of the given element in the list.
public native join
join(separator as String) as String
Joins elements into a single string using the separator.
public native remove
remove(item as Object) as Boolean
Removes the first matching element.
public native sort
sort() as Void
Sorts the list in ascending order.
public native sortNew
sortNew() as List<T>
Returns a new sorted list without modifying the original.
public native toString
toString() as String
Returns a string representation of the list.
Methods inherited from Object: fromJson, toDict, toJson, toXml
Methods inherited from List: sort, sortNew
Methods inherited from Collection: add, contains, remove, toString
Operators
Modifier and Type Member Description
public operator in(item as Object) as Boolean: Returns true if the list contains the given element.
public native operator[](index as Int) as T Gets the element at the given index.