public class NativeArray
extends java.lang.Object
implements java.lang.AutoCloseable
Modifier | Constructor and Description |
---|---|
protected |
NativeArray(Context ctx,
Datatype nativeType,
SWIGTYPE_p_p_void pointer,
int nelements) |
protected |
NativeArray(Context ctx,
Datatype nativeType,
SWIGTYPE_p_void pointer,
int nelements) |
|
NativeArray(Context ctx,
int size,
java.lang.Class javaType)
Creates an empty native array using a java datatype and a provided size
|
|
NativeArray(Context ctx,
int size,
Datatype nativeType)
Creates an empty native array using a native datatype and a provided size
|
|
NativeArray(Context ctx,
java.lang.Object buffer,
java.lang.Class javaType)
Creates a native array using a java datatype.
|
|
NativeArray(Context ctx,
java.lang.Object buffer,
Datatype nativeType)
Creates a native array using a native datatype.
|
|
NativeArray(Context ctx,
java.lang.Object buffer,
Datatype nativeType,
int size)
Creates a native array using a native datatype.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Free's NativeArray off heap allocated resources
|
java.lang.Object |
getItem(int index)
Returns the item on index position of the native array.
|
java.lang.Class |
getJavaType() |
protected Datatype |
getNativeType() |
int |
getNativeTypeSize() |
long |
getNBytes() |
int |
getSize() |
void |
setItem(int index,
java.lang.Object value)
Sets the item on index position of the native array.
|
long |
toCPointer() |
java.lang.Object |
toJavaArray()
Return a Java array (i.e.
|
java.lang.Object |
toJavaArray(int elements)
Return a Java array (i.e.
|
java.lang.Object |
toJavaArray(int position,
int elements)
Return a Java array (i.e.
|
SWIGTYPE_p_void |
toVoidPointer() |
public NativeArray(Context ctx, int size, Datatype nativeType) throws TileDBError
ctx
- A TileDB contextsize
- Number of array elementsnativeType
- A TileDB datatypeTileDBError
- A TileDB exceptionpublic NativeArray(Context ctx, int size, java.lang.Class javaType) throws TileDBError
ctx
- A TileDB contextsize
- Number of array elementsjavaType
- A Java scalar type classTileDBError
- A TileDB exceptionpublic NativeArray(Context ctx, java.lang.Object buffer, java.lang.Class javaType) throws TileDBError
ctx
- A TileDB contextbuffer
- A Java arrayjavaType
- A Java scalar type classTileDBError
- A TileDB exceptionpublic NativeArray(Context ctx, java.lang.Object buffer, Datatype nativeType, int size) throws TileDBError
ctx
- A TileDB contextbuffer
- A Java arraynativeType
- A TileDB datatypesize
- The array sizeTileDBError
- A TileDB exceptionpublic NativeArray(Context ctx, java.lang.Object buffer, Datatype nativeType) throws TileDBError
ctx
- A TileDB contextbuffer
- A Java arraynativeType
- A TileDB datatypeTileDBError
- A TileDB exceptionprotected NativeArray(Context ctx, Datatype nativeType, SWIGTYPE_p_p_void pointer, int nelements) throws TileDBError
TileDBError
protected NativeArray(Context ctx, Datatype nativeType, SWIGTYPE_p_void pointer, int nelements) throws TileDBError
TileDBError
public java.lang.Object getItem(int index) throws java.lang.ArrayIndexOutOfBoundsException, TileDBError
index
- Index of array scalar to returnTileDBError
- A TileDB exceptionjava.lang.ArrayIndexOutOfBoundsException
public void setItem(int index, java.lang.Object value) throws java.lang.ArrayIndexOutOfBoundsException, TileDBError
index
- array indexvalue
- array value to set at indexTileDBError
- A TileDB exceptionjava.lang.ArrayIndexOutOfBoundsException
public SWIGTYPE_p_void toVoidPointer() throws TileDBError
TileDBError
public long toCPointer() throws TileDBError
TileDBError
public java.lang.Object toJavaArray() throws TileDBError
TileDBError
- A TileDB exceptionpublic java.lang.Object toJavaArray(int elements) throws TileDBError
elements
- number of elements to returnTileDBError
- A TileDB exceptionpublic java.lang.Object toJavaArray(int position, int elements) throws TileDBError
position
- position to start copying fromelements
- number of elements to returnTileDBError
- A TileDB exceptionprotected Datatype getNativeType()
public java.lang.Class getJavaType()
public int getSize()
public int getNativeTypeSize()
public long getNBytes()
public void close()
close
in interface java.lang.AutoCloseable