Package it.unimi.dsi.fastutil.doubles
Interface DoubleSet
-
- All Superinterfaces:
Collection<Double>
,DoubleCollection
,DoubleIterable
,Iterable<Double>
,Set<Double>
- All Known Subinterfaces:
DoubleSortedSet
- All Known Implementing Classes:
AbstractDoubleSet
,AbstractDoubleSortedSet
,DoubleArraySet
,DoubleAVLTreeSet
,DoubleLinkedOpenCustomHashSet
,DoubleLinkedOpenHashSet
,DoubleOpenCustomHashSet
,DoubleOpenHashBigSet
,DoubleOpenHashSet
,DoubleRBTreeSet
,DoubleSets.EmptySet
,DoubleSets.Singleton
,DoubleSets.SynchronizedSet
,DoubleSets.UnmodifiableSet
,DoubleSortedSets.EmptySet
,DoubleSortedSets.Singleton
,DoubleSortedSets.SynchronizedSortedSet
,DoubleSortedSets.UnmodifiableSortedSet
public interface DoubleSet extends DoubleCollection, Set<Double>
A type-specificSet
; provides some additional methods that use polymorphism to avoid (un)boxing.Additionally, this interface strengthens (again)
iterator()
.- See Also:
Set
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Deprecated Methods Modifier and Type Method Description default boolean
add(Double o)
Deprecated.Please use the corresponding type-specific method instead.default boolean
contains(Object o)
Deprecated.Please use the corresponding type-specific method instead.DoubleIterator
iterator()
Returns a type-specific iterator on the elements of this set.static DoubleSet
of(double... a)
Creates a new set using a list of elements.default boolean
rem(double k)
Deprecated.Please useremove()
instead.boolean
remove(double k)
Removes an element from this set.default boolean
remove(Object o)
Deprecated.Please use the corresponding type-specific method instead.-
Methods inherited from interface java.util.Collection
parallelStream, stream, toArray
-
Methods inherited from interface it.unimi.dsi.fastutil.doubles.DoubleCollection
add, addAll, contains, containsAll, removeAll, removeIf, removeIf, retainAll, toArray, toDoubleArray, toDoubleArray
-
Methods inherited from interface it.unimi.dsi.fastutil.doubles.DoubleIterable
forEach, forEach
-
-
-
-
Method Detail
-
iterator
DoubleIterator iterator()
Returns a type-specific iterator on the elements of this set.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 extendsSet
.- Specified by:
iterator
in interfaceCollection<Double>
- Specified by:
iterator
in interfaceDoubleCollection
- Specified by:
iterator
in interfaceDoubleIterable
- Specified by:
iterator
in interfaceIterable<Double>
- Specified by:
iterator
in interfaceSet<Double>
- Returns:
- a type-specific iterator on the elements of this set.
- See Also:
Iterable.iterator()
-
remove
boolean remove(double k)
Removes an element from this set.Note that the corresponding method of a type-specific collection is
rem()
. This unfortunate situation is caused by the clash with the similarly named index-based method in theList
interface.- See Also:
Collection.remove(Object)
-
remove
@Deprecated default boolean remove(Object o)
Deprecated.Please use the corresponding type-specific method instead.- Specified by:
remove
in interfaceCollection<Double>
- Specified by:
remove
in interfaceDoubleCollection
- Specified by:
remove
in interfaceSet<Double>
-
add
@Deprecated default boolean add(Double o)
Deprecated.Please use the corresponding type-specific method instead.- Specified by:
add
in interfaceCollection<Double>
- Specified by:
add
in interfaceDoubleCollection
- Specified by:
add
in interfaceSet<Double>
-
contains
@Deprecated default boolean contains(Object o)
Deprecated.Please use the corresponding type-specific method instead.- Specified by:
contains
in interfaceCollection<Double>
- Specified by:
contains
in interfaceDoubleCollection
- Specified by:
contains
in interfaceSet<Double>
-
rem
@Deprecated default boolean rem(double k)
Deprecated.Please useremove()
instead.Removes an element from this set.This method is inherited from the type-specific collection this type-specific set is based on, but it should not used as this interface reinstates
remove()
as removal method.- Specified by:
rem
in interfaceDoubleCollection
- See Also:
Collection.remove(Object)
-
of
@SafeVarargs static DoubleSet of(double... a)
Creates a new set using a list of elements.- Parameters:
a
- a list of elements that will be used to initialize the new set.
-
-