Package io.tiledb.java.api
Class Dimension<T>
- java.lang.Object
-
- io.tiledb.java.api.Dimension<T>
-
- All Implemented Interfaces:
java.lang.AutoCloseable
public class Dimension<T> extends java.lang.Object implements java.lang.AutoCloseableDescribes 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 Summary
Constructors Modifier Constructor Description protectedDimension(Context ctx, SWIGTYPE_p_p_tiledb_dimension_t dimensionpp)Constructor from native objectDimension(Context ctx, java.lang.String name, Datatype type, Pair<T,T> domain, T extent)Constructor for creating a new dimension with TileDB DatatypeDimension(Context ctx, java.lang.String name, java.lang.Class<T> type, Pair<T,T> domain, T extent)Constructor for creating a new dimension with java type class
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Free's native TileDB resources associated with the Dimension objectjava.lang.StringdomainToStr()longgetCellValNum()Retrieves the number of values per cell for the dimension.protected SWIGTYPE_p_tiledb_dimension_tgetDimensionp()Pair<T,T>getDomain()FilterListgetFilterList()Gets the list of filtes associated with the dimensionjava.lang.StringgetName()TgetTileExtent()DatatypegetType()booleanisVar()Checks whether the dimension is var-sizedvoidsetCellValNum(long cellValNum)Sets the number of values per cell for the dimension.Dimension<T>setFilterList(FilterList filters)Sets the Dimension FilterList.java.lang.StringtileExtentToStr()
-
-
-
Constructor Detail
-
Dimension
protected Dimension(Context ctx, SWIGTYPE_p_p_tiledb_dimension_t dimensionpp)
Constructor from native object- Parameters:
ctx- A TileDB contextdimensionpp- 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 classdomain- 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 contextname- A dimension nametype- The dimension Datatypedomain- A dimension domain (A Pair containing lower and upper bound).extent- The tiledb extent on the dimension.- Throws:
TileDBError- A TileDB exception.
-
-
Method Detail
-
getDimensionp
protected SWIGTYPE_p_tiledb_dimension_t getDimensionp()
-
getName
public java.lang.String getName() throws TileDBError- Returns:
- The String name of the dimension.
- Throws:
TileDBError- A TileDB exception
-
getType
public Datatype getType() throws TileDBError
- Returns:
- The dimension datatype.
- 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
-
setFilterList
public Dimension<T> setFilterList(FilterList filters) throws TileDBError
Sets the Dimension FilterList.- Parameters:
filters- A TileDB FilterList- Throws:
TileDBError- A TileDB exception
-
setCellValNum
public void setCellValNum(long cellValNum) throws TileDBErrorSets 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 TileDBErrorRetrieves 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 TileDBErrorChecks 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:
closein interfacejava.lang.AutoCloseable
-
-