Package it.unimi.dsi.fastutil.doubles
Class DoubleCollections.EmptyCollection
- java.lang.Object
-
- java.util.AbstractCollection<Double>
-
- it.unimi.dsi.fastutil.doubles.AbstractDoubleCollection
-
- it.unimi.dsi.fastutil.doubles.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
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 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, rem, remove, toArray, toDoubleArray, toDoubleArray, toString
-
Methods inherited from class java.util.AbstractCollection
containsAll, isEmpty, toArray
-
Methods inherited from interface java.util.Collection
containsAll, isEmpty, parallelStream, spliterator, stream, toArray, toArray
-
Methods inherited from interface it.unimi.dsi.fastutil.doubles.DoubleCollection
removeIf, removeIf
-
Methods inherited from interface it.unimi.dsi.fastutil.doubles.DoubleIterable
forEach, forEach
-
-
-
-
Method Detail
-
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
public Object[] toArray()
- Specified by:
toArrayin interfaceCollection<Double>- Overrides:
toArrayin classAbstractCollection<Double>
-
iterator
public DoubleBidirectionalIterator 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
public boolean equals(Object o)
- Specified by:
equalsin interfaceCollection<Double>- Overrides:
equalsin classObject
-
addAll
public boolean addAll(Collection<? extends Double> c)
- Specified by:
addAllin interfaceCollection<Double>- Overrides:
addAllin classAbstractCollection<Double>
-
removeAll
public boolean removeAll(Collection<?> c)
- Specified by:
removeAllin interfaceCollection<Double>- Overrides:
removeAllin classAbstractCollection<Double>
-
retainAll
public boolean retainAll(Collection<?> c)
- Specified by:
retainAllin interfaceCollection<Double>- Overrides:
retainAllin classAbstractCollection<Double>
-
addAll
public boolean addAll(DoubleCollection c)
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
public boolean removeAll(DoubleCollection c)
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
public boolean retainAll(DoubleCollection c)
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)
-
-