Class DoubleCollections.EmptyCollection
- All Implemented Interfaces:
DoubleCollection,DoubleIterable,Iterable<Double>,Collection<Double>
- Direct Known Subclasses:
DoubleBigLists.EmptyBigList,DoubleLists.EmptyList,DoubleSets.EmptySet
- Enclosing class:
- DoubleCollections
public abstract static class DoubleCollections.EmptyCollection extends AbstractDoubleCollection
This class may be useful to implement your own in case you subclass a type-specific collection.
-
Method Summary
Modifier and Type Method Description booleanaddAll(DoubleCollection c)Adds all elements of the given type-specific collection to this collection.booleanaddAll(Collection<? extends Double> c)voidclear()booleancontains(double k)Returnstrueif this collection contains the specified element.booleanequals(Object o)inthashCode()DoubleBidirectionalIteratoriterator()Returns a type-specific iterator on the elements of this collection.booleanremoveAll(DoubleCollection c)Remove from this collection all elements in the given type-specific collection.booleanremoveAll(Collection<?> c)booleanretainAll(DoubleCollection c)Retains in this collection only elements from the given type-specific collection.booleanretainAll(Collection<?> c)intsize()Object[]toArray()Methods inherited from class it.unimi.dsi.fastutil.doubles.AbstractDoubleCollection
add, add, contains, containsAll, containsAll, rem, remove, toArray, toDoubleArray, toDoubleArray, toStringMethods inherited from class java.util.AbstractCollection
isEmpty, toArrayMethods inherited from interface java.util.Collection
isEmpty, parallelStream, spliterator, stream, toArray, toArrayMethods inherited from interface it.unimi.dsi.fastutil.doubles.DoubleCollection
removeIf, removeIfMethods inherited from interface it.unimi.dsi.fastutil.doubles.DoubleIterable
forEach, forEach
-
Method Details
-
contains
public boolean contains(double k)Description copied from class:AbstractDoubleCollectionReturnstrueif this collection contains the specified element.This implementation iterates over the elements in the collection, looking for the specified element.
- Specified by:
containsin interfaceDoubleCollection- Overrides:
containsin classAbstractDoubleCollection- See Also:
Collection.contains(Object)
-
toArray
- Specified by:
toArrayin interfaceCollection<Double>- Overrides:
toArrayin classAbstractCollection<Double>
-
iterator
Description copied from interface:DoubleCollectionReturns a type-specific iterator on the elements of this collection.Note that 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 extendsCollection.- Specified by:
iteratorin interfaceCollection<Double>- Specified by:
iteratorin interfaceDoubleCollection- Specified by:
iteratorin interfaceDoubleIterable- Specified by:
iteratorin interfaceIterable<Double>- Specified by:
iteratorin classAbstractDoubleCollection- Returns:
- a type-specific iterator on the elements of this collection.
- See Also:
Iterable.iterator()
-
size
public int size()- Specified by:
sizein interfaceCollection<Double>- Specified by:
sizein classAbstractCollection<Double>
-
clear
public void clear()- Specified by:
clearin interfaceCollection<Double>- Overrides:
clearin classAbstractCollection<Double>
-
hashCode
public int hashCode()- Specified by:
hashCodein interfaceCollection<Double>- Overrides:
hashCodein classObject
-
equals
- Specified by:
equalsin interfaceCollection<Double>- Overrides:
equalsin classObject
-
addAll
Description copied from class:AbstractDoubleCollectionThis implementation delegates to the type-specific version if given a type-specific collection, otherwise is uses the implementation from
AbstractCollection.- Specified by:
addAllin interfaceCollection<Double>- Overrides:
addAllin classAbstractDoubleCollection
-
removeAll
Description copied from class:AbstractDoubleCollectionThis implementation delegates to the type-specific version if given a type-specific collection, otherwise is uses the implementation from
AbstractCollection.- Specified by:
removeAllin interfaceCollection<Double>- Overrides:
removeAllin classAbstractDoubleCollection
-
retainAll
Description copied from class:AbstractDoubleCollectionThis implementation delegates to the type-specific version if given a type-specific collection, otherwise is uses the implementation from
AbstractCollection.- Specified by:
retainAllin interfaceCollection<Double>- Overrides:
retainAllin classAbstractDoubleCollection
-
addAll
Description copied from interface:DoubleCollectionAdds all elements of the given type-specific collection to this collection.- Specified by:
addAllin interfaceDoubleCollection- Overrides:
addAllin classAbstractDoubleCollection- Parameters:
c- a type-specific collection.- Returns:
trueif this collection changed as a result of the call.- See Also:
Collection.addAll(Collection)
-
removeAll
Description copied from interface:DoubleCollectionRemove from this collection all elements in the given type-specific collection.- Specified by:
removeAllin interfaceDoubleCollection- Overrides:
removeAllin classAbstractDoubleCollection- Parameters:
c- a type-specific collection.- Returns:
trueif this collection changed as a result of the call.- See Also:
Collection.removeAll(Collection)
-
retainAll
Description copied from interface:DoubleCollectionRetains in this collection only elements from the given type-specific collection.- Specified by:
retainAllin interfaceDoubleCollection- Overrides:
retainAllin classAbstractDoubleCollection- Parameters:
c- a type-specific collection.- Returns:
trueif this collection changed as a result of the call.- See Also:
Collection.retainAll(Collection)
-