Package it.unimi.dsi.fastutil.objects
Interface ObjectSet<K>
- All Superinterfaces:
Collection<K>,Iterable<K>,it.unimi.dsi.fastutil.objects.ObjectCollection<K>,it.unimi.dsi.fastutil.objects.ObjectIterable<K>,Set<K>
- All Known Subinterfaces:
ObjectSortedSet<K>
- All Known Implementing Classes:
AbstractObjectSet,AbstractObjectSortedSet,ObjectArraySet,ObjectAVLTreeSet,ObjectLinkedOpenCustomHashSet,ObjectLinkedOpenHashSet,ObjectOpenCustomHashSet,ObjectOpenHashBigSet,ObjectOpenHashSet,ObjectRBTreeSet,ObjectSets.EmptySet,ObjectSets.Singleton,ObjectSets.SynchronizedSet,ObjectSets.UnmodifiableSet,ObjectSortedSets.EmptySet,ObjectSortedSets.Singleton,ObjectSortedSets.SynchronizedSortedSet,ObjectSortedSets.UnmodifiableSortedSet
A type-specific
Set; provides some additional methods that use polymorphism to avoid (un)boxing.
Additionally, this interface strengthens (again) iterator().
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionit.unimi.dsi.fastutil.objects.ObjectIterator<K> iterator()Returns a type-specific iterator on the elements of this set.static <K> ObjectSet<K> of()Returns an immutable empty set.static <K> ObjectSet<K> of(K e) Returns an immutable set with the element given.static <K> ObjectSet<K> of(K... a) Returns an immutable list with the elements given.static <K> ObjectSet<K> of(K e0, K e1) Returns an immutable set with the elements given.static <K> ObjectSet<K> of(K e0, K e1, K e2) Returns an immutable set with the elements given.default it.unimi.dsi.fastutil.objects.ObjectSpliterator<K> Returns a type-specific spliterator on the elements of this set.Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArray
-
Method Details
-
iterator
it.unimi.dsi.fastutil.objects.ObjectIterator<K> iterator()Returns a type-specific iterator on the elements of this set.- Specified by:
iteratorin interfaceCollection<K>- Specified by:
iteratorin interfaceIterable<K>- Specified by:
iteratorin interfaceit.unimi.dsi.fastutil.objects.ObjectCollection<K>- Specified by:
iteratorin interfaceit.unimi.dsi.fastutil.objects.ObjectIterable<K>- Specified by:
iteratorin interfaceSet<K>- Returns:
- a type-specific iterator on the elements of this set.
-
spliterator
Returns a type-specific spliterator on the elements of this set.Set spliterators must report at least
Spliterator.DISTINCT.See
Set.spliterator()for more documentation on the requirements of the returned spliterator.- Specified by:
spliteratorin interfaceCollection<K>- Specified by:
spliteratorin interfaceIterable<K>- Specified by:
spliteratorin interfaceit.unimi.dsi.fastutil.objects.ObjectCollection<K>- Specified by:
spliteratorin interfaceit.unimi.dsi.fastutil.objects.ObjectIterable<K>- Specified by:
spliteratorin interfaceSet<K>- Returns:
- Since:
- 8.5.0
-
of
Returns an immutable empty set.- Returns:
- an immutable empty set.
-
of
Returns an immutable set with the element given.- Parameters:
e- an element.- Returns:
- an immutable set containing
e.
-
of
Returns an immutable set with the elements given.- Parameters:
e0- the first element.e1- the second element.- Returns:
- an immutable set containing
e0ande1. - Throws:
IllegalArgumentException- if there were duplicate entries.
-
of
Returns an immutable set with the elements given.- Parameters:
e0- the first element.e1- the second element.e2- the third element.- Returns:
- an immutable set containing
e0,e1, ande2. - Throws:
IllegalArgumentException- if there were duplicate entries.
-
of
Returns an immutable list with the elements given.- Parameters:
a- the list of elements that will be in the final set.- Returns:
- an immutable set containing the elements in
a. - Throws:
IllegalArgumentException- if there are any duplicate entries.
-