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 |
add(double k) |
boolean |
addAll(java.util.Collection<? extends java.lang.Double> c)
Adds all elements of the given collection to this collection.
|
boolean |
addAll(DoubleCollection c)
Adds all elements of the given type-specific collection to this collection.
|
java.lang.Object |
clone() |
boolean |
contains(double k) |
DoubleListIterator |
iterator()
Returns a type-specific iterator on the elements of this collection.
|
boolean |
removeAll(java.util.Collection<?> c)
Remove from this collection all elements in the given collection.
|
boolean |
removeAll(DoubleCollection c)
Remove from this collection all elements in the given type-specific collection.
|
boolean |
retainAll(java.util.Collection<?> c)
Retains in this collection only elements from the given collection.
|
boolean |
retainAll(DoubleCollection c)
Retains in this collection only elements from the given type-specific collection.
|
int |
size() |
double[] |
toDoubleArray()
Returns a primitive type array containing the items of this collection.
|
equals, hashCode, rem, remove, remove
add, contains, containsAll, containsAll, doubleIterator, isEmpty, rem, toArray, toArray, toArray, toDoubleArray, toString
containsAll, doubleIterator, toArray, toArray, toDoubleArray
public boolean add(double k)
add
in interface DoubleCollection
add
in class AbstractDoubleCollection
Collection.add(Object)
public boolean contains(double k)
contains
in interface DoubleCollection
contains
in class AbstractDoubleCollection
Collection.contains(Object)
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
c
- a collection.true
if this collection changed as a result of the call.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
c
- a collection.true
if this collection changed as a result of the call.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
c
- a collection.true
if this collection changed as a result of the call.public double[] toDoubleArray()
DoubleCollection
toDoubleArray
in interface DoubleCollection
toDoubleArray
in class AbstractDoubleCollection
Collection.toArray()
public boolean addAll(DoubleCollection c)
AbstractDoubleCollection
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)
AbstractDoubleCollection
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)
AbstractDoubleCollection
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 DoubleListIterator iterator()
DoubleCollection
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 extends Collection
.
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
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 java.lang.Object clone()
clone
in class java.lang.Object