- Type Parameters:
E- the type of elements contained in the set. The set is covariant on its element type.
- All Superinterfaces:
ImmutableCollection<E>, Iterable<E>
- All Known Subinterfaces:
PersistentSet<E>
A generic immutable unordered collection of elements that does not support duplicate elements. Methods in this interface support only read-only access to the immutable set.
Modification operations are supported through the PersistentSet interface.
Implementors of this interface take responsibility to be immutable. Once constructed they must contain the same elements in the same order.
-
Method Summary
Static MethodsModifier and TypeMethodDescriptionstatic ImmutableSet<Character> from(CharSequence chars) Returns an immutable set of all characters.static <T extends @Nullable Object>
ImmutableSet<T> Returns an immutable set of all elements of the specified collection.static <T extends @Nullable Object>
ImmutableSet<T> Returns an immutable set of all elements of the specified sequence.static <T extends @Nullable Object>
ImmutableSet<T> from(T[] array) Returns an immutable set of all elements of the specified array.Methods inherited from interface ImmutableCollection
contains, containsAll, isEmpty, iterator, parallelStream, size, streamMethods inherited from interface Iterable
forEach, spliterator
-
Method Details
-
from
Returns an immutable set of all elements of the specified collection.
If the specified collection is already an immutable set, returns it as is.
Elements of the returned set are iterated in the same order as in the specified collection.
-
from
Returns an immutable set of all elements of the specified array.
Elements of the returned set are iterated in the same order as in the specified array.
-
from
Returns an immutable set of all elements of the specified sequence.
Elements of the returned set are iterated in the same order as in the specified sequence.
-
from
Returns an immutable set of all characters.
Elements of the returned set are iterated in the same order as in the specified char sequence.
-