Package io.tiledb.java.api
Class JavaArray
- java.lang.Object
-
- io.tiledb.java.api.JavaArray
-
public class JavaArray extends java.lang.Object
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Objectget()Returns the native Java array as ObjectDatatypegetDataType()Returns the datatypeintgetNumElements()Returns the number of elementsvoidset(int position, byte o)Sets an element to a byte arrayvoidset(int position, byte[] o)Appends the element of the input byte arrayvoidset(int position, double o)Sets an element to a double arrayvoidset(int position, float o)Sets an element to a float arrayvoidset(int position, int o)Sets an element to an int arrayvoidset(int position, long o)Sets an element to a long arrayvoidset(int position, short o)Sets an element to a short array
-
-
-
Constructor Detail
-
JavaArray
public JavaArray(Datatype dt, int numElements) throws TileDBError
Creates an empty JavaArray based on the given Datatype dt.- Parameters:
dt- The DatatypenumElements- The array capacity (number of elements)- Throws:
TileDBError
-
-
Method Detail
-
get
public java.lang.Object get()
Returns the native Java array as Object- Returns:
- The native Java array
-
getNumElements
public int getNumElements()
Returns the number of elements- Returns:
- The number of elements
-
set
public void set(int position, int o) throws java.lang.ArrayIndexOutOfBoundsExceptionSets an element to an int array- Parameters:
position- The positiono- The element- Throws:
java.lang.ArrayIndexOutOfBoundsException
-
set
public void set(int position, long o) throws java.lang.ArrayIndexOutOfBoundsExceptionSets an element to a long array- Parameters:
position- The positiono- The element- Throws:
java.lang.ArrayIndexOutOfBoundsException
-
set
public void set(int position, float o) throws java.lang.ArrayIndexOutOfBoundsExceptionSets an element to a float array- Parameters:
position- The positiono- The element- Throws:
java.lang.ArrayIndexOutOfBoundsException
-
set
public void set(int position, double o) throws java.lang.ArrayIndexOutOfBoundsExceptionSets an element to a double array- Parameters:
position- The positiono- The element- Throws:
java.lang.ArrayIndexOutOfBoundsException
-
set
public void set(int position, byte o) throws java.lang.ArrayIndexOutOfBoundsExceptionSets an element to a byte array- Parameters:
position- The positiono- The element- Throws:
java.lang.ArrayIndexOutOfBoundsException
-
set
public void set(int position, short o) throws java.lang.ArrayIndexOutOfBoundsExceptionSets an element to a short array- Parameters:
position- The positiono- The element- Throws:
java.lang.ArrayIndexOutOfBoundsException
-
set
public void set(int position, byte[] o) throws java.lang.ArrayIndexOutOfBoundsExceptionAppends the element of the input byte array- Parameters:
position- The positiono- The element- Throws:
java.lang.ArrayIndexOutOfBoundsException
-
getDataType
public Datatype getDataType()
Returns the datatype- Returns:
- The Dataype datatype
-
-