public static class DoubleSortedSets.SynchronizedSortedSet extends DoubleSets.SynchronizedSet implements DoubleSortedSet, java.io.Serializable
Modifier and Type | Method and Description |
---|---|
boolean |
add(double k)
Ensures that this collection contains the specified element (optional operation).
|
boolean |
add(java.lang.Double k)
Deprecated.
|
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.
|
void |
clear() |
DoubleComparator |
comparator() |
boolean |
contains(double k)
Returns
true if this collection contains the specified element. |
boolean |
contains(java.lang.Object k)
Deprecated.
|
boolean |
containsAll(java.util.Collection<?> c) |
boolean |
containsAll(DoubleCollection c)
Checks whether this collection contains all elements from the given type-specific collection.
|
DoubleIterator |
doubleIterator()
Returns a primitive iterator on the elements of this collection.
|
java.util.stream.DoubleStream |
doubleParallelStream()
Return a parallel primitive stream over the elements, performing widening casts if needed.
|
DoubleSpliterator |
doubleSpliterator()
Returns a primitive spliterator on the elements of this collection.
|
java.util.stream.DoubleStream |
doubleStream()
Return a primitive stream over the elements, performing widening casts if needed.
|
boolean |
equals(java.lang.Object o) |
java.lang.Double |
first()
Deprecated.
Please use the corresponding type-specific method instead.
|
double |
firstDouble()
Returns the first (lowest) element currently in this set.
|
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. |
int |
hashCode() |
DoubleSortedSet |
headSet(double to)
Returns a view of the portion of this sorted set whose elements are strictly less than
toElement . |
DoubleSortedSet |
headSet(java.lang.Double to)
Deprecated.
Please use the corresponding type-specific method instead.
|
boolean |
isEmpty() |
DoubleBidirectionalIterator |
iterator()
Returns a type-specific iterator on the elements of this collection.
|
DoubleBidirectionalIterator |
iterator(double from)
Returns a type-specific
BidirectionalIterator on the elements in
this set, starting from a given element of the domain (optional operation). |
java.lang.Double |
last()
Deprecated.
Please use the corresponding type-specific method instead.
|
double |
lastDouble()
Returns the last (highest) element currently in this set.
|
java.util.stream.Stream<java.lang.Double> |
parallelStream()
Deprecated.
|
boolean |
remove(java.lang.Object k)
Deprecated.
|
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 |
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 collection.
|
java.util.stream.Stream<java.lang.Double> |
stream()
Deprecated.
|
DoubleSortedSet |
subSet(double from,
double to)
Returns a view of the portion of this sorted set whose elements range from
fromElement , inclusive, to toElement , exclusive. |
DoubleSortedSet |
subSet(java.lang.Double from,
java.lang.Double to)
Deprecated.
Please use the corresponding type-specific method instead.
|
DoubleSortedSet |
tailSet(double from)
Returns a view of the portion of this sorted set whose elements are greater than or equal to
fromElement . |
DoubleSortedSet |
tailSet(java.lang.Double from)
Deprecated.
Please use the corresponding type-specific method instead.
|
java.lang.Object[] |
toArray() |
double[] |
toArray(double[] a)
Returns an array containing all of the elements in this collection; the runtime type of the returned array is that of the specified array.
|
<T> T[] |
toArray(T[] a) |
double[] |
toDoubleArray()
Returns a primitive type array containing the items of this collection.
|
double[] |
toDoubleArray(double[] a)
Deprecated.
|
java.lang.String |
toString() |
rem, remove
spliterator
add, contains, of, of, of, of, of, rem, remove, remove
add, addAll, contains, containsAll, doubleIterator, doubleParallelStream, doubleSpliterator, doubleStream, parallelStream, removeAll, removeIf, removeIf, removeIf, retainAll, stream, toArray, toDoubleArray, toDoubleArray
forEach, forEach, forEach
public DoubleComparator comparator()
DoubleSortedSet
comparator
in interface DoubleSortedSet
comparator
in interface java.util.SortedSet<java.lang.Double>
public DoubleSortedSet subSet(double from, double to)
DoubleSortedSet
fromElement
, inclusive, to toElement
, exclusive.subSet
in interface DoubleSortedSet
SortedSet.subSet(Object,Object)
public DoubleSortedSet headSet(double to)
DoubleSortedSet
toElement
.headSet
in interface DoubleSortedSet
SortedSet.headSet(Object)
public DoubleSortedSet tailSet(double from)
DoubleSortedSet
fromElement
.tailSet
in interface DoubleSortedSet
SortedSet.tailSet(Object)
public DoubleBidirectionalIterator iterator()
DoubleCollection
iterator
in interface DoubleBidirectionalIterable
iterator
in interface DoubleCollection
iterator
in interface DoubleIterable
iterator
in interface DoubleSet
iterator
in interface DoubleSortedSet
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>
Iterable.iterator()
public DoubleBidirectionalIterator iterator(double from)
DoubleSortedSet
BidirectionalIterator
on the elements in
this set, starting from a given element of the domain (optional operation).
This method returns a type-specific bidirectional iterator with given
starting point. The starting point is any element comparable to the
elements of this set (even if it does not actually belong to the
set). The next element of the returned iterator is the least element of
the set that is greater than the starting point (if there are no
elements greater than the starting point, hasNext()
will return
false
). The previous element of the returned iterator is
the greatest element of the set that is smaller than or equal to the
starting point (if there are no elements smaller than or equal to the
starting point, hasPrevious()
will return false
).
Note that passing the last element of the set as starting point and
calling previous()
you can traverse the
entire set in reverse order.
iterator
in interface DoubleSortedSet
from
- an element to start from.public double firstDouble()
DoubleSortedSet
firstDouble
in interface DoubleSortedSet
SortedSet.first()
public double lastDouble()
DoubleSortedSet
lastDouble
in interface DoubleSortedSet
SortedSet.last()
@Deprecated public java.lang.Double first()
first
in interface DoubleSortedSet
first
in interface java.util.SortedSet<java.lang.Double>
@Deprecated public java.lang.Double last()
last
in interface DoubleSortedSet
last
in interface java.util.SortedSet<java.lang.Double>
@Deprecated public DoubleSortedSet subSet(java.lang.Double from, java.lang.Double to)
subSet
in interface DoubleSortedSet
subSet
in interface java.util.SortedSet<java.lang.Double>
@Deprecated public DoubleSortedSet headSet(java.lang.Double to)
headSet
in interface DoubleSortedSet
headSet
in interface java.util.SortedSet<java.lang.Double>
@Deprecated public DoubleSortedSet tailSet(java.lang.Double from)
tailSet
in interface DoubleSortedSet
tailSet
in interface java.util.SortedSet<java.lang.Double>
public boolean add(double k)
DoubleCollection
add
in interface DoubleCollection
Collection.add(Object)
public boolean contains(double k)
DoubleCollection
true
if this collection contains the specified element.contains
in interface DoubleCollection
Collection.contains(Object)
public int size()
size
in interface java.util.Collection<java.lang.Double>
public boolean isEmpty()
isEmpty
in interface java.util.Collection<java.lang.Double>
public double[] toDoubleArray()
DoubleCollection
toDoubleArray
in interface DoubleCollection
Collection.toArray()
public java.lang.Object[] toArray()
toArray
in interface java.util.Collection<java.lang.Double>
@Deprecated public double[] toDoubleArray(double[] a)
DoubleCollection
Note that, contrarily to Collection.toArray(Object[])
, this
methods just writes all elements of this collection: no special
value will be added after the last one.
toDoubleArray
in interface DoubleCollection
a
- if this array is big enough, it will be used to store this collection.Collection.toArray(Object[])
public double[] toArray(double[] a)
DoubleCollection
Note that, contrarily to Collection.toArray(Object[])
, this
methods just writes all elements of this collection: no special
value will be added after the last one.
toArray
in interface DoubleCollection
a
- if this array is big enough, it will be used to store this collection.Collection.toArray(Object[])
public boolean addAll(DoubleCollection c)
DoubleCollection
addAll
in interface DoubleCollection
c
- a type-specific collection.true
if this collection changed as a result of the call.Collection.addAll(Collection)
public boolean containsAll(DoubleCollection c)
DoubleCollection
containsAll
in interface DoubleCollection
c
- a type-specific collection.true
if this collection contains all elements of the argument.Collection.containsAll(Collection)
public boolean removeAll(DoubleCollection c)
DoubleCollection
removeAll
in interface DoubleCollection
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
c
- a type-specific collection.true
if this collection changed as a result of the call.Collection.retainAll(Collection)
@Deprecated public boolean add(java.lang.Double k)
DoubleCollection
add
in interface DoubleCollection
add
in interface java.util.Collection<java.lang.Double>
@Deprecated public boolean contains(java.lang.Object k)
DoubleCollection
contains
in interface DoubleCollection
contains
in interface java.util.Collection<java.lang.Double>
@Deprecated public boolean remove(java.lang.Object k)
DoubleCollection
remove
in interface DoubleCollection
remove
in interface java.util.Collection<java.lang.Double>
public DoubleIterator doubleIterator()
DoubleCollection
This method is identical to DoubleCollection.iterator()
, as the type-specific
iterator is already compatible with the JDK's primitive iterators.
It only exists for compatibility with the other primitive types' Collection
s
that have use for widened iterators.
doubleIterator
in interface DoubleCollection
doubleIterator
in interface DoubleIterable
public DoubleSpliterator doubleSpliterator()
DoubleCollection
This method is identical to DoubleCollection.spliterator()
, as the type-specific
spliterator is already compatible with the JDK's primitive spliterators.
It only exists for compatibility with the other primitive types' Collection
s
that have use for widened spliterators.
doubleSpliterator
in interface DoubleCollection
doubleSpliterator
in interface DoubleIterable
public java.util.stream.DoubleStream doubleStream()
DoubleCollection
doubleStream
in interface DoubleCollection
Collection.stream()
,
IntStream
public java.util.stream.DoubleStream doubleParallelStream()
DoubleCollection
doubleParallelStream
in interface DoubleCollection
Collection.parallelStream()
,
IntStream
public <T> T[] toArray(T[] a)
toArray
in interface java.util.Collection<java.lang.Double>
public DoubleSpliterator spliterator()
DoubleCollection
See Collection.spliterator()
for more documentation on the requirements
of the returned spliterator.
spliterator
in interface DoubleCollection
spliterator
in interface DoubleIterable
spliterator
in interface java.lang.Iterable<java.lang.Double>
spliterator
in interface java.util.Collection<java.lang.Double>
@Deprecated public java.util.stream.Stream<java.lang.Double> stream()
DoubleCollection
stream
in interface DoubleCollection
stream
in interface java.util.Collection<java.lang.Double>
@Deprecated public java.util.stream.Stream<java.lang.Double> parallelStream()
DoubleCollection
parallelStream
in interface DoubleCollection
parallelStream
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(java.util.Collection<? extends java.lang.Double> c)
addAll
in interface java.util.Collection<java.lang.Double>
public boolean containsAll(java.util.Collection<?> c)
containsAll
in interface java.util.Collection<java.lang.Double>
public boolean removeAll(java.util.Collection<?> c)
removeAll
in interface java.util.Collection<java.lang.Double>
public boolean retainAll(java.util.Collection<?> c)
retainAll
in interface java.util.Collection<java.lang.Double>
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)
public void clear()
clear
in interface java.util.Collection<java.lang.Double>
public java.lang.String toString()
toString
in class java.lang.Object
public int hashCode()
hashCode
in interface java.util.Collection<java.lang.Double>
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object o)
equals
in interface java.util.Collection<java.lang.Double>
equals
in class java.lang.Object