Package it.unimi.dsi.fastutil.objects
Interface ObjectSet<K>
- All Superinterfaces:
Collection<K>
,Iterable<K>
,ObjectCollection<K>
,ObjectIterable<K>
,Set<K>
- All Known Subinterfaces:
Byte2BooleanMap.FastEntrySet
,Byte2BooleanSortedMap.FastSortedEntrySet
,Byte2ByteMap.FastEntrySet
,Byte2ByteSortedMap.FastSortedEntrySet
,Byte2CharMap.FastEntrySet
,Byte2CharSortedMap.FastSortedEntrySet
,Byte2DoubleMap.FastEntrySet
,Byte2DoubleSortedMap.FastSortedEntrySet
,Byte2FloatMap.FastEntrySet
,Byte2FloatSortedMap.FastSortedEntrySet
,Byte2IntMap.FastEntrySet
,Byte2IntSortedMap.FastSortedEntrySet
,Byte2LongMap.FastEntrySet
,Byte2LongSortedMap.FastSortedEntrySet
,Byte2ObjectMap.FastEntrySet<V>
,Byte2ObjectSortedMap.FastSortedEntrySet<V>
,Byte2ReferenceMap.FastEntrySet<V>
,Byte2ReferenceSortedMap.FastSortedEntrySet<V>
,Byte2ShortMap.FastEntrySet
,Byte2ShortSortedMap.FastSortedEntrySet
,Char2BooleanMap.FastEntrySet
,Char2BooleanSortedMap.FastSortedEntrySet
,Char2ByteMap.FastEntrySet
,Char2ByteSortedMap.FastSortedEntrySet
,Char2CharMap.FastEntrySet
,Char2CharSortedMap.FastSortedEntrySet
,Char2DoubleMap.FastEntrySet
,Char2DoubleSortedMap.FastSortedEntrySet
,Char2FloatMap.FastEntrySet
,Char2FloatSortedMap.FastSortedEntrySet
,Char2IntMap.FastEntrySet
,Char2IntSortedMap.FastSortedEntrySet
,Char2LongMap.FastEntrySet
,Char2LongSortedMap.FastSortedEntrySet
,Char2ObjectMap.FastEntrySet<V>
,Char2ObjectSortedMap.FastSortedEntrySet<V>
,Char2ReferenceMap.FastEntrySet<V>
,Char2ReferenceSortedMap.FastSortedEntrySet<V>
,Char2ShortMap.FastEntrySet
,Char2ShortSortedMap.FastSortedEntrySet
,Double2BooleanMap.FastEntrySet
,Double2BooleanSortedMap.FastSortedEntrySet
,Double2ByteMap.FastEntrySet
,Double2ByteSortedMap.FastSortedEntrySet
,Double2CharMap.FastEntrySet
,Double2CharSortedMap.FastSortedEntrySet
,Double2DoubleMap.FastEntrySet
,Double2DoubleSortedMap.FastSortedEntrySet
,Double2FloatMap.FastEntrySet
,Double2FloatSortedMap.FastSortedEntrySet
,Double2IntMap.FastEntrySet
,Double2IntSortedMap.FastSortedEntrySet
,Double2LongMap.FastEntrySet
,Double2LongSortedMap.FastSortedEntrySet
,Double2ObjectMap.FastEntrySet<V>
,Double2ObjectSortedMap.FastSortedEntrySet<V>
,Double2ReferenceMap.FastEntrySet<V>
,Double2ReferenceSortedMap.FastSortedEntrySet<V>
,Double2ShortMap.FastEntrySet
,Double2ShortSortedMap.FastSortedEntrySet
,Float2BooleanMap.FastEntrySet
,Float2BooleanSortedMap.FastSortedEntrySet
,Float2ByteMap.FastEntrySet
,Float2ByteSortedMap.FastSortedEntrySet
,Float2CharMap.FastEntrySet
,Float2CharSortedMap.FastSortedEntrySet
,Float2DoubleMap.FastEntrySet
,Float2DoubleSortedMap.FastSortedEntrySet
,Float2FloatMap.FastEntrySet
,Float2FloatSortedMap.FastSortedEntrySet
,Float2IntMap.FastEntrySet
,Float2IntSortedMap.FastSortedEntrySet
,Float2LongMap.FastEntrySet
,Float2LongSortedMap.FastSortedEntrySet
,Float2ObjectMap.FastEntrySet<V>
,Float2ObjectSortedMap.FastSortedEntrySet<V>
,Float2ReferenceMap.FastEntrySet<V>
,Float2ReferenceSortedMap.FastSortedEntrySet<V>
,Float2ShortMap.FastEntrySet
,Float2ShortSortedMap.FastSortedEntrySet
,Int2BooleanMap.FastEntrySet
,Int2BooleanSortedMap.FastSortedEntrySet
,Int2ByteMap.FastEntrySet
,Int2ByteSortedMap.FastSortedEntrySet
,Int2CharMap.FastEntrySet
,Int2CharSortedMap.FastSortedEntrySet
,Int2DoubleMap.FastEntrySet
,Int2DoubleSortedMap.FastSortedEntrySet
,Int2FloatMap.FastEntrySet
,Int2FloatSortedMap.FastSortedEntrySet
,Int2IntMap.FastEntrySet
,Int2IntSortedMap.FastSortedEntrySet
,Int2LongMap.FastEntrySet
,Int2LongSortedMap.FastSortedEntrySet
,Int2ObjectMap.FastEntrySet<V>
,Int2ObjectSortedMap.FastSortedEntrySet<V>
,Int2ReferenceMap.FastEntrySet<V>
,Int2ReferenceSortedMap.FastSortedEntrySet<V>
,Int2ShortMap.FastEntrySet
,Int2ShortSortedMap.FastSortedEntrySet
,Long2BooleanMap.FastEntrySet
,Long2BooleanSortedMap.FastSortedEntrySet
,Long2ByteMap.FastEntrySet
,Long2ByteSortedMap.FastSortedEntrySet
,Long2CharMap.FastEntrySet
,Long2CharSortedMap.FastSortedEntrySet
,Long2DoubleMap.FastEntrySet
,Long2DoubleSortedMap.FastSortedEntrySet
,Long2FloatMap.FastEntrySet
,Long2FloatSortedMap.FastSortedEntrySet
,Long2IntMap.FastEntrySet
,Long2IntSortedMap.FastSortedEntrySet
,Long2LongMap.FastEntrySet
,Long2LongSortedMap.FastSortedEntrySet
,Long2ObjectMap.FastEntrySet<V>
,Long2ObjectSortedMap.FastSortedEntrySet<V>
,Long2ReferenceMap.FastEntrySet<V>
,Long2ReferenceSortedMap.FastSortedEntrySet<V>
,Long2ShortMap.FastEntrySet
,Long2ShortSortedMap.FastSortedEntrySet
,Object2BooleanMap.FastEntrySet<K>
,Object2BooleanSortedMap.FastSortedEntrySet<K>
,Object2ByteMap.FastEntrySet<K>
,Object2ByteSortedMap.FastSortedEntrySet<K>
,Object2CharMap.FastEntrySet<K>
,Object2CharSortedMap.FastSortedEntrySet<K>
,Object2DoubleMap.FastEntrySet<K>
,Object2DoubleSortedMap.FastSortedEntrySet<K>
,Object2FloatMap.FastEntrySet<K>
,Object2FloatSortedMap.FastSortedEntrySet<K>
,Object2IntMap.FastEntrySet<K>
,Object2IntSortedMap.FastSortedEntrySet<K>
,Object2LongMap.FastEntrySet<K>
,Object2LongSortedMap.FastSortedEntrySet<K>
,Object2ObjectMap.FastEntrySet<K,
,V> Object2ObjectSortedMap.FastSortedEntrySet<K,
,V> Object2ReferenceMap.FastEntrySet<K,
,V> Object2ReferenceSortedMap.FastSortedEntrySet<K,
,V> Object2ShortMap.FastEntrySet<K>
,Object2ShortSortedMap.FastSortedEntrySet<K>
,ObjectSortedSet<K>
,Reference2BooleanMap.FastEntrySet<K>
,Reference2BooleanSortedMap.FastSortedEntrySet<K>
,Reference2ByteMap.FastEntrySet<K>
,Reference2ByteSortedMap.FastSortedEntrySet<K>
,Reference2CharMap.FastEntrySet<K>
,Reference2CharSortedMap.FastSortedEntrySet<K>
,Reference2DoubleMap.FastEntrySet<K>
,Reference2DoubleSortedMap.FastSortedEntrySet<K>
,Reference2FloatMap.FastEntrySet<K>
,Reference2FloatSortedMap.FastSortedEntrySet<K>
,Reference2IntMap.FastEntrySet<K>
,Reference2IntSortedMap.FastSortedEntrySet<K>
,Reference2LongMap.FastEntrySet<K>
,Reference2LongSortedMap.FastSortedEntrySet<K>
,Reference2ObjectMap.FastEntrySet<K,
,V> Reference2ObjectSortedMap.FastSortedEntrySet<K,
,V> Reference2ReferenceMap.FastEntrySet<K,
,V> Reference2ReferenceSortedMap.FastSortedEntrySet<K,
,V> Reference2ShortMap.FastEntrySet<K>
,Reference2ShortSortedMap.FastSortedEntrySet<K>
,Short2BooleanMap.FastEntrySet
,Short2BooleanSortedMap.FastSortedEntrySet
,Short2ByteMap.FastEntrySet
,Short2ByteSortedMap.FastSortedEntrySet
,Short2CharMap.FastEntrySet
,Short2CharSortedMap.FastSortedEntrySet
,Short2DoubleMap.FastEntrySet
,Short2DoubleSortedMap.FastSortedEntrySet
,Short2FloatMap.FastEntrySet
,Short2FloatSortedMap.FastSortedEntrySet
,Short2IntMap.FastEntrySet
,Short2IntSortedMap.FastSortedEntrySet
,Short2LongMap.FastEntrySet
,Short2LongSortedMap.FastSortedEntrySet
,Short2ObjectMap.FastEntrySet<V>
,Short2ObjectSortedMap.FastSortedEntrySet<V>
,Short2ReferenceMap.FastEntrySet<V>
,Short2ReferenceSortedMap.FastSortedEntrySet<V>
,Short2ShortMap.FastEntrySet
,Short2ShortSortedMap.FastSortedEntrySet
- All Known Implementing Classes:
AbstractByte2BooleanMap.BasicEntrySet
,AbstractByte2ByteMap.BasicEntrySet
,AbstractByte2CharMap.BasicEntrySet
,AbstractByte2DoubleMap.BasicEntrySet
,AbstractByte2FloatMap.BasicEntrySet
,AbstractByte2IntMap.BasicEntrySet
,AbstractByte2LongMap.BasicEntrySet
,AbstractByte2ObjectMap.BasicEntrySet
,AbstractByte2ReferenceMap.BasicEntrySet
,AbstractByte2ShortMap.BasicEntrySet
,AbstractChar2BooleanMap.BasicEntrySet
,AbstractChar2ByteMap.BasicEntrySet
,AbstractChar2CharMap.BasicEntrySet
,AbstractChar2DoubleMap.BasicEntrySet
,AbstractChar2FloatMap.BasicEntrySet
,AbstractChar2IntMap.BasicEntrySet
,AbstractChar2LongMap.BasicEntrySet
,AbstractChar2ObjectMap.BasicEntrySet
,AbstractChar2ReferenceMap.BasicEntrySet
,AbstractChar2ShortMap.BasicEntrySet
,AbstractDouble2BooleanMap.BasicEntrySet
,AbstractDouble2ByteMap.BasicEntrySet
,AbstractDouble2CharMap.BasicEntrySet
,AbstractDouble2DoubleMap.BasicEntrySet
,AbstractDouble2FloatMap.BasicEntrySet
,AbstractDouble2IntMap.BasicEntrySet
,AbstractDouble2LongMap.BasicEntrySet
,AbstractDouble2ObjectMap.BasicEntrySet
,AbstractDouble2ReferenceMap.BasicEntrySet
,AbstractDouble2ShortMap.BasicEntrySet
,AbstractFloat2BooleanMap.BasicEntrySet
,AbstractFloat2ByteMap.BasicEntrySet
,AbstractFloat2CharMap.BasicEntrySet
,AbstractFloat2DoubleMap.BasicEntrySet
,AbstractFloat2FloatMap.BasicEntrySet
,AbstractFloat2IntMap.BasicEntrySet
,AbstractFloat2LongMap.BasicEntrySet
,AbstractFloat2ObjectMap.BasicEntrySet
,AbstractFloat2ReferenceMap.BasicEntrySet
,AbstractFloat2ShortMap.BasicEntrySet
,AbstractInt2BooleanMap.BasicEntrySet
,AbstractInt2ByteMap.BasicEntrySet
,AbstractInt2CharMap.BasicEntrySet
,AbstractInt2DoubleMap.BasicEntrySet
,AbstractInt2FloatMap.BasicEntrySet
,AbstractInt2IntMap.BasicEntrySet
,AbstractInt2LongMap.BasicEntrySet
,AbstractInt2ObjectMap.BasicEntrySet
,AbstractInt2ReferenceMap.BasicEntrySet
,AbstractInt2ShortMap.BasicEntrySet
,AbstractLong2BooleanMap.BasicEntrySet
,AbstractLong2ByteMap.BasicEntrySet
,AbstractLong2CharMap.BasicEntrySet
,AbstractLong2DoubleMap.BasicEntrySet
,AbstractLong2FloatMap.BasicEntrySet
,AbstractLong2IntMap.BasicEntrySet
,AbstractLong2LongMap.BasicEntrySet
,AbstractLong2ObjectMap.BasicEntrySet
,AbstractLong2ReferenceMap.BasicEntrySet
,AbstractLong2ShortMap.BasicEntrySet
,AbstractObject2BooleanMap.BasicEntrySet
,AbstractObject2ByteMap.BasicEntrySet
,AbstractObject2CharMap.BasicEntrySet
,AbstractObject2DoubleMap.BasicEntrySet
,AbstractObject2FloatMap.BasicEntrySet
,AbstractObject2IntMap.BasicEntrySet
,AbstractObject2LongMap.BasicEntrySet
,AbstractObject2ObjectMap.BasicEntrySet
,AbstractObject2ReferenceMap.BasicEntrySet
,AbstractObject2ShortMap.BasicEntrySet
,AbstractObjectSet
,AbstractObjectSortedSet
,AbstractReference2BooleanMap.BasicEntrySet
,AbstractReference2ByteMap.BasicEntrySet
,AbstractReference2CharMap.BasicEntrySet
,AbstractReference2DoubleMap.BasicEntrySet
,AbstractReference2FloatMap.BasicEntrySet
,AbstractReference2IntMap.BasicEntrySet
,AbstractReference2LongMap.BasicEntrySet
,AbstractReference2ObjectMap.BasicEntrySet
,AbstractReference2ReferenceMap.BasicEntrySet
,AbstractReference2ShortMap.BasicEntrySet
,AbstractShort2BooleanMap.BasicEntrySet
,AbstractShort2ByteMap.BasicEntrySet
,AbstractShort2CharMap.BasicEntrySet
,AbstractShort2DoubleMap.BasicEntrySet
,AbstractShort2FloatMap.BasicEntrySet
,AbstractShort2IntMap.BasicEntrySet
,AbstractShort2LongMap.BasicEntrySet
,AbstractShort2ObjectMap.BasicEntrySet
,AbstractShort2ReferenceMap.BasicEntrySet
,AbstractShort2ShortMap.BasicEntrySet
,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 TypeMethodDescriptioniterator()
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 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
ObjectIterator<K> iterator()Returns a type-specific iterator on the elements of this set.- Specified by:
iterator
in interfaceCollection<K>
- Specified by:
iterator
in interfaceIterable<K>
- Specified by:
iterator
in interfaceObjectCollection<K>
- Specified by:
iterator
in interfaceObjectIterable<K>
- Specified by:
iterator
in interfaceSet<K>
- Returns:
- a type-specific iterator on the elements of this set.
- See Also:
- API Notes:
- This specification strengthens the one given in
Iterable.iterator()
, which was already strengthened in the corresponding type-specific class, but was weakened by the fact that this interface extendsSet
.Also, this is generally the only
iterator
method subclasses should override.
-
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:
spliterator
in interfaceCollection<K>
- Specified by:
spliterator
in interfaceIterable<K>
- Specified by:
spliterator
in interfaceObjectCollection<K>
- Specified by:
spliterator
in interfaceObjectIterable<K>
- Specified by:
spliterator
in interfaceSet<K>
- Returns:
- a type-specific spliterator on the elements of this collection.
- Since:
- 8.5.0
- API Notes:
- This specification strengthens the one given in
Collection.spliterator()
, which was already strengthened in the corresponding type-specific class, but was weakened by the fact that this interface extendsSet
.Also, this is generally the only
spliterator
method subclasses should override. - Implementation Specification:
- The default implementation returns a late-binding spliterator (see
Spliterator
for documentation on what binding policies mean) that wraps this instance's type specificiterator()
.Additionally, it reports
Spliterator.SIZED
andSpliterator.DISTINCT
. - Implementation Notes:
- As this default implementation wraps the iterator, and
Iterator
is an inherently linear API, the returned spliterator will yield limited performance gains when run in parallel contexts, as the returned spliterator'strySplit()
will have linear runtime.
-
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
e0
ande1
. - 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.
-