public class DoubleList extends AbstractList<Double>
Has sum, mean, median, standardDeviation, reduceBy, variance.
modCount
Constructor and Description |
---|
DoubleList()
Create a new list with exactly 10 items in it.
|
DoubleList(double[] values)
Create a new list with this many items in it.
|
DoubleList(int capacity)
Create a new list with this many items in it.
|
Modifier and Type | Method and Description |
---|---|
DoubleList |
add(double integer)
Add a new value to the list but don't employ a wrapper.
|
boolean |
add(Double integer)
Add a new value to the list.
|
boolean |
addArray(double... integers)
Add a new array to the list.
|
boolean |
addFloat(double value)
Add a new value to the list but don't employ a wrapper.
|
double |
atIndex(int index)
Get the value at index
|
double |
atIndex(int index,
double element)
Set a value in the list.
|
boolean |
equals(Object o) |
Double |
get(int index)
Get the value at index
|
double |
getFloat(int index)
Get the value at index but don't use a wrapper
|
int |
hashCode() |
double |
idx(int index)
Get the value at index
|
double |
idx(int index,
double element)
Set a value in the list.
|
double |
max()
max
|
double |
mean()
Mean
|
double |
median()
median
|
double |
min()
min
|
double |
reduceBy(Dbl.ReduceBy reduceBy) |
double |
reduceBy(Object function)
This would be a good opportunity to reintroduce dynamic invoke
|
double |
reduceBy(Object function,
String name)
This would be a good opportunity to reintroduce dynamic invoke
|
Double |
set(int index,
Double element)
Set a value in the list.
|
double |
setFloat(int index,
double element)
Set in a new value no wrapper
|
int |
size()
Return the current size.
|
void |
sort()
sort
|
double |
standardDeviation()
standardDeviation
|
double |
sum()
Sums the values with bounds checking.
|
static DoubleList |
toDoubleList(Collection<?> inputList,
String propertyPath)
Creates a primitive list based on an input list and a property path
|
double[] |
toValueArray()
Get a copy of the array up to the end element.
|
double |
variance()
variance
|
add, addAll, clear, indexOf, iterator, lastIndexOf, listIterator, listIterator, remove, removeRange, subList
addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toString
public DoubleList(int capacity)
public DoubleList()
public DoubleList(double[] values)
public static DoubleList toDoubleList(Collection<?> inputList, String propertyPath)
inputList
- input listpropertyPath
- property pathpublic Double get(int index)
public double idx(int index)
index
- indexpublic double atIndex(int index)
index
- indexpublic final double getFloat(int index)
index
- indexpublic boolean add(Double integer)
add
in interface Collection<Double>
add
in interface List<Double>
add
in class AbstractList<Double>
integer
- new valuepublic boolean addFloat(double value)
value
- new valuepublic DoubleList add(double integer)
integer
- new valuepublic boolean addArray(double... integers)
public double idx(int index, double element)
index
- indexelement
- new valuepublic double atIndex(int index, double element)
index
- indexelement
- new valuepublic double setFloat(int index, double element)
index
- indexelement
- new valuepublic int size()
size
in interface Collection<Double>
size
in interface List<Double>
size
in class AbstractCollection<Double>
public double sum()
public double[] toValueArray()
public double reduceBy(Object function)
function
- functionpublic double reduceBy(Object function, String name)
function
- functionpublic double reduceBy(Dbl.ReduceBy reduceBy)
reduceBy
- reduceBy functionpublic double mean()
public double standardDeviation()
public double variance()
public double max()
public double min()
public double median()
public void sort()
public boolean equals(Object o)
equals
in interface Collection<Double>
equals
in interface List<Double>
equals
in class AbstractList<Double>
public int hashCode()
hashCode
in interface Collection<Double>
hashCode
in interface List<Double>
hashCode
in class AbstractList<Double>
Copyright © 2014. All rights reserved.