Package it.unimi.dsi.fastutil.floats
Interface FloatSet
- All Superinterfaces:
java.util.Collection<java.lang.Float>,FloatCollection,FloatIterable,java.lang.Iterable<java.lang.Float>,java.util.Set<java.lang.Float>
- All Known Subinterfaces:
FloatSortedSet
- All Known Implementing Classes:
AbstractFloatSet,AbstractFloatSortedSet,FloatArraySet,FloatAVLTreeSet,FloatLinkedOpenCustomHashSet,FloatLinkedOpenHashSet,FloatOpenCustomHashSet,FloatOpenHashBigSet,FloatOpenHashSet,FloatRBTreeSet,FloatSets.EmptySet,FloatSets.Singleton,FloatSets.SynchronizedSet,FloatSets.UnmodifiableSet,FloatSortedSets.EmptySet,FloatSortedSets.Singleton,FloatSortedSets.SynchronizedSortedSet,FloatSortedSets.UnmodifiableSortedSet
public interface FloatSet extends FloatCollection, java.util.Set<java.lang.Float>
A type-specific
Set; provides some additional methods that use
polymorphism to avoid (un)boxing.
Additionally, this interface strengthens (again) iterator().
- See Also:
Set
-
Method Summary
Modifier and Type Method Description default booleanadd(java.lang.Float o)Deprecated.Please use the corresponding type-specific method instead.default booleancontains(java.lang.Object o)Deprecated.Please use the corresponding type-specific method instead.FloatIteratoriterator()Returns a type-specific iterator on the elements of this set.static FloatSetof()Returns an immutable empty set.static FloatSetof(float e)Returns an immutable set with the element given.static FloatSetof(float... a)Returns an immutable list with the elements given.static FloatSetof(float e0, float e1)Returns an immutable set with the elements given.static FloatSetof(float e0, float e1, float e2)Returns an immutable set with the elements given.default booleanrem(float k)Deprecated.Please useremove()instead.booleanremove(float k)Removes an element from this set.default booleanremove(java.lang.Object o)Deprecated.Please use the corresponding type-specific method instead.default FloatSpliteratorspliterator()Returns a type-specific spliterator on the elements of this set.Methods inherited from interface java.util.Collection
toArrayMethods inherited from interface it.unimi.dsi.fastutil.floats.FloatCollection
add, addAll, contains, containsAll, doubleIterator, doubleParallelStream, doubleSpliterator, doubleStream, parallelStream, removeAll, removeIf, removeIf, removeIf, retainAll, stream, toArray, toFloatArray, toFloatArrayMethods inherited from interface it.unimi.dsi.fastutil.floats.FloatIterable
forEach, forEach, forEachMethods inherited from interface java.util.Set
addAll, clear, containsAll, equals, hashCode, isEmpty, removeAll, retainAll, size, toArray, toArray
-
Method Details
-
iterator
FloatIterator iterator()Returns a type-specific iterator on the elements of this set.- Specified by:
iteratorin interfacejava.util.Collection<java.lang.Float>- Specified by:
iteratorin interfaceFloatCollection- Specified by:
iteratorin interfaceFloatIterable- Specified by:
iteratorin interfacejava.lang.Iterable<java.lang.Float>- Specified by:
iteratorin interfacejava.util.Set<java.lang.Float>- Returns:
- a type-specific iterator on the elements of this set.
- See Also:
Iterable.iterator()- 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
iteratormethod 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:
spliteratorin interfacejava.util.Collection<java.lang.Float>- Specified by:
spliteratorin interfaceFloatCollection- Specified by:
spliteratorin interfaceFloatIterable- Specified by:
spliteratorin interfacejava.lang.Iterable<java.lang.Float>- Specified by:
spliteratorin interfacejava.util.Set<java.lang.Float>- 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
spliteratormethod subclasses should override. - Implementation Specification:
- The default implementation returns a late-binding spliterator (see
Spliteratorfor documentation on what binding policies mean) that wraps this instance's type specificiterator().Additionally, it reports
Spliterator.SIZEDandSpliterator.DISTINCT. - Implementation Notes:
- As this default implementation wraps the iterator, and
Iteratoris 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.
-
remove
boolean remove(float k)Removes an element from this set.- See Also:
Collection.remove(Object)- API Notes:
- Note that the corresponding method of a type-specific collection is
rem(). This unfortunate situation is caused by the clash with the similarly named index-based method in theListinterface.
-
remove
@Deprecated default boolean remove(java.lang.Object o)Deprecated.Please use the corresponding type-specific method instead.- Specified by:
removein interfacejava.util.Collection<java.lang.Float>- Specified by:
removein interfaceFloatCollection- Specified by:
removein interfacejava.util.Set<java.lang.Float>
-
add
@Deprecated default boolean add(java.lang.Float o)Deprecated.Please use the corresponding type-specific method instead.- Specified by:
addin interfacejava.util.Collection<java.lang.Float>- Specified by:
addin interfaceFloatCollection- Specified by:
addin interfacejava.util.Set<java.lang.Float>
-
contains
@Deprecated default boolean contains(java.lang.Object o)Deprecated.Please use the corresponding type-specific method instead.- Specified by:
containsin interfacejava.util.Collection<java.lang.Float>- Specified by:
containsin interfaceFloatCollection- Specified by:
containsin interfacejava.util.Set<java.lang.Float>
-
rem
@Deprecated default boolean rem(float k)Deprecated.Please useremove()instead.Removes an element from this set.This method is inherited from the type-specific collection this type-specific set is based on, but it should not used as this interface reinstates
remove()as removal method.- Specified by:
remin interfaceFloatCollection- See Also:
Collection.remove(Object)
-
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:
java.lang.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:
java.lang.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:
java.lang.IllegalArgumentException- if there are any duplicate entries.
-