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.Object
get()
Returns the native Java array as ObjectDatatype
getDataType()
Returns the datatypeint
getNumElements()
Returns the number of elementsvoid
set(int position, byte o)
Sets an element to a byte arrayvoid
set(int position, byte[] o)
Appends the element of the input byte arrayvoid
set(int position, double o)
Sets an element to a double arrayvoid
set(int position, float o)
Sets an element to a float arrayvoid
set(int position, int o)
Sets an element to an int arrayvoid
set(int position, long o)
Sets an element to a long arrayvoid
set(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.ArrayIndexOutOfBoundsException
Sets 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.ArrayIndexOutOfBoundsException
Sets 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.ArrayIndexOutOfBoundsException
Sets 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.ArrayIndexOutOfBoundsException
Sets 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.ArrayIndexOutOfBoundsException
Sets 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.ArrayIndexOutOfBoundsException
Sets 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.ArrayIndexOutOfBoundsException
Appends 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
-
-