Class DoubleAccumulator
java.lang.Object
io.datarouter.bytes.primitivelist.accumulator.DoubleAccumulator
Accumulates a large quantity of primitive doubles.
Stores them in paged primitive double arrays.
Avoids a large resizing (usually doubling) of the backing array.
Not thread safe.
This could be promoted to datarouter, but we'd want to improve performance using bit shifting.
It could also be enhanced into a PrimitiveDoubleList, but would need support for more operations, more tests.
-
Constructor Details
-
DoubleAccumulator
public DoubleAccumulator() -
DoubleAccumulator
public DoubleAccumulator(int requestedPageSize)
-
-
Method Details
-
add
public void add(double value) -
addMulti
public void addMulti(double[] values) -
addAll
-
set
public double set(int index, double value) -
isEmpty
public boolean isEmpty() -
size
public int size() -
get
public double get(int index) -
toPrimitiveArray
public double[] toPrimitiveArray() -
stream
-
iterator
-