Collection
interface in package klyn.collections

    public interface Collection<T = Double>:

Collection

A collection of elements. @param <T> The type of elements in the collection.

    myCollection = []    # Here an instance of ArrayList<double>
    myCollection.add(1)
    myCollection.add(2)
    print(myCollection.size)  # Output: 2
    myCollection.remove(1)
    print(myCollection.size)  # Output: 1

Methods

Modifier and Type | Member | Description
--- | --- | ---
public | add `add(item as T) as Void` | Adds an element to the collection.
public | count `count(item as T) as ULong` | Counts occurrences of the specified element in the collection.
public | remove `remove(item as T) as Boolean` | Removes the first occurrence of the specified element from the collection.
public | toString `toString() as String` | Returns a string representation of the collection.

Operators

Modifier and Type | Member | Description
--- | --- | ---
public | operator in(item as T) as Boolean | Determines whether the collection contains the specified element.