The type of element in the list.
Count the amount of elements in the collection.
⚠️ In most cases, this should be an O(1)
operation. However, there are
cases where this can be an O(n)
operation. Therefore, it is recommended
to always cache the result in a local variable.
Returns an object which is able to sift through the values in this collection.
The order by which the elements are traversed depends on the kind of collection. For unordered collections, the iteration order is unspecified and may even differ between two iterations on the same collection.
Add an element to the collection. If the element already exists, update its value.
The location where the element is placed depends on the collection type, and in the generic case there is no guarantee on the location where it is inserted.
This method returns a pair with the first element indicating whether the element was added, while the second element refers to the actual location of the element.
A transparent object obtained by getAddHint.
Append an item at the end of the collection. The element will be given the highest order.
Return a cursor that is placed at the index given by position
in the
sequence.
Remove all elements from this collection, effectively setting the collection to the empty collection.
Copies all elements in the collection to a new one of the same kind.
Remove an element from the collection. If multiple elements are matched, the collection picks one of them.
true
if the element was found, false
otherwise.
Remove an element from the collection. If multiple elements are matched, the collection removes all of them.
The amount of elements that was removed.
Remove the element pointed to by the iterator result from this collection.
Get the first element in the sequence.
Returns a transparent object that can be used as an argument to add to speed up things. Generally, you don't have to use this method.
Allows taking an element directly out of the collection at a given position.
This method might be faster than at because it is not forced to construct a cursor object.
Checks if the collection holds the given element.
The element to check membership of.
True if the collections holds the given element, false otherwise.
Get the last element in the collection.
Prepend an item to the beginning of the collection. The element will be given the lowest order.
Get the rest of the list. This operation usually is in O(1)
.
Converts the entire collection to a range.
Generated using TypeDoc
A list is a positional collection which can contain multiple elements of the same kind.
A list is characterized by low-cost insertion of elements, while referencing an element at a given position is generally slower.
Result: