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() |
Pair<java.lang.Object,java.lang.Integer> |
getFillValue()
Gets the default fill value for the input attribute.
|
Pair<java.lang.Object,Pair<java.lang.Integer,java.lang.Boolean>> |
getFillValueNullable()
Gets the default fill value for the input, nullable attribute.
|
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
|
void |
setFillValue(NativeArray value,
java.math.BigInteger size)
Sets the default fill value for the input attribute.
|
void |
setFillValue(java.lang.Object value)
Sets the default fill value for the input attribute.
|
void |
setFillValueNullable(NativeArray value,
java.math.BigInteger size,
boolean valid)
Sets the default fill value for the input, nullable attribute.
|
void |
setFillValueNullable(java.lang.Object value,
boolean valid)
Sets the default fill value for the input, nullable attribute.
|
Attribute |
setFilterList(FilterList filters)
Sets the Attribute FilterList.
|
int |
setNullable(boolean isNullable) |
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
TileDBErrorprotected 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 void setFillValue(NativeArray value, java.math.BigInteger size) throws TileDBError
Applicable to var-sized attributes.
value - The fill valuesize - The fill value sizeTileDBErrorpublic void setFillValue(java.lang.Object value)
throws TileDBError
Applicable to var-sized attributes.
value - The fill valueTileDBErrorpublic Pair<java.lang.Object,java.lang.Integer> getFillValue() throws TileDBError
Applicable to both fixed-sized and var-sized attributes.
TileDBErrorpublic void setFillValueNullable(NativeArray value, java.math.BigInteger size, boolean valid) throws TileDBError
value - The fill value to set.size - The fill value size in bytes.valid - The validity fill value, zero for a null value and non-zero for a valid attribute.TileDBErrorpublic void setFillValueNullable(java.lang.Object value,
boolean valid)
throws TileDBError
value - The fill value to set.valid - The validity fill value, zero for a null value and non-zero for a valid attribute.TileDBErrorpublic Pair<java.lang.Object,Pair<java.lang.Integer,java.lang.Boolean>> getFillValueNullable() throws TileDBError
Applicable to both fixed-sized and var-sized attributes.
TileDBErrorpublic int setNullable(boolean isNullable)
throws TileDBError
TileDBErrorpublic java.lang.String toString()
toString in class java.lang.Objectpublic void close()
close in interface java.lang.AutoCloseable