public class Domain
extends java.lang.Object
implements java.lang.AutoCloseable
Example:
Context ctx = new Context();
Domain domain = new Domain(ctx);
// Note the dimension bounds are inclusive.
Dimension<Integer> d1 = new Dimension<Integer>(ctx, "d1", Integer.class, new Pair<Integer, Integer>(-10, 10), 1);
Dimension<Long> d2 = new Dimension<Long>(ctx, "d2", Long.class, new Pair<Long, Long>(1l, 10l), 1l);
Dimension<Integer> d3 = new Dimension<Integer>(ctx, "d3", Integer.class, new Pair<Integer, Integer>(-100, 100), 10);
domain.addDimension(d1);
domain.addDimension(d2); // Throws error, all dims must be same type
domain.addDimension(d3);
domain.getType(); // TILEDB_INT32, determined from the dimensions
domain.getRank(); // 2, d1 and d3
ArraySchema schema = new ArraySchema(ctx, TILEDB_SPARSE);
schema.setDomain(domain); // Set the array's domain
Modifier | Constructor and Description |
---|---|
|
Domain(Context ctx) |
protected |
Domain(Context ctx,
SWIGTYPE_p_p_tiledb_domain_t domainpp) |
Modifier and Type | Method and Description |
---|---|
Domain |
addDimension(Dimension dimension)
Adds a new dimension to the domain.
|
void |
addDimensions(java.util.Collection<Dimension> dims)
Adds multiple Dimensions.
|
void |
close()
Free's native TileDB resources associated with the Domain object
|
void |
dump()
Dumps the Domain in an ASCII representation to stdout.
|
void |
dump(java.lang.String filename)
Dumps the Domain in an ASCII representation to stdout.
|
Dimension |
getDimension(java.lang.Integer idx)
Retrieves a Dimension Object from a Domain by index
|
Dimension |
getDimension(java.lang.Long idx)
Retrieves a Dimension Object from a Domain by index
|
Dimension |
getDimension(java.lang.String name)
Retrieves a Dimension Object from a Domain by name / label
|
java.util.List<Dimension> |
getDimensions() |
protected SWIGTYPE_p_tiledb_domain_t |
getDomainp() |
long |
getNDim() |
long |
getRank() |
Datatype |
getType() |
boolean |
hasDimension(java.lang.String name)
Checks if the Domain has the given dimension with name
|
protected Domain(Context ctx, SWIGTYPE_p_p_tiledb_domain_t domainpp)
public Domain(Context ctx) throws TileDBError
TileDBError
protected SWIGTYPE_p_tiledb_domain_t getDomainp()
public void dump() throws TileDBError
TileDBError
- A TileDB exceptionpublic void dump(java.lang.String filename) throws TileDBError
filename
- A string filenameTileDBError
- A TileDB exceptionpublic Datatype getType() throws TileDBError
TileDBError
- A TileDB exceptionpublic long getRank() throws TileDBError
TileDBError
- A TileDB exceptionpublic long getNDim() throws TileDBError
TileDBError
- A TileDB exceptionpublic java.util.List<Dimension> getDimensions() throws TileDBError
TileDBError
- A TileDB exceptionpublic boolean hasDimension(java.lang.String name) throws TileDBError
name
- Name of the dimension in the domainTileDBError
public Dimension getDimension(java.lang.String name) throws TileDBError
name
- The name of the domain dimensionTileDBError
public Dimension getDimension(java.lang.Long idx) throws TileDBError
idx
- The index of the domain dimensionTileDBError
public Dimension getDimension(java.lang.Integer idx) throws TileDBError
idx
- The index of the domain dimensionTileDBError
public Domain addDimension(Dimension dimension) throws TileDBError
dimension
- The Dimension object to be added.TileDBError
- A TileDB exceptionpublic void addDimensions(java.util.Collection<Dimension> dims) throws TileDBError
dims
- A list of Dimension objects to be added.TileDBError
- A TileDB exceptionpublic void close()
close
in interface java.lang.AutoCloseable