Package dev.vortex.jni
Class JNIArray
java.lang.Object
dev.vortex.jni.JNIArray
- All Implemented Interfaces:
Array,AutoCloseable
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()org.apache.arrow.vector.VectorSchemaRootexportToArrow(org.apache.arrow.memory.BufferAllocator allocator, org.apache.arrow.vector.VectorSchemaRoot reuse) Export to an ArrowVector.getBigDecimal(int index) Returns the BigDecimal value at the given index.byte[]getBinary(int index) Returns the binary value at the given index as a byte array.booleangetBool(int index) Returns the boolean value at the given index.bytegetByte(int index) Returns the byte value at the given index.Returns the data type of this array.doublegetDouble(int index) Returns the double value at the given index.getField(int index) Returns a child array at the given field index.floatgetFloat(int index) Returns the float value at the given index.intgetInt(int index) Returns the int value at the given index.longgetLen()Returns the number of elements in this array.longgetLong(int index) Returns the long value at the given index.booleangetNull(int index) Returns true if the value at the given index is null.intReturns the total number of null values in this array.shortgetShort(int index) Returns the short value at the given index.getUTF8(int index) Returns the UTF-8 string value at the given index.voidgetUTF8_ptr_len(int index, long[] ptr, int[] len) Returns the UTF-8 string value at the given index as a pointer and length.longnbytes()Returns the total size in bytes of this array including all buffers.slice(int start, int stop) Returns a slice of this array from start (inclusive) to stop (exclusive).
-
Constructor Details
-
JNIArray
public JNIArray(long pointer)
-
-
Method Details
-
getLen
public long getLen()Description copied from interface:ArrayReturns the number of elements in this array. -
nbytes
public long nbytes()Description copied from interface:ArrayReturns the total size in bytes of this array including all buffers. -
exportToArrow
public org.apache.arrow.vector.VectorSchemaRoot exportToArrow(org.apache.arrow.memory.BufferAllocator allocator, org.apache.arrow.vector.VectorSchemaRoot reuse) Description copied from interface:ArrayExport to an ArrowVector. The data will now be owned by the VectorSchemaRoot after this operation.- Specified by:
exportToArrowin interfaceArray
-
getDataType
Description copied from interface:ArrayReturns the data type of this array.- Specified by:
getDataTypein interfaceArray- Returns:
- the DType describing the logical type of this array
-
getField
Description copied from interface:ArrayReturns a child array at the given field index.This is used for accessing fields in struct arrays or elements in list arrays.
-
slice
Description copied from interface:ArrayReturns a slice of this array from start (inclusive) to stop (exclusive). -
getNull
public boolean getNull(int index) Description copied from interface:ArrayReturns true if the value at the given index is null. -
getNullCount
public int getNullCount()Description copied from interface:ArrayReturns the total number of null values in this array.- Specified by:
getNullCountin interfaceArray- Returns:
- the null count
-
getByte
public byte getByte(int index) Description copied from interface:ArrayReturns the byte value at the given index. -
getShort
public short getShort(int index) Description copied from interface:ArrayReturns the short value at the given index. -
getInt
public int getInt(int index) Description copied from interface:ArrayReturns the int value at the given index. -
getLong
public long getLong(int index) Description copied from interface:ArrayReturns the long value at the given index. -
getBool
public boolean getBool(int index) Description copied from interface:ArrayReturns the boolean value at the given index. -
getFloat
public float getFloat(int index) Description copied from interface:ArrayReturns the float value at the given index. -
getDouble
public double getDouble(int index) Description copied from interface:ArrayReturns the double value at the given index. -
getBigDecimal
Description copied from interface:ArrayReturns the BigDecimal value at the given index.- Specified by:
getBigDecimalin interfaceArray- Parameters:
index- the element index- Returns:
- the BigDecimal value
-
getUTF8
Description copied from interface:ArrayReturns the UTF-8 string value at the given index. -
getUTF8_ptr_len
public void getUTF8_ptr_len(int index, long[] ptr, int[] len) Description copied from interface:ArrayReturns the UTF-8 string value at the given index as a pointer and length.This is a low-level method that provides direct access to the underlying string data without copying. The pointer and length are written to the provided arrays.
- Specified by:
getUTF8_ptr_lenin interfaceArray- Parameters:
index- the element indexptr- array to store the pointer (first element will be set)len- array to store the length (first element will be set)
-
getBinary
public byte[] getBinary(int index) Description copied from interface:ArrayReturns the binary value at the given index as a byte array. -
close
public void close()- Specified by:
closein interfaceArray- Specified by:
closein interfaceAutoCloseable
-