public class ArrayDoubleList extends java.lang.Object implements DoubleList
DoubleList
backed by a double-array, supporting all DoubleList
-methods by modifying and/or replacing the
underlying array.Constructor and Description |
---|
ArrayDoubleList() |
ArrayDoubleList(DoubleCollection xs) |
ArrayDoubleList(int capacity) |
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) |
void |
addDoubleAt(int index,
double x) |
int |
binarySearchExactly(double x) |
void |
clear() |
boolean |
containsAllDoublesExactly(double... xs) |
boolean |
containsDoubleExactly(double x) |
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... contents) |
boolean |
removeAllDoublesExactly(double... xs) |
double |
removeDoubleAt(int index) |
boolean |
removeDoubleExactly(double x) |
boolean |
removeDoublesIf(java.util.function.DoublePredicate filter) |
void |
replaceAllDoubles(java.util.function.DoubleUnaryOperator operator) |
boolean |
retainAllDoublesExactly(double... xs) |
double |
setDouble(int index,
double x) |
int |
size() |
void |
sortDoubles() |
java.util.Spliterator.OfDouble |
spliterator() |
DoubleList |
subList(int fromIndex,
int toIndex) |
double[] |
toDoubleArray()
Collect the
doubles in this DoubleCollection into an double -array. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
add, add, addAll, addAll, contains, containsAll, copy, get, indexOf, indexOfDouble, lastIndexOf, lastIndexOfDouble, listIterator, remove, remove, removeAll, removeIf, replaceAll, retainAll, set, sort, sortDoubles, toArray, toArray
containsAllDoubles, containsAllDoubles, containsAllDoublesExactly, containsAnyDoubles, containsAnyDoubles, containsAnyDoublesExactly, containsAnyDoublesExactly, containsDouble, doubleStream, forEach, from, from, once, once, parallelDoubleStream, removeAllDoubles, removeAllDoubles, removeAllDoublesExactly, removeDouble, retainAllDoubles, retainAllDoubles, retainAllDoublesExactly, sequence
public ArrayDoubleList()
public ArrayDoubleList(int capacity)
public ArrayDoubleList(DoubleCollection xs)
public static ArrayDoubleList of(double... contents)
of
in interface DoubleIterable
of
in interface DoubleList
DoubleList
of the given elements.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 DoubleCollection
isEmpty
in interface DoubleIterable
isEmpty
in interface DoubleList
public void clear()
clear
in interface java.util.Collection<java.lang.Double>
clear
in interface java.util.List<java.lang.Double>
clear
in interface DoubleCollection
clear
in interface DoubleIterable
clear
in interface DoubleList
public double[] toDoubleArray()
DoubleCollection
doubles
in this DoubleCollection
into an double
-array.toDoubleArray
in interface DoubleCollection
public 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 DoubleIterable
public DoubleListIterator listIterator(int index)
listIterator
in interface java.util.List<java.lang.Double>
listIterator
in interface DoubleList
public DoubleList subList(int fromIndex, int toIndex)
subList
in interface java.util.List<java.lang.Double>
subList
in interface DoubleList
public void sortDoubles()
sortDoubles
in interface DoubleList
public int binarySearchExactly(double x)
binarySearchExactly
in interface DoubleList
public void replaceAllDoubles(java.util.function.DoubleUnaryOperator operator)
replaceAllDoubles
in interface DoubleList
public double getDouble(int index)
getDouble
in interface DoubleList
public double setDouble(int index, double x)
setDouble
in interface DoubleList
public void addDoubleAt(int index, double x)
addDoubleAt
in interface DoubleList
public double removeDoubleAt(int index)
removeDoubleAt
in interface DoubleList
public int lastIndexOfDoubleExactly(double x)
lastIndexOfDoubleExactly
in interface DoubleList
public int indexOfDoubleExactly(double x)
indexOfDoubleExactly
in interface DoubleList
public 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 DoubleCollection
spliterator
in interface DoubleIterable
spliterator
in interface DoubleList
public boolean addDouble(double x)
addDouble
in interface DoubleCollection
addDouble
in interface DoubleList
public boolean addAllDoubles(double... xs)
addAllDoubles
in interface DoubleCollection
addAllDoubles
in interface DoubleList
public boolean addAllDoubles(DoubleCollection xs)
addAllDoubles
in interface DoubleCollection
addAllDoubles
in interface DoubleList
public boolean addAllDoublesAt(int index, double... xs)
addAllDoublesAt
in interface DoubleList
public boolean addAllDoublesAt(int index, DoubleCollection xs)
addAllDoublesAt
in interface DoubleList
public boolean containsAllDoublesExactly(double... xs)
containsAllDoublesExactly
in interface DoubleIterable
public boolean removeDoubleExactly(double x)
removeDoubleExactly
in interface DoubleIterable
public boolean containsDoubleExactly(double x)
containsDoubleExactly
in interface DoubleIterable
public boolean removeAllDoublesExactly(double... xs)
removeAllDoublesExactly
in interface DoubleIterable
public boolean retainAllDoublesExactly(double... xs)
retainAllDoublesExactly
in interface DoubleIterable
public boolean removeDoublesIf(java.util.function.DoublePredicate filter)
removeDoublesIf
in interface DoubleIterable
public void forEachDouble(java.util.function.DoubleConsumer consumer)
DoubleIterable
double
in this iterable.forEachDouble
in interface DoubleIterable