public interface DataArray extends Iterable<Double>
double values. Use factory constructors or builders to create
instances of this class.
In addition to iterator() returning the double primitive
specialization PrimitiveIterator.OfDouble implementations of this interface provide
streaming support via stream() and parallelStream(), both
of which return the double primitive specialization,
DoubleStream. Note that traditional iteration will incur additional
autoboxing overhead.
| Modifier and Type | Interface and Description |
|---|---|
static class |
DataArray.Builder
A
DataArray builder. |
| Modifier and Type | Method and Description |
|---|---|
static DataArray.Builder |
builderWithData(double... data)
Return a new
DataArray Builder initialized with
data. |
static DataArray.Builder |
builderWithData(Iterable<Double> data)
Return a new
DataArray Builder initialized with
Iterable<Double>. |
static DataArray.Builder |
builderWithSize(int size)
Return a new
DataArray Builder initialized to size. |
static DataArray |
copyOf(double... data)
Create a new
DataArray from the supplied data. |
static DataArray |
copyOf(Iterable<Double> data)
Create a new
DataArray from an Iterable<Double>. |
double |
get(int index)
Return a
double at index. |
default PrimitiveIterator.OfDouble |
iterator()
Return a double iterator.
|
default DoubleStream |
parallelStream()
Return a parallel
DoubleStream of the DataArray. |
int |
size()
Return the number of elements in
DataArray. |
Spliterator.OfDouble |
spliterator()
Returns a
Spliterator.ofDouble Spliterator. |
default DoubleStream |
stream()
Return a sequential
DoubleStream of the DataArray. |
double[] |
toArray()
Returns a new, mutable copy of the
DataArray's values as a
primitive double[]. |
default PrimitiveIterator.OfDouble iterator()
Spliterator.OfDouble spliterator()
Spliterator.ofDouble Spliterator.spliterator in interface Iterable<Double>double get(int index)
double at index.index - of the value to getdouble at position indexint size()
DataArray.int The size of DataArraydouble[] toArray()
DataArray's values as a
primitive double[].double[]default DoubleStream parallelStream()
DoubleStream of the DataArray.DoubleStreamdefault DoubleStream stream()
DoubleStream of the DataArray.DoubleStreamstatic DataArray copyOf(double... data)
DataArray from the supplied data.data - to copyDataArraystatic DataArray copyOf(Iterable<Double> data)
DataArray from an Iterable<Double>.data - to copyDataArraystatic DataArray.Builder builderWithData(double... data)
DataArray Builder initialized with
data.data - to copyBuilderstatic DataArray.Builder builderWithData(Iterable<Double> data)
DataArray Builder initialized with
Iterable<Double>.data - to copyBuilder.static DataArray.Builder builderWithSize(int size)
DataArray Builder initialized to size.size - of the backing arrayBuilder