Package it.unimi.dsi.fastutil.floats
Class FloatSets.Singleton
java.lang.Object
java.util.AbstractCollection<Float>
it.unimi.dsi.fastutil.floats.AbstractFloatCollection
it.unimi.dsi.fastutil.floats.AbstractFloatSet
it.unimi.dsi.fastutil.floats.FloatSets.Singleton
- All Implemented Interfaces:
FloatCollection,FloatIterable,FloatSet,Serializable,Cloneable,Iterable<Float>,Collection<Float>,Set<Float>
- Direct Known Subclasses:
FloatSortedSets.Singleton
- Enclosing class:
FloatSets
An immutable class representing a type-specific singleton set.
This class may be useful to implement your own in case you subclass a type-specific set.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionbooleanAdds all elements of the given type-specific collection to this collection.booleanaddAll(Collection<? extends Float> c) clone()booleancontains(float k) Returnstrueif this collection contains the specified element.Returns a widened primitive iterator on the elements of this collection.Returns widened primitive spliterator on the elements of this collection.voidforEach(FloatConsumer action) Performs the given action for each element of this type-specificIterableuntil all elements have been processed or the action throws an exception.voidDeprecated.iterator()Returns a type-specific iterator on the elements of this collection.booleanremove(float k) Removes an element from this set.booleanRemove from this collection all elements in the given type-specific collection.booleanremoveAll(Collection<?> c) booleanremoveIf(FloatPredicate filter) Remove from this collection all elements which satisfy the given predicate.booleanDeprecated.booleanRetains in this collection only elements from the given type-specific collection.booleanretainAll(Collection<?> c) intsize()Returns a type-specific spliterator on the elements of this set.Object[]toArray()Deprecated.float[]Returns a primitive type array containing the items of this collection.Methods inherited from class it.unimi.dsi.fastutil.floats.AbstractFloatSet
equals, hashCode, remMethods inherited from class it.unimi.dsi.fastutil.floats.AbstractFloatCollection
add, add, contains, containsAll, containsAll, remove, toArray, toFloatArray, toStringMethods inherited from class java.util.AbstractCollection
clear, isEmpty, toArrayMethods inherited from interface java.util.Collection
toArrayMethods inherited from interface it.unimi.dsi.fastutil.floats.FloatCollection
add, containsAll, doubleParallelStream, doubleStream, parallelStream, removeIf, stream, toArray, toFloatArrayMethods inherited from interface it.unimi.dsi.fastutil.floats.FloatIterable
forEachMethods inherited from interface java.util.Set
clear, containsAll, isEmpty, toArray
-
Method Details
-
contains
public boolean contains(float k) Description copied from class:AbstractFloatCollectionReturnstrueif this collection contains the specified element.- Specified by:
containsin interfaceFloatCollection- Overrides:
containsin classAbstractFloatCollection- See Also:
-
remove
public boolean remove(float k) Description copied from class:AbstractFloatSetRemoves an element from this set. Delegates to the type-specificrem()method implemented by type-specific abstractCollectionsuperclass.- Specified by:
removein interfaceFloatSet- Overrides:
removein classAbstractFloatSet- See Also:
-
iterator
Description copied from interface:FloatCollectionReturns a type-specific iterator on the elements of this collection.- Specified by:
iteratorin interfaceCollection<Float>- Specified by:
iteratorin interfaceFloatCollection- Specified by:
iteratorin interfaceFloatIterable- Specified by:
iteratorin interfaceFloatSet- Specified by:
iteratorin interfaceIterable<Float>- Specified by:
iteratorin interfaceSet<Float>- Specified by:
iteratorin classAbstractFloatSet- Returns:
- a type-specific iterator on the elements of this collection.
- See Also:
-
spliterator
Description copied from interface:FloatSetReturns 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<Float>- Specified by:
spliteratorin interfaceFloatCollection- Specified by:
spliteratorin interfaceFloatIterable- Specified by:
spliteratorin interfaceFloatSet- Specified by:
spliteratorin interfaceIterable<Float>- Specified by:
spliteratorin interfaceSet<Float>- Returns:
- a type-specific spliterator on the elements of this collection.
-
size
public int size()- Specified by:
sizein interfaceCollection<Float>- Specified by:
sizein interfaceSet<Float>- Specified by:
sizein classAbstractCollection<Float>
-
toFloatArray
public float[] toFloatArray()Description copied from interface:FloatCollectionReturns a primitive type array containing the items of this collection.- Specified by:
toFloatArrayin interfaceFloatCollection- Overrides:
toFloatArrayin classAbstractFloatCollection- Returns:
- a primitive type array containing the items of this collection.
- See Also:
-
forEach
Deprecated.Description copied from interface:FloatIterable- Specified by:
forEachin interfaceFloatIterable- Specified by:
forEachin interfaceIterable<Float>
-
addAll
Description copied from class:AbstractFloatCollection- Specified by:
addAllin interfaceCollection<Float>- Specified by:
addAllin interfaceSet<Float>- Overrides:
addAllin classAbstractFloatCollection
-
removeAll
Description copied from class:AbstractFloatCollection- Specified by:
removeAllin interfaceCollection<Float>- Specified by:
removeAllin interfaceSet<Float>- Overrides:
removeAllin classAbstractFloatCollection
-
retainAll
Description copied from class:AbstractFloatCollection- Specified by:
retainAllin interfaceCollection<Float>- Specified by:
retainAllin interfaceSet<Float>- Overrides:
retainAllin classAbstractFloatCollection
-
removeIf
Deprecated.Description copied from interface:FloatCollection- Specified by:
removeIfin interfaceCollection<Float>- Specified by:
removeIfin interfaceFloatCollection
-
forEach
Description copied from interface:FloatIterablePerforms the given action for each element of this type-specificIterableuntil all elements have been processed or the action throws an exception.- Specified by:
forEachin interfaceFloatIterable- Parameters:
action- the action to be performed for each element.- See Also:
-
addAll
Description copied from interface:FloatCollectionAdds all elements of the given type-specific collection to this collection.- Specified by:
addAllin interfaceFloatCollection- Overrides:
addAllin classAbstractFloatCollection- Parameters:
c- a type-specific collection.- Returns:
trueif this collection changed as a result of the call.- See Also:
-
removeAll
Description copied from interface:FloatCollectionRemove from this collection all elements in the given type-specific collection.- Specified by:
removeAllin interfaceFloatCollection- Overrides:
removeAllin classAbstractFloatCollection- Parameters:
c- a type-specific collection.- Returns:
trueif this collection changed as a result of the call.- See Also:
-
retainAll
Description copied from interface:FloatCollectionRetains in this collection only elements from the given type-specific collection.- Specified by:
retainAllin interfaceFloatCollection- Overrides:
retainAllin classAbstractFloatCollection- Parameters:
c- a type-specific collection.- Returns:
trueif this collection changed as a result of the call.- See Also:
-
removeIf
Description copied from interface:FloatCollectionRemove from this collection all elements which satisfy the given predicate.- Specified by:
removeIfin interfaceFloatCollection- Parameters:
filter- a predicate which returnstruefor elements to be removed.- Returns:
trueif any elements were removed.- See Also:
-
doubleIterator
Description copied from interface:FloatCollectionReturns a widened primitive iterator on the elements of this collection.This method is provided for the purpose of APIs that expect only the JDK's primitive iterators, of which there are only
int,long, anddouble.- Specified by:
doubleIteratorin interfaceFloatCollection- Specified by:
doubleIteratorin interfaceFloatIterable- Returns:
- a widened primitive iterator on the elements of this collection.
-
doubleSpliterator
Description copied from interface:FloatCollectionReturns widened primitive spliterator on the elements of this collection.This method is provided for the purpose of APIs that expect only the JDK's primitive spliterators, of which there are only
int,long, anddouble.- Specified by:
doubleSpliteratorin interfaceFloatCollection- Specified by:
doubleSpliteratorin interfaceFloatIterable- Returns:
- a widened primitive spliterator on the elements of this collection.
-
toArray
Deprecated.- Specified by:
toArrayin interfaceCollection<Float>- Specified by:
toArrayin interfaceSet<Float>- Overrides:
toArrayin classAbstractCollection<Float>
-
clone
-