|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectncsa.hdf.object.Attribute
An attribute is a (name, value) pair metadata that are attached to primary datasets and groups. The value field can be a scalar data point or an arrya of native datatype or compound data type.
The following is an example of how to create an attribute of one dimension integer array of size two.
// Create an attribute String name = "data range"; Datatype type = new Datatype(Datatype.CLASS_INTEGER, Datatype.NATIVE, Datatype.NATIVE, Datatype.NATIVE); long[] space = {2}; int[] value = {0, 255}; Attribute dataRange = new Attribute(name, type, space); dataRange.setValue(value);
Datatype
,
Serialized FormField Summary | |
static int |
DEFAULT_STRING_ATTRIBUTE_LENGTH
the default length of a string attribute |
Constructor Summary | |
Attribute(java.lang.String attrName,
Datatype attrType,
long[] attrDims)
Create an attribute with specified name, data type and dimension sizes. |
Method Summary | |
long[] |
getDataDims()
Returns the dimension sizes of the data value of this attribute. |
java.lang.String |
getName()
Returns the name of this attribute. |
int |
getRank()
Returns the rank of the data value of this attribute. |
Datatype |
getType()
Returns the datatype of the attribute. |
java.lang.Object |
getValue()
Returns the value of this attriubte from file. |
boolean |
isUnsigned()
Check the data type of the attribute is unsigned. |
void |
setValue(java.lang.Object theValue)
Sets the value of this attribute. |
java.lang.String |
toString()
Returns the string representation of this attribute. |
java.lang.String |
toString(java.lang.String delimiter)
Returns the string representation of the value of this attribute. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final int DEFAULT_STRING_ATTRIBUTE_LENGTH
Constructor Detail |
public Attribute(java.lang.String attrName, Datatype attrType, long[] attrDims)
Datatype
Method Detail |
public java.lang.Object getValue()
getValue
in interface Metadata
public void setValue(java.lang.Object theValue)
setValue
in interface Metadata
public java.lang.String getName()
public int getRank()
public long[] getDataDims()
public Datatype getType()
public boolean isUnsigned()
public java.lang.String toString(java.lang.String delimiter)
delimiter
- the delimiter to separate individual data points.public java.lang.String toString()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |