public interface ObjectSet<K>
extends it.unimi.dsi.fastutil.objects.ObjectCollection<K>, java.util.Set<K>
Set; provides some additional methods that use polymorphism to avoid (un)boxing.
Additionally, this interface strengthens (again) iterator().
Set| Modifier and Type | Method and Description |
|---|---|
it.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... a)
Returns an immutable list with the elements given.
|
static <K> ObjectSet<K> |
of(K e)
Returns an immutable set with the element 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> |
spliterator()
Returns a type-specific spliterator on the elements of this set.
|
it.unimi.dsi.fastutil.objects.ObjectIterator<K> iterator()
iterator in interface java.util.Collection<K>iterator in interface java.lang.Iterable<K>iterator in interface it.unimi.dsi.fastutil.objects.ObjectCollection<K>iterator in interface it.unimi.dsi.fastutil.objects.ObjectIterable<K>iterator in interface java.util.Set<K>default it.unimi.dsi.fastutil.objects.ObjectSpliterator<K> spliterator()
Set spliterators must report at least Spliterator.DISTINCT.
See Set.spliterator() for more documentation on the requirements
of the returned spliterator.
spliterator in interface java.util.Collection<K>spliterator in interface java.lang.Iterable<K>spliterator in interface it.unimi.dsi.fastutil.objects.ObjectCollection<K>spliterator in interface it.unimi.dsi.fastutil.objects.ObjectIterable<K>spliterator in interface java.util.Set<K>static <K> ObjectSet<K> of()
static <K> ObjectSet<K> of(K e)
e - an element.e.static <K> ObjectSet<K> of(K e0, K e1)
e0 - the first element.e1 - the second element.e0 and e1.java.lang.IllegalArgumentException - if there were duplicate entries.static <K> ObjectSet<K> of(K e0, K e1, K e2)
e0 - the first element.e1 - the second element.e2 - the third element.e0, e1, and e2.java.lang.IllegalArgumentException - if there were duplicate entries.@SafeVarargs static <K> ObjectSet<K> of(K... a)
a - the list of elements that will be in the final set.a.java.lang.IllegalArgumentException - if there are any duplicate entries.