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.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 Summary
Constructors Modifier Constructor Description protected
Dimension(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 void
close()
Free's native TileDB resources associated with the Dimension objectjava.lang.String
domainToStr()
long
getCellValNum()
Retrieves the number of values per cell for the dimension.protected SWIGTYPE_p_tiledb_dimension_t
getDimensionp()
Pair<T,T>
getDomain()
FilterList
getFilterList()
Gets the list of filtes associated with the dimensionjava.lang.String
getName()
T
getTileExtent()
Datatype
getType()
boolean
isVar()
Checks whether the dimension is var-sizedvoid
setCellValNum(long cellValNum)
Sets the number of values per cell for the dimension.Dimension<T>
setFilterList(FilterList filters)
Sets the Dimension FilterList.java.lang.String
tileExtentToStr()
-
-
-
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 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 interfacejava.lang.AutoCloseable
-
-