PersistentList
A generic persistent ordered collection of elements that supports adding and removing elements.
Modification operations return new instances of the persistent list with the modification applied.
Type Parameters
the type of elements contained in the list. The persistent list is covariant on its element type.
Inheritors
Types
A generic builder of the persistent list. Builder exposes its modification operations through the MutableList interface.
Functions
Returns a new persistent list with elements of the specified elements collection appended, or this instance if the specified collection is empty.
Returns a new builder with the same contents as this collection.
Returns an empty persistent list.
Returns a new persistent list with the first appearance of the specified element removed, or this instance if there is no such element in this list.
Returns a new persistent list containing all elements of this list except the elements contained in the specified elements array, or this instance if there are no elements to remove.
Returns a new persistent list containing all elements of this list except the elements contained in the specified elements collection, or this instance if there are no elements to remove.
Returns a new persistent list containing all elements of this list except the elements contained in the specified elements sequence, or this instance if there are no elements to remove.
Returns a new persistent list with the provided modifications applied, or this instance if no modifications were made in the result of this operation.
Returns a new persistent list with the specified element appended.
Returns a new persistent list with elements of the specified elements array appended, or this instance if the specified array is empty.
Returns a new persistent list with elements of the specified elements collection appended, or this instance if the specified collection is empty.
Returns a new persistent list with elements of the specified elements sequence appended, or this instance if the specified sequence is empty.
Returns a new persistent list with elements matching the specified predicate removed, or this instance if no elements match the predicate.
Returns a new persistent list containing all elements of this list except the elements contained in the specified elements collection, or this instance if there are no elements to remove.
Returns a new persistent list with the element at the specified index removed.
Returns a new persistent list with elements in this list that are also contained in the specified elements collection, or this instance if no modifications were made in the result of this operation.