PersistentSet
A generic persistent unordered collection of elements that does not support duplicate elements, and supports adding and removing elements.
Modification operations return new instances of the persistent set with the modification applied.
Type Parameters
the type of elements contained in the set. The persistent set is covariant on its element type.
Types
A generic builder of the persistent set. Builder exposes its modification operations through the MutableSet interface.
Functions
Returns a new persistent set with elements of the specified elements collection added, or this instance if it already contains every element of the specified collection.
Returns a new builder with the same contents as this collection.
Returns an empty persistent set.
Returns a new persistent set with elements in this set that are also contained in the specified elements collection, or this instance if no modifications were made in the result of this operation.
Returns a new persistent set with the specified element removed, or this instance if there is no such element in this set.
Returns a new persistent set containing all elements of this set except the elements contained in the specified elements array, or this instance if there are no elements to remove.
Returns a new persistent set containing all elements of this set except the elements contained in the specified elements collection, or this instance if there are no elements to remove.
Returns a new persistent set containing all elements of this set except the elements contained in the specified elements sequence, or this instance if there are no elements to remove.
Returns a new persistent set with the provided modifications applied, or this instance if no modifications were made in the result of this operation.
Returns a new persistent set with the specified element added, or this instance if it already contains the element.
Returns a new persistent set with elements of the specified elements array added, or this instance if it already contains every element of the specified array.
Returns a new persistent set with elements of the specified elements collection added, or this instance if it already contains every element of the specified collection.
Returns a new persistent set with elements of the specified elements sequence added, or this instance if it already contains every element of the specified sequence.
Returns a new persistent set with elements matching the specified predicate removed, or this instance if no elements match the predicate.
Returns a new persistent set containing all elements of this set except the elements contained in the specified elements collection, or this instance if there are no elements to remove.
Returns a new persistent set with elements in this set that are also contained in the specified elements collection, or this instance if no modifications were made in the result of this operation.