Class Dimension<T>

  • All Implemented Interfaces:
    java.lang.AutoCloseable

    public class Dimension<T>
    extends java.lang.Object
    implements java.lang.AutoCloseable
    Describes one dimension of an Array. The dimension consists of a type, lower and upper bound, and tile-extent describing the memory ordering. Dimensions are added to a Domain.

    Example:

    
     Context ctx = new Context();
     Domain domain = new Domain(ctx);
     // Create a dimension with inclusive domain [0,1000] and tile extent 100.
     Dimension<Integer> d = new Dimension<Integer>(ctx, "d", Integer.class, new Pair<Integer, Integer>(0, 1000), 100);
     domain.addDimension(d);
     
    • Constructor Detail

      • Dimension

        protected Dimension​(Context ctx,
                            SWIGTYPE_p_p_tiledb_dimension_t dimensionpp)
        Constructor from native object
        Parameters:
        ctx - A TileDB context
        dimensionpp - A Swig wrapper object to a tiledb_dimension_t pointer
      • Dimension

        public Dimension​(Context ctx,
                         java.lang.String name,
                         java.lang.Class<T> type,
                         Pair<T,​T> domain,
                         T extent)
                  throws TileDBError
        Constructor for creating a new dimension with java type class
        Parameters:
        ctx - The TileDB context.
        name - The dimension name.
        type - The Dimension Java scalar type class
        domain - The dimension domain (A Pair containing the lower and upper bound).
        extent - The tile extent on the dimension.
        Throws:
        TileDBError - A TileDB exception
      • Dimension

        public Dimension​(Context ctx,
                         java.lang.String name,
                         Datatype type,
                         Pair<T,​T> domain,
                         T extent)
                  throws TileDBError
        Constructor for creating a new dimension with TileDB Datatype
        Parameters:
        ctx - A TileDB context
        name - A dimension name
        type - The dimension Datatype
        domain - A dimension domain (A Pair containing lower and upper bound).
        extent - The tiledb extent on the dimension.
        Throws:
        TileDBError - A TileDB exception.
    • Method Detail

      • getName

        public java.lang.String getName()
                                 throws TileDBError
        Returns:
        The String name of the dimension.
        Throws:
        TileDBError - A TileDB exception
      • getDomain

        public Pair<T,​T> getDomain()
                                  throws TileDBError
        Returns:
        The domain of the dimension (A Pair containing the lower and upper bound).
        Throws:
        TileDBError - A TileDB exception
      • domainToStr

        public java.lang.String domainToStr()
                                     throws TileDBError
        Returns:
        A string representation of the domain.
        Throws:
        TileDBError - A TileDB exception
      • getTileExtent

        public T getTileExtent()
                        throws TileDBError
        Returns:
        The tile extent of the dimension.
        Throws:
        TileDBError - A TileDB exception
      • getFilterList

        public FilterList getFilterList()
                                 throws TileDBError
        Gets the list of filtes associated with the dimension
        Returns:
        A FilterList instance
        Throws:
        TileDBError - A TileDB exception
      • setCellValNum

        public void setCellValNum​(long cellValNum)
                           throws TileDBError
        Sets the number of values per cell for the dimension.
        Parameters:
        cellValNum - The number of values per cell
        Throws:
        TileDBError - TileDBError A TileDB error
      • getCellValNum

        public long getCellValNum()
                           throws TileDBError
        Retrieves the number of values per cell for the dimension.
        Returns:
        The number of values per cell
        Throws:
        TileDBError - TileDBError A TileDB error
      • isVar

        public boolean isVar()
                      throws TileDBError
        Checks whether the dimension is var-sized
        Returns:
        True if the dimension is var-sized (e.g. String) and False otherwise
        Throws:
        TileDBError - A TileDB error
      • tileExtentToStr

        public java.lang.String tileExtentToStr()
                                         throws TileDBError
        Returns:
        A string representation of the extent.
        Throws:
        TileDBError - A TileDB exception
      • close

        public void close()
        Free's native TileDB resources associated with the Dimension object
        Specified by:
        close in interface java.lang.AutoCloseable