Package io.trino.array
Class DoubleBigArray
java.lang.Object
io.trino.array.DoubleBigArray
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a new big array containing one initial segmentDoubleBigArray(double initialValue) Creates a new big array containing one initial segment filled with the specified default value -
Method Summary
Modifier and TypeMethodDescriptionvoidadd(long index, double value) Adds the specified value to the specified element of this big array.voidcopyTo(long sourceIndex, DoubleBigArray destination, long destinationIndex, long length) Copies this array, beginning at the specified sourceIndex, to the specified destinationIndex of the destination array.voidensureCapacity(long length) Ensures this big array is at least the specified length.voidfill(double value) Fills the entire big array with the specified value.doubleget(long index) Returns the element of this big array at specified index.voidset(long index, double value) Sets the element of this big array at specified index.longsizeOf()Returns the size of this big array in bytes.
-
Constructor Details
-
DoubleBigArray
public DoubleBigArray()Creates a new big array containing one initial segment -
DoubleBigArray
public DoubleBigArray(double initialValue) Creates a new big array containing one initial segment filled with the specified default value
-
-
Method Details
-
sizeOf
public long sizeOf()Returns the size of this big array in bytes. -
get
public double get(long index) Returns the element of this big array at specified index.- Parameters:
index- a position in this big array.- Returns:
- the element of this big array at the specified position.
-
set
public void set(long index, double value) Sets the element of this big array at specified index.- Parameters:
index- a position in this big array.
-
add
public void add(long index, double value) Adds the specified value to the specified element of this big array.- Parameters:
index- a position in this big array.value- the value
-
ensureCapacity
public void ensureCapacity(long length) Ensures this big array is at least the specified length. If the array is smaller, segments are added until the array is larger then the specified length. -
fill
public void fill(double value) Fills the entire big array with the specified value. -
copyTo
public void copyTo(long sourceIndex, DoubleBigArray destination, long destinationIndex, long length) Copies this array, beginning at the specified sourceIndex, to the specified destinationIndex of the destination array. A subsequence of this array's components are copied to the destination array referenced bydestination. The number of components copied is equal to thelengthargument. The components at positionssourceIndexthroughsourceIndex+length-1in this array are copied into positionsdestinationIndexthroughdestinationIndex+length-1, respectively, of the destination array.
-