public class Attribute
extends java.lang.Object
implements java.lang.AutoCloseable
An Attribute specifies a datatype for a particular parameter in each array cell. There are 3 supported Attribute types:
Context ctx = new Context();
Attribute a1 = new Attribute(ctx,"a1",Integer.class);
Attribute a2 = new Attribute(ctx,"a2",Character.class);
Attribute a3 = new Attribute(ctx,"a3",Float.class);
// Change compression scheme
a1.setFilterList(new FilterList(ctx).addFilter(new LZ4Filter(ctx)));
a2.setCellValNum(TILEDB_VAR_NUM); // Variable sized character attribute (String)
a3.setCellValNum(2); // 2 floats stored per cell
ArraySchema schema = new ArraySchema(ctx, TILEDB_DENSE);
schema.setDomain(domain);
schema.addAttribute(a1);
schema.addAttribute(a2);
schema.addAttribute(a3);
Modifier | Constructor and Description |
---|---|
|
Attribute(Context ctx,
java.lang.String name,
java.lang.Class attrType)
Construct an attribute with a name and java class type.
|
|
Attribute(Context ctx,
java.lang.String name,
Datatype attrType)
Construct an attribute with name and TileDB Datatype.
|
protected |
Attribute(Context ctx,
SWIGTYPE_p_p_tiledb_attribute_t attributepp) |
Modifier and Type | Method and Description |
---|---|
void |
close()
Free's native TileDB resources associated with the Attribute object
|
protected SWIGTYPE_p_tiledb_attribute_t |
getAttributep() |
long |
getCellSize() |
long |
getCellValNum() |
FilterList |
getFilterList()
Gets the list of filtes associated with the attribute
|
java.lang.String |
getName() |
Datatype |
getType() |
boolean |
isVar() |
Attribute |
setCellValNum(long size)
Sets the number of Attribute values per cell.
|
Attribute |
setCellVar()
Sets the Attribute to have variable length cell representation
|
Attribute |
setFilterList(FilterList filters)
Sets the Attribute FilterList.
|
java.lang.String |
toString() |
public Attribute(Context ctx, java.lang.String name, java.lang.Class attrType) throws TileDBError
ctx
- TileDB contextname
- Name of the attributeattrType
- Java class type of the attributeTileDBError
- A TileDB exceptionpublic Attribute(Context ctx, java.lang.String name, Datatype attrType) throws TileDBError
ctx
- TileDB Contextname
- Name of the attributeattrType
- TileDB Datatype of attributeTileDBError
- A TileDB exceptionprotected Attribute(Context ctx, SWIGTYPE_p_p_tiledb_attribute_t attributepp) throws TileDBError
TileDBError
protected SWIGTYPE_p_tiledb_attribute_t getAttributep()
public java.lang.String getName() throws TileDBError
TileDBError
- A TileDB exceptionpublic Datatype getType() throws TileDBError
TileDBError
- A TileDB exceptionpublic long getCellSize() throws TileDBError
TileDBError
- A TileDB exceptionpublic long getCellValNum() throws TileDBError
TileDBError
- A TileDB exceptionpublic boolean isVar() throws TileDBError
TileDBError
- A TileDB exceptionpublic Attribute setCellValNum(long size) throws TileDBError
size
- The number of values per cell. Use TILEDB_VAR_NUM for variable length.TileDBError
- A TileDB exceptionpublic Attribute setCellVar() throws TileDBError
TileDBError
- A TileDB exceptionpublic Attribute setFilterList(FilterList filters) throws TileDBError
filters
- A TileDB FilterListTileDBError
- A TileDB exceptionpublic FilterList getFilterList() throws TileDBError
TileDBError
- A TileDB exceptionpublic java.lang.String toString()
toString
in class java.lang.Object
public void close()
close
in interface java.lang.AutoCloseable