# collection · Rell standard library · Chromia Docs (concept)

> hidden abstract type collection<T>: iterable <T> A generic type for mutable ordered collections of elements. Subtype of iterable<T> . Supports many
standar

Source: https://docs.chromia.com/pages/rell-stdlib/-rell-system-library/root/collection/

TYPE

# collection

```signature
hidden abstract type collection<T>: iterable<T>
```

A generic type for mutable ordered collections of elements. Subtype of `iterable<T>`. Supports many
standard operations such add insertion, removal, lookup and sorting.

Since 0.6.0

## Methods

[add](https://docs.chromia.com/pages/rell-stdlib/-rell-system-library/root/collection/add/)
:   Append an element to the end of this collection.

[addAll](https://docs.chromia.com/pages/rell-stdlib/-rell-system-library/root/collection/add-all/)
:   Add all elements from another collection to the end of this collection.

[add\_all](https://docs.chromia.com/pages/rell-stdlib/-rell-system-library/root/collection/add_all/)
:   Add all elements from another collection to the end of this collection.

[clear](https://docs.chromia.com/pages/rell-stdlib/-rell-system-library/root/collection/clear/)
:   Clear this collection; i.e. remove all its elements. Immediately after this method returns, this

[contains](https://docs.chromia.com/pages/rell-stdlib/-rell-system-library/root/collection/contains/)
:   Check if this collection contains the given element.

[containsAll](https://docs.chromia.com/pages/rell-stdlib/-rell-system-library/root/collection/contains-all/)
:   Check if this collection contains all elements of another collection.

[contains\_all](https://docs.chromia.com/pages/rell-stdlib/-rell-system-library/root/collection/contains_all/)
:   Check if this collection contains all elements of another collection.

[empty](https://docs.chromia.com/pages/rell-stdlib/-rell-system-library/root/collection/empty/)
:   Check if this collection is empty.

[join\_to\_text](https://docs.chromia.com/pages/rell-stdlib/-rell-system-library/root/collection/join_to_text/)
:   Generate a textual representation of this iterable.

[len](https://docs.chromia.com/pages/rell-stdlib/-rell-system-library/root/collection/len/)
:   Get the size (number of elements) of this collection.

[remove](https://docs.chromia.com/pages/rell-stdlib/-rell-system-library/root/collection/remove/)
:   Remove an element from this collection.

[removeAll](https://docs.chromia.com/pages/rell-stdlib/-rell-system-library/root/collection/remove-all/)
:   Remove all elements in another collection from this collection.

[remove\_all](https://docs.chromia.com/pages/rell-stdlib/-rell-system-library/root/collection/remove_all/)
:   Remove all elements in another collection from this collection.

[retain\_all](https://docs.chromia.com/pages/rell-stdlib/-rell-system-library/root/collection/retain_all/)
:   Retain in this collection only those elements found in the given collection. In other words, remove

[size](https://docs.chromia.com/pages/rell-stdlib/-rell-system-library/root/collection/size/)
:   Get the size (number of elements) of this collection.

[sorted](https://docs.chromia.com/pages/rell-stdlib/-rell-system-library/root/collection/sorted/)
:   Sorts the elements of this collection into a list. This collection is not modified.

[str](https://docs.chromia.com/pages/rell-stdlib/-rell-system-library/root/collection/str/)
:   Returns a textual representation of this collection.

[to\_text](https://docs.chromia.com/pages/rell-stdlib/-rell-system-library/root/collection/to_text/)
:   Returns a textual representation of this collection.

[View this page on docs.chromia.com](https://docs.chromia.com/pages/rell-stdlib/-rell%20-system%20-library/%5Broot%5D/collection/index.html)Generated API reference, mirrored from the live docs
