public class ArrayDoubleList extends DoubleList.Base implements DoubleList, java.util.RandomAccess
DoubleList backed by a double-array, supporting all DoubleList-methods by modifying and/or replacing the
underlying array.DoubleList.Base| Constructor and Description |
|---|
ArrayDoubleList()
Create a new mutable
ArrayDoubleList. |
ArrayDoubleList(double[] xs) |
ArrayDoubleList(DoubleCollection xs) |
ArrayDoubleList(int capacity)
Deprecated.
Use
withCapacity(int) instead. |
| Modifier and Type | Method and Description |
|---|---|
boolean |
addAllDoubles(double... xs) |
boolean |
addAllDoubles(DoubleCollection xs) |
boolean |
addAllDoublesAt(int index,
double... xs) |
boolean |
addAllDoublesAt(int index,
DoubleCollection xs) |
boolean |
addDouble(double x,
double precision) |
void |
addDoubleAt(int index,
double x) |
boolean |
addDoubleExactly(double x) |
int |
binarySearchExactly(double x) |
void |
clear() |
boolean |
containsDoubleExactly(double x) |
static ArrayDoubleList |
create()
Create a new empty mutable
ArrayDoubleList. |
static ArrayDoubleList |
create(double... xs)
Create a new mutable
ArrayDoubleList initialized with a copy of the given contents. |
void |
forEachDouble(java.util.function.DoubleConsumer consumer)
Performs the given action for each
double in this iterable. |
double |
getDouble(int index) |
int |
indexOfDoubleExactly(double x) |
boolean |
isEmpty() |
DoubleIterator |
iterator() |
int |
lastIndexOfDoubleExactly(double x) |
DoubleListIterator |
listIterator(int index) |
static ArrayDoubleList |
of(double... xs)
Deprecated.
Use
create(double...) instead. |
boolean |
removeAllDoubles(double[] xs,
double precision) |
boolean |
removeAllDoublesExactly(double... xs) |
boolean |
removeDouble(double x,
double precision) |
double |
removeDoubleAt(int index) |
boolean |
removeDoubleExactly(double x) |
boolean |
removeDoublesIf(java.util.function.DoublePredicate filter) |
void |
replaceAllDoubles(java.util.function.DoubleUnaryOperator operator) |
boolean |
retainAllDoubles(double[] xs,
double precision) |
boolean |
retainAllDoublesExactly(double... xs) |
double |
setDouble(int index,
double x) |
int |
size() |
void |
sortDoubles() |
java.util.Spliterator.OfDouble |
spliterator() |
DoubleList |
subList(int from,
int to) |
double[] |
toDoubleArray()
Collect the
doubles in this DoubleCollection into an double-array. |
protected void |
uncheckedAdd(int index,
DoubleIterable xs,
int xsSize) |
static ArrayDoubleList |
withCapacity(int capacity) |
equals, hashCodetoStringclone, finalize, getClass, notify, notifyAll, wait, wait, waitadd, add, addAll, addAll, contains, containsAll, copy, get, indexOf, indexOfDouble, lastIndexOf, lastIndexOfDouble, listIterator, remove, remove, removeAll, removeIf, replaceAll, retainAll, set, sort, sortDoubles, toArray, toArrayaddDoublecontainsAllDoubles, containsAllDoubles, containsAllDoublesExactly, containsAllDoublesExactly, containsAnyDoubles, containsAnyDoubles, containsAnyDoublesExactly, containsAnyDoublesExactly, containsDouble, doubleStream, forEach, from, from, once, once, parallelDoubleStream, removeAllDoubles, removeAllDoublesExactly, retainAllDoubles, retainAllDoublesExactly, sequencepublic ArrayDoubleList()
ArrayDoubleList.@Deprecated public ArrayDoubleList(int capacity)
withCapacity(int) instead.ArrayDoubleList with the given initial capacity.public ArrayDoubleList(DoubleCollection xs)
public ArrayDoubleList(double[] xs)
@Deprecated public static ArrayDoubleList of(double... xs)
create(double...) instead.DoubleListDoubleList of the given elements. The returned DoubleList's
DoubleListIterator supports forward iteration only.of in interface DoubleIterableof in interface DoubleListArrayDoubleList initialized with a copy of the given contents.public static ArrayDoubleList create()
ArrayDoubleList. When possible, it's preferred to use
DoubleList.create() instead.create in interface DoubleListArrayDoubleList.DoubleList.create(),
withCapacity(int)public static ArrayDoubleList create(double... xs)
ArrayDoubleList initialized with a copy of the given contents. When possible, it's
preferred to use DoubleList.create(double...) instead.create in interface DoubleListArrayDoubleList initialized with a copy of the given contents.DoubleList.create(double...),
ArrayDoubleList(DoubleCollection)public static ArrayDoubleList withCapacity(int capacity)
ArrayDoubleList with the given initial capacity.public int size()
size in interface java.util.Collection<java.lang.Double>size in interface java.util.List<java.lang.Double>public boolean isEmpty()
isEmpty in interface java.util.Collection<java.lang.Double>isEmpty in interface java.util.List<java.lang.Double>isEmpty in interface DoubleCollectionisEmpty in interface DoubleIterableisEmpty in interface DoubleListpublic void clear()
clear in interface java.util.Collection<java.lang.Double>clear in interface java.util.List<java.lang.Double>clear in interface DoubleCollectionclear in interface DoubleIterableclear in interface DoubleListpublic double[] toDoubleArray()
DoubleCollectiondoubles in this DoubleCollection into an double-array.toDoubleArray in interface DoubleCollectionpublic DoubleIterator iterator()
iterator in interface java.lang.Iterable<java.lang.Double>iterator in interface java.util.Collection<java.lang.Double>iterator in interface java.util.List<java.lang.Double>iterator in interface DoubleIterablepublic DoubleListIterator listIterator(int index)
listIterator in interface java.util.List<java.lang.Double>listIterator in interface DoubleListpublic void sortDoubles()
sortDoubles in interface DoubleListpublic int binarySearchExactly(double x)
binarySearchExactly in interface DoubleListpublic DoubleList subList(int from, int to)
subList in interface java.util.List<java.lang.Double>subList in interface DoubleListpublic void replaceAllDoubles(java.util.function.DoubleUnaryOperator operator)
replaceAllDoubles in interface DoubleListpublic double getDouble(int index)
getDouble in interface DoubleListpublic double setDouble(int index,
double x)
setDouble in interface DoubleListpublic void addDoubleAt(int index,
double x)
addDoubleAt in interface DoubleListpublic double removeDoubleAt(int index)
removeDoubleAt in interface DoubleListpublic int lastIndexOfDoubleExactly(double x)
lastIndexOfDoubleExactly in interface DoubleListpublic int indexOfDoubleExactly(double x)
indexOfDoubleExactly in interface DoubleListpublic java.util.Spliterator.OfDouble spliterator()
spliterator in interface java.lang.Iterable<java.lang.Double>spliterator in interface java.util.Collection<java.lang.Double>spliterator in interface java.util.List<java.lang.Double>spliterator in interface DoubleCollectionspliterator in interface DoubleIterablespliterator in interface DoubleListpublic boolean addDoubleExactly(double x)
addDoubleExactly in interface DoubleCollectionaddDoubleExactly in interface DoubleListDoubleCollection.addDouble(double, double)public boolean addDouble(double x,
double precision)
addDouble in interface DoubleCollectionaddDouble in interface DoubleListDoubleCollection.addDoubleExactly(double)public boolean addAllDoubles(double... xs)
addAllDoubles in interface DoubleCollectionaddAllDoubles in interface DoubleListpublic boolean addAllDoubles(DoubleCollection xs)
addAllDoubles in interface DoubleCollectionaddAllDoubles in interface DoubleListpublic boolean addAllDoublesAt(int index,
double... xs)
addAllDoublesAt in interface DoubleListpublic boolean addAllDoublesAt(int index,
DoubleCollection xs)
addAllDoublesAt in interface DoubleListpublic boolean removeDouble(double x,
double precision)
removeDouble in interface DoubleIterablepublic boolean removeDoubleExactly(double x)
removeDoubleExactly in interface DoubleIterablepublic boolean containsDoubleExactly(double x)
containsDoubleExactly in interface DoubleIterablepublic boolean removeAllDoubles(double[] xs,
double precision)
removeAllDoubles in interface DoubleIterablepublic boolean removeAllDoublesExactly(double... xs)
removeAllDoublesExactly in interface DoubleIterablepublic boolean retainAllDoubles(double[] xs,
double precision)
retainAllDoubles in interface DoubleIterablepublic boolean retainAllDoublesExactly(double... xs)
retainAllDoublesExactly in interface DoubleIterablepublic boolean removeDoublesIf(java.util.function.DoublePredicate filter)
removeDoublesIf in interface DoubleIterablepublic void forEachDouble(java.util.function.DoubleConsumer consumer)
DoubleIterabledouble in this iterable.forEachDouble in interface DoubleIterableprotected void uncheckedAdd(int index,
DoubleIterable xs,
int xsSize)