Class FloatCollections.EmptyCollection
java.lang.Object
java.util.AbstractCollection<Float>
it.unimi.dsi.fastutil.floats.AbstractFloatCollection
it.unimi.dsi.fastutil.floats.FloatCollections.EmptyCollection
- All Implemented Interfaces:
FloatCollection,FloatIterable,Iterable<Float>,Collection<Float>
- Direct Known Subclasses:
FloatBigLists.EmptyBigList,FloatLists.EmptyList,FloatSets.EmptySet
- Enclosing class:
FloatCollections
An immutable class representing an empty type-specific collection.
This class may be useful to implement your own in case you subclass a type-specific collection.
-
Method Summary
Modifier and TypeMethodDescriptionbooleanAdds all elements of the given type-specific collection to this collection.booleanaddAll(Collection<? extends Float> c) voidclear()booleancontains(float k) Returnstrueif this collection contains the specified element.booleanChecks whether this collection contains all elements from the given type-specific collection.booleancontainsAll(Collection<?> c) Returns a widened primitive iterator on the elements of this collection.Returns widened primitive spliterator on the elements of this collection.booleanvoidforEach(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.inthashCode()iterator()Returns a type-specific iterator on the elements of this collection.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 collection.Object[]toArray()<T> T[]toArray(T[] array) float[]Returns a primitive type array containing the items of this collection.float[]toFloatArray(float[] a) Deprecated.Methods inherited from class it.unimi.dsi.fastutil.floats.AbstractFloatCollection
add, add, contains, rem, remove, toArray, toStringMethods inherited from class java.util.AbstractCollection
isEmptyMethods inherited from interface java.util.Collection
isEmpty, toArrayMethods inherited from interface it.unimi.dsi.fastutil.floats.FloatCollection
doubleParallelStream, doubleStream, parallelStream, removeIf, streamMethods inherited from interface it.unimi.dsi.fastutil.floats.FloatIterable
forEach
-
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:
-
toArray
- Specified by:
toArrayin interfaceCollection<Float>- Overrides:
toArrayin classAbstractCollection<Float>
-
toArray
public <T> T[] toArray(T[] array) - Specified by:
toArrayin interfaceCollection<Float>- Overrides:
toArrayin classAbstractCollection<Float>
-
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 interfaceIterable<Float>- Specified by:
iteratorin classAbstractFloatCollection- Returns:
- a type-specific iterator on the elements of this collection.
- See Also:
-
spliterator
Description copied from interface:FloatCollectionReturns a type-specific spliterator on the elements of this collection.See
Collection.spliterator()for more documentation on the requirements of the returned spliterator.- Returns:
- a type-specific spliterator on the elements of this collection.
-
size
public int size()- Specified by:
sizein interfaceCollection<Float>- Specified by:
sizein classAbstractCollection<Float>
-
clear
public void clear()- Specified by:
clearin interfaceCollection<Float>- Overrides:
clearin classAbstractCollection<Float>
-
hashCode
public int hashCode()- Specified by:
hashCodein interfaceCollection<Float>- Overrides:
hashCodein classObject
-
equals
-
forEach
Deprecated.Description copied from interface:FloatIterable -
containsAll
Description copied from class:AbstractFloatCollection- Specified by:
containsAllin interfaceCollection<Float>- Overrides:
containsAllin classAbstractFloatCollection
-
addAll
Description copied from class:AbstractFloatCollection- Specified by:
addAllin interfaceCollection<Float>- Overrides:
addAllin classAbstractFloatCollection
-
removeAll
Description copied from class:AbstractFloatCollection- Specified by:
removeAllin interfaceCollection<Float>- Overrides:
removeAllin classAbstractFloatCollection
-
retainAll
Description copied from class:AbstractFloatCollection- Specified by:
retainAllin interfaceCollection<Float>- Overrides:
retainAllin classAbstractFloatCollection
-
removeIf
Deprecated.Description copied from interface:FloatCollection -
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:
-
toFloatArray
Deprecated.Description copied from class:AbstractFloatCollectionReturns a primitive type array containing the items of this collection.Note that, contrarily to
Collection.toArray(Object[]), this methods just writes all elements of this collection: no special value will be added after the last one.- Specified by:
toFloatArrayin interfaceFloatCollection- Overrides:
toFloatArrayin classAbstractFloatCollection- Parameters:
a- if this array is big enough, it will be used to store this collection.- Returns:
- a primitive type array containing the items of this collection.
- See Also:
-
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.- Parameters:
action- the action to be performed for each element.- See Also:
-
containsAll
Description copied from interface:FloatCollectionChecks whether this collection contains all elements from the given type-specific collection.- Specified by:
containsAllin interfaceFloatCollection- Overrides:
containsAllin classAbstractFloatCollection- Parameters:
c- a type-specific collection.- Returns:
trueif this collection contains all elements of the argument.- 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.- 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.- 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.- Returns:
- a widened primitive spliterator on the elements of this collection.
-