Class JavaArray


  • public class JavaArray
    extends java.lang.Object
    • Constructor Summary

      Constructors 
      Constructor Description
      JavaArray​(Datatype dt, int numElements)
      Creates an empty JavaArray based on the given Datatype dt.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.Object get()
      Returns the native Java array as Object
      Datatype getDataType()
      Returns the datatype
      int getNumElements()
      Returns the number of elements
      void set​(int position, byte o)
      Sets an element to a byte array
      void set​(int position, byte[] o)
      Appends the element of the input byte array
      void set​(int position, double o)
      Sets an element to a double array
      void set​(int position, float o)
      Sets an element to a float array
      void set​(int position, int o)
      Sets an element to an int array
      void set​(int position, long o)
      Sets an element to a long array
      void set​(int position, short o)
      Sets an element to a short array
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • JavaArray

        public JavaArray​(Datatype dt,
                         int numElements)
                  throws TileDBError
        Creates an empty JavaArray based on the given Datatype dt.
        Parameters:
        dt - The Datatype
        numElements - 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 position
        o - 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 position
        o - 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 position
        o - 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 position
        o - 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 position
        o - 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 position
        o - 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 position
        o - The element
        Throws:
        java.lang.ArrayIndexOutOfBoundsException
      • getDataType

        public Datatype getDataType()
        Returns the datatype
        Returns:
        The Dataype datatype