Package it.unimi.dsi.fastutil.doubles
Class AbstractDoubleSet
- java.lang.Object
-
- java.util.AbstractCollection<java.lang.Double>
-
- it.unimi.dsi.fastutil.doubles.AbstractDoubleCollection
-
- it.unimi.dsi.fastutil.doubles.AbstractDoubleSet
-
- All Implemented Interfaces:
DoubleCollection,DoubleIterable,DoubleSet,java.lang.Cloneable,java.lang.Iterable<java.lang.Double>,java.util.Collection<java.lang.Double>,java.util.Set<java.lang.Double>
- Direct Known Subclasses:
AbstractDoubleSortedSet,DoubleArraySet,DoubleOpenCustomHashSet,DoubleOpenHashBigSet,DoubleOpenHashSet,DoubleSets.Singleton
public abstract class AbstractDoubleSet extends AbstractDoubleCollection implements java.lang.Cloneable, DoubleSet
An abstract class providing basic methods for sets implementing a type-specific interface.Note that the type-specific
Setinterface adds a type-specificremove()method, as it is no longer harmful for subclasses. Thus, concrete subclasses of this class must implementremove()(therem()implementation of this class just delegates toremove()).
-
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description booleanequals(java.lang.Object o)inthashCode()Returns a hash code for this set.abstract DoubleIteratoriterator()Returns a type-specific iterator on the elements of this collection.booleanrem(double k)Deprecated.Please useremove()instead.booleanremove(double k)Removes an element from this set.-
Methods inherited from class it.unimi.dsi.fastutil.doubles.AbstractDoubleCollection
add, add, addAll, addAll, contains, contains, containsAll, containsAll, forEach, remove, removeAll, removeAll, removeIf, retainAll, retainAll, toArray, toDoubleArray, toDoubleArray, toString
-
Methods inherited from interface it.unimi.dsi.fastutil.doubles.DoubleCollection
add, addAll, contains, containsAll, doubleIterator, doubleParallelStream, doubleSpliterator, doubleStream, parallelStream, removeAll, removeIf, removeIf, removeIf, retainAll, stream, toArray, toDoubleArray, toDoubleArray
-
Methods inherited from interface it.unimi.dsi.fastutil.doubles.DoubleIterable
forEach, forEach, forEach
-
Methods inherited from interface it.unimi.dsi.fastutil.doubles.DoubleSet
add, contains, remove, spliterator
-
-
-
-
Method Detail
-
iterator
public abstract DoubleIterator iterator()
Description copied from interface:DoubleCollectionReturns a type-specific iterator on the elements of this collection.- Specified by:
iteratorin interfacejava.util.Collection<java.lang.Double>- Specified by:
iteratorin interfaceDoubleCollection- Specified by:
iteratorin interfaceDoubleIterable- Specified by:
iteratorin interfaceDoubleSet- Specified by:
iteratorin interfacejava.lang.Iterable<java.lang.Double>- Specified by:
iteratorin interfacejava.util.Set<java.lang.Double>- Specified by:
iteratorin classAbstractDoubleCollection- Returns:
- a type-specific iterator on the elements of this collection.
- See Also:
Iterable.iterator()
-
equals
public boolean equals(java.lang.Object o)
- Specified by:
equalsin interfacejava.util.Collection<java.lang.Double>- Specified by:
equalsin interfacejava.util.Set<java.lang.Double>- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
Returns a hash code for this set. The hash code of a set is computed by summing the hash codes of its elements.- Specified by:
hashCodein interfacejava.util.Collection<java.lang.Double>- Specified by:
hashCodein interfacejava.util.Set<java.lang.Double>- Overrides:
hashCodein classjava.lang.Object- Returns:
- a hash code for this set.
-
remove
public boolean remove(double k)
Removes an element from this set. Delegates to the type-specificrem()method implemented by type-specific abstractCollectionsuperclass.
-
rem
@Deprecated public boolean rem(double k)
Deprecated.Please useremove()instead.Removes a single instance of the specified element from this collection, if it is present (optional operation).Note that this method should be called
remove(), but the clash with the similarly named index-based method in theListinterface forces us to use a distinguished name. For simplicity, the set interfaces reinstatesremove(). Delegates to the type-specificremove()method specified in the type-specificSetinterface.- Specified by:
remin interfaceDoubleCollection- Specified by:
remin interfaceDoubleSet- Overrides:
remin classAbstractDoubleCollection- See Also:
Collection.remove(Object)
-
-