Package it.unimi.dsi.fastutil.doubles
Class DoubleSets.Singleton
java.lang.Object
java.util.AbstractCollection<Double>
it.unimi.dsi.fastutil.doubles.AbstractDoubleCollection
it.unimi.dsi.fastutil.doubles.AbstractDoubleSet
it.unimi.dsi.fastutil.doubles.DoubleSets.Singleton
- All Implemented Interfaces:
DoubleCollection,DoubleIterable,DoubleSet,Serializable,Cloneable,Iterable<Double>,Collection<Double>,Set<Double>
- Direct Known Subclasses:
DoubleSortedSets.Singleton
- Enclosing class:
- DoubleSets
public static class DoubleSets.Singleton
extends AbstractDoubleSet
implements Serializable, Cloneable
An immutable class representing a type-specific singleton set.
This class may be useful to implement your own in case you subclass a type-specific set.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionbooleanAdds all elements of the given type-specific collection to this collection.booleanaddAll(Collection<? extends Double> c) clone()booleancontains(double k) Returnstrueif this collection contains the specified element.voidDeprecated.voidforEach(DoubleConsumer action) Performs the given action for each element of this type-specificIterableuntil all elements have been processed or the action throws an exception.iterator()Returns a type-specific iterator on the elements of this collection.booleanremove(double k) Removes an element from this set.booleanRemove from this collection all elements in the given type-specific collection.booleanremoveAll(Collection<?> c) booleanremoveIf(DoublePredicate 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 set.Object[]toArray()Deprecated.double[]Returns a primitive type array containing the items of this collection.Methods inherited from class it.unimi.dsi.fastutil.doubles.AbstractDoubleSet
equals, hashCode, remMethods inherited from class it.unimi.dsi.fastutil.doubles.AbstractDoubleCollection
add, add, contains, containsAll, containsAll, forEach, remove, removeIf, toArray, toDoubleArray, toStringMethods inherited from class java.util.AbstractCollection
clear, isEmpty, toArrayMethods inherited from interface java.util.Collection
toArrayMethods inherited from interface it.unimi.dsi.fastutil.doubles.DoubleCollection
add, containsAll, doubleIterator, doubleParallelStream, doubleSpliterator, doubleStream, parallelStream, removeIf, stream, toArray, toDoubleArrayMethods inherited from interface it.unimi.dsi.fastutil.doubles.DoubleIterable
forEachMethods inherited from interface java.util.Set
clear, containsAll, isEmpty, toArray
-
Method Details
-
contains
public boolean contains(double k) Description copied from class:AbstractDoubleCollectionReturnstrueif this collection contains the specified element.- Specified by:
containsin interfaceDoubleCollection- Overrides:
containsin classAbstractDoubleCollection- See Also:
-
remove
public boolean remove(double k) Description copied from class:AbstractDoubleSetRemoves an element from this set. Delegates to the type-specificrem()method implemented by type-specific abstractCollectionsuperclass.- Specified by:
removein interfaceDoubleSet- Overrides:
removein classAbstractDoubleSet- See Also:
-
iterator
Description copied from interface:DoubleCollectionReturns a type-specific iterator on the elements of this collection.- Specified by:
iteratorin interfaceCollection<Double>- Specified by:
iteratorin interfaceDoubleCollection- Specified by:
iteratorin interfaceDoubleIterable- Specified by:
iteratorin interfaceDoubleSet- Specified by:
iteratorin interfaceIterable<Double>- Specified by:
iteratorin interfaceSet<Double>- Specified by:
iteratorin classAbstractDoubleSet- Returns:
- a type-specific iterator on the elements of this collection.
- See Also:
-
spliterator
Description copied from interface:DoubleSetReturns a type-specific spliterator on the elements of this set.Set spliterators must report at least
Spliterator.DISTINCT.See
Set.spliterator()for more documentation on the requirements of the returned spliterator.- Specified by:
spliteratorin interfaceCollection<Double>- Specified by:
spliteratorin interfaceDoubleCollection- Specified by:
spliteratorin interfaceDoubleIterable- Specified by:
spliteratorin interfaceDoubleSet- Specified by:
spliteratorin interfaceIterable<Double>- Specified by:
spliteratorin interfaceSet<Double>- Returns:
- a type-specific spliterator on the elements of this collection.
-
size
public int size()- Specified by:
sizein interfaceCollection<Double>- Specified by:
sizein interfaceSet<Double>- Specified by:
sizein classAbstractCollection<Double>
-
toDoubleArray
public double[] toDoubleArray()Description copied from interface:DoubleCollectionReturns a primitive type array containing the items of this collection.- Specified by:
toDoubleArrayin interfaceDoubleCollection- Overrides:
toDoubleArrayin classAbstractDoubleCollection- Returns:
- a primitive type array containing the items of this collection.
- See Also:
-
forEach
Deprecated.Description copied from interface:DoubleIterable- Specified by:
forEachin interfaceDoubleIterable- Specified by:
forEachin interfaceIterable<Double>
-
addAll
Description copied from class:AbstractDoubleCollection- Specified by:
addAllin interfaceCollection<Double>- Specified by:
addAllin interfaceSet<Double>- Overrides:
addAllin classAbstractDoubleCollection
-
removeAll
Description copied from class:AbstractDoubleCollection- Specified by:
removeAllin interfaceCollection<Double>- Specified by:
removeAllin interfaceSet<Double>- Overrides:
removeAllin classAbstractDoubleCollection
-
retainAll
Description copied from class:AbstractDoubleCollection- Specified by:
retainAllin interfaceCollection<Double>- Specified by:
retainAllin interfaceSet<Double>- Overrides:
retainAllin classAbstractDoubleCollection
-
removeIf
Deprecated.Description copied from interface:DoubleCollection- Specified by:
removeIfin interfaceCollection<Double>- Specified by:
removeIfin interfaceDoubleCollection
-
forEach
Description copied from interface:DoubleIterablePerforms the given action for each element of this type-specificIterableuntil all elements have been processed or the action throws an exception.- Specified by:
forEachin interfaceDoubleIterable- Parameters:
action- the action to be performed for each element.- See Also:
-
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:
-
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:
-
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:
-
removeIf
Description copied from interface:DoubleCollectionRemove from this collection all elements which satisfy the given predicate.- Specified by:
removeIfin interfaceDoubleCollection- Parameters:
filter- a predicate which returnstruefor elements to be removed.- Returns:
trueif any elements were removed.- See Also:
-
toArray
Deprecated.- Specified by:
toArrayin interfaceCollection<Double>- Specified by:
toArrayin interfaceSet<Double>- Overrides:
toArrayin classAbstractCollection<Double>
-
clone
-