public class DoubleList extends AbstractList<Double> implements Serializable
ArrayList
to store doubles. modCount
Constructor and Description |
---|
DoubleList()
Creates a new empty DoubleList
|
DoubleList(Collection<Double> c)
Creates a new DoubleList containing the values of the given collection
|
DoubleList(int capacity)
Creates a new empty DoubleList
|
Modifier and Type | Method and Description |
---|---|
boolean |
add(double e)
Performs exactly the same as
add(java.lang.Double) . |
boolean |
add(Double e) |
void |
add(int index,
double element)
Operates exactly as
add(int, java.lang.Double) |
void |
add(int index,
Double element) |
void |
clear() |
Double |
get(int index) |
double[] |
getBackingArray()
Returns the reference to the array that backs this list.
|
double |
getD(int index)
Operates exactly as
get(int) |
Vec |
getVecView()
Obtains a view of this double list as a dense vector with equal length.
|
Double |
remove(int index) |
double |
removeD(int index)
Operates exactly as
remove(int) |
double |
set(int index,
double element)
Operates exactly as
set(int, java.lang.Double) |
Double |
set(int index,
Double element) |
int |
size() |
static List<Double> |
unmodifiableView(double[] array,
int length)
Creates an returns an unmodifiable view of the given double array that requires
only a small object allocation.
|
static DoubleList |
view(double[] array,
int length)
Creates and returns a view of the given double array that requires only
a small object allocation.
|
addAll, equals, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIterator, removeRange, subList
addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toString
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
addAll, contains, containsAll, isEmpty, remove, removeAll, replaceAll, retainAll, sort, spliterator, toArray, toArray
parallelStream, removeIf, stream
public DoubleList()
public DoubleList(int capacity)
capacity
- the starting internal capacity of the listpublic DoubleList(Collection<Double> c)
c
- the collection of values to fill this double list withpublic void clear()
clear
in interface Collection<Double>
clear
in interface List<Double>
clear
in class AbstractList<Double>
public int size()
size
in interface Collection<Double>
size
in interface List<Double>
size
in class AbstractCollection<Double>
public boolean add(double e)
add(java.lang.Double)
.e
- the value to addpublic boolean add(Double e)
add
in interface Collection<Double>
add
in interface List<Double>
add
in class AbstractList<Double>
public double getD(int index)
get(int)
index
- the index of the value to getpublic Double get(int index)
public double set(int index, double element)
set(int, java.lang.Double)
index
- the index to setelement
- the value to setpublic void add(int index, double element)
add(int, java.lang.Double)
index
- the index to add atelement
- the value to addpublic void add(int index, Double element)
public double removeD(int index)
remove(int)
index
- the index to removepublic Double remove(int index)
public double[] getBackingArray()
size()
public Vec getVecView()
public static List<Double> unmodifiableView(double[] array, int length)
array
- the array to wrap into an unmodifiable listlength
- the number of values of the array to use, starting from zeropublic static DoubleList view(double[] array, int length)
array
- the array to wrap by a DoubleList objectlength
- the initial length of the listCopyright © 2017. All rights reserved.