public static class DoubleSets.Singleton extends AbstractDoubleSet implements java.io.Serializable, java.lang.Cloneable
This class may be useful to implement your own in case you subclass a type-specific set.
Modifier and Type | Method and Description |
---|---|
boolean |
addAll(java.util.Collection<? extends java.lang.Double> c) |
boolean |
addAll(DoubleCollection c)
Adds all elements of the given type-specific collection to this collection.
|
java.lang.Object |
clone() |
boolean |
contains(double k)
Returns
true if this collection contains the specified element. |
void |
forEach(java.util.function.Consumer<? super java.lang.Double> action)
Deprecated.
|
void |
forEach(java.util.function.DoubleConsumer action)
Performs the given action for each element of this type-specific
Iterable
until all elements have been processed or the action throws an
exception. |
DoubleListIterator |
iterator()
Returns a type-specific iterator on the elements of this collection.
|
boolean |
remove(double k)
Removes an element from this set.
|
boolean |
removeAll(java.util.Collection<?> c) |
boolean |
removeAll(DoubleCollection c)
Remove from this collection all elements in the given type-specific collection.
|
boolean |
removeIf(java.util.function.DoublePredicate filter)
Remove from this collection all elements which satisfy the given predicate.
|
boolean |
removeIf(java.util.function.Predicate<? super java.lang.Double> filter)
Deprecated.
|
boolean |
retainAll(java.util.Collection<?> c) |
boolean |
retainAll(DoubleCollection c)
Retains in this collection only elements from the given type-specific collection.
|
int |
size() |
DoubleSpliterator |
spliterator()
Returns a type-specific spliterator on the elements of this set.
|
java.lang.Object[] |
toArray()
Deprecated.
|
double[] |
toDoubleArray()
Returns a primitive type array containing the items of this collection.
|
equals, hashCode, rem
add, add, contains, containsAll, containsAll, forEach, remove, removeIf, toArray, toDoubleArray, toString
add, contains, of, of, of, of, of, remove
add, containsAll, doubleIterator, doubleParallelStream, doubleSpliterator, doubleStream, parallelStream, removeIf, stream, toArray, toDoubleArray
forEach
public boolean contains(double k)
AbstractDoubleCollection
true
if this collection contains the specified element.contains
in interface DoubleCollection
contains
in class AbstractDoubleCollection
Collection.contains(Object)
public boolean remove(double k)
AbstractDoubleSet
rem()
method
implemented by type-specific abstract Collection
superclass.remove
in interface DoubleSet
remove
in class AbstractDoubleSet
Collection.remove(Object)
public DoubleListIterator iterator()
DoubleCollection
iterator
in interface DoubleCollection
iterator
in interface DoubleIterable
iterator
in interface DoubleSet
iterator
in interface java.lang.Iterable<java.lang.Double>
iterator
in interface java.util.Collection<java.lang.Double>
iterator
in interface java.util.Set<java.lang.Double>
iterator
in class AbstractDoubleSet
Iterable.iterator()
public DoubleSpliterator spliterator()
DoubleSet
Set spliterators must report at least Spliterator.DISTINCT
.
See Set.spliterator()
for more documentation on the requirements
of the returned spliterator.
spliterator
in interface DoubleCollection
spliterator
in interface DoubleIterable
spliterator
in interface DoubleSet
spliterator
in interface java.lang.Iterable<java.lang.Double>
spliterator
in interface java.util.Collection<java.lang.Double>
spliterator
in interface java.util.Set<java.lang.Double>
public int size()
size
in interface java.util.Collection<java.lang.Double>
size
in interface java.util.Set<java.lang.Double>
size
in class java.util.AbstractCollection<java.lang.Double>
public double[] toDoubleArray()
DoubleCollection
toDoubleArray
in interface DoubleCollection
toDoubleArray
in class AbstractDoubleCollection
Collection.toArray()
@Deprecated public void forEach(java.util.function.Consumer<? super java.lang.Double> action)
DoubleIterable
forEach
in interface DoubleIterable
forEach
in interface java.lang.Iterable<java.lang.Double>
public boolean addAll(java.util.Collection<? extends java.lang.Double> c)
AbstractDoubleCollection
addAll
in interface java.util.Collection<java.lang.Double>
addAll
in interface java.util.Set<java.lang.Double>
addAll
in class AbstractDoubleCollection
public boolean removeAll(java.util.Collection<?> c)
AbstractDoubleCollection
removeAll
in interface java.util.Collection<java.lang.Double>
removeAll
in interface java.util.Set<java.lang.Double>
removeAll
in class AbstractDoubleCollection
public boolean retainAll(java.util.Collection<?> c)
AbstractDoubleCollection
retainAll
in interface java.util.Collection<java.lang.Double>
retainAll
in interface java.util.Set<java.lang.Double>
retainAll
in class AbstractDoubleCollection
@Deprecated public boolean removeIf(java.util.function.Predicate<? super java.lang.Double> filter)
DoubleCollection
removeIf
in interface DoubleCollection
removeIf
in interface java.util.Collection<java.lang.Double>
public void forEach(java.util.function.DoubleConsumer action)
DoubleIterable
Iterable
until all elements have been processed or the action throws an
exception.forEach
in interface DoubleIterable
action
- the action to be performed for each element.Iterable.forEach(java.util.function.Consumer)
public boolean addAll(DoubleCollection c)
DoubleCollection
addAll
in interface DoubleCollection
addAll
in class AbstractDoubleCollection
c
- a type-specific collection.true
if this collection changed as a result of the call.Collection.addAll(Collection)
public boolean removeAll(DoubleCollection c)
DoubleCollection
removeAll
in interface DoubleCollection
removeAll
in class AbstractDoubleCollection
c
- a type-specific collection.true
if this collection changed as a result of the call.Collection.removeAll(Collection)
public boolean retainAll(DoubleCollection c)
DoubleCollection
retainAll
in interface DoubleCollection
retainAll
in class AbstractDoubleCollection
c
- a type-specific collection.true
if this collection changed as a result of the call.Collection.retainAll(Collection)
public boolean removeIf(java.util.function.DoublePredicate filter)
DoubleCollection
removeIf
in interface DoubleCollection
filter
- a predicate which returns true
for elements to be
removed.true
if any elements were removed.Collection.removeIf(java.util.function.Predicate)
@Deprecated public java.lang.Object[] toArray()
toArray
in interface java.util.Collection<java.lang.Double>
toArray
in interface java.util.Set<java.lang.Double>
toArray
in class java.util.AbstractCollection<java.lang.Double>
public java.lang.Object clone()
clone
in class java.lang.Object