- All Known Subinterfaces:
H5Attribute
- All Known Implementing Classes:
FitsAttribute
,H4CompoundAttribute
,H4ScalarAttribute
,H5CompoundAttr
,H5ScalarAttr
,NC2Attribute
public interface Attribute
An interface that provides general attribute operations for object data. For
example, reference to a parent object.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionRetrieves the attribute data from the file.Returns the datatype of the attribute.long[]
Returns the array that contains the dimension sizes of the data value of the attribute.Returns the name of the attribute.int
Returns the selected size of the rows and columns of the attribute.int
Returns the rank (number of dimensions) of the attribute.int
Returns the space type for the attribute.Returns the HObject to which this Attribute is currently "attached".getProperty
(String key) get a property for a given key.get all property keys.boolean
void
Not for public use in the future.void
setParentObject
(HObject pObj) Sets the HObject to which this Attribute is "attached".void
setProperty
(String key, Object value) set a property for the attribute.toAttributeString
(String delimiter) Returns a string representation of the data value.toAttributeString
(String delimiter, int maxItems) Returns a string representation of the data value.void
Writes the memory buffer of this dataset to file.void
writeAttribute
(Object buf) Writes the given data buffer into this attribute in a file.
-
Method Details
-
getParentObject
Returns the HObject to which this Attribute is currently "attached".- Returns:
- the HObject to which this Attribute is currently "attached".
-
setParentObject
Sets the HObject to which this Attribute is "attached".- Parameters:
pObj
- the new HObject to which this Attributet is "attached".
-
setProperty
set a property for the attribute.- Parameters:
key
- the attribute Map keyvalue
- the attribute Map value
-
getProperty
get a property for a given key.- Parameters:
key
- the attribute Map key- Returns:
- the property
-
getPropertyKeys
get all property keys.- Returns:
- the Collection of property keys
-
getAttributeName
Returns the name of the attribute.- Returns:
- The name of the attribute.
-
getAttributeData
Retrieves the attribute data from the file.- Returns:
- the attribute data.
- Throws:
Exception
- if the data can not be retrievedOutOfMemoryError
-
getAttributeDatatype
Returns the datatype of the attribute.- Returns:
- the datatype of the attribute.
-
getAttributeSpaceType
int getAttributeSpaceType()Returns the space type for the attribute. It returns a negative number if it failed to retrieve the type information from the file.- Returns:
- the space type for the attribute.
-
getAttributeRank
int getAttributeRank()Returns the rank (number of dimensions) of the attribute. It returns a negative number if it failed to retrieve the dimension information from the file.- Returns:
- the number of dimensions of the attribute.
-
getAttributeDims
long[] getAttributeDims()Returns the array that contains the dimension sizes of the data value of the attribute. It returns null if it failed to retrieve the dimension information from the file.- Returns:
- the dimension sizes of the attribute.
-
getAttributePlane
int getAttributePlane()Returns the selected size of the rows and columns of the attribute. It returns a negative number if it failed to retrieve the size information from the file.- Returns:
- the selected size of the rows and colums of the attribute.
-
isAttributeScalar
boolean isAttributeScalar()- Returns:
- true if the data is a single scalar point; otherwise, returns false.
-
setAttributeData
Not for public use in the future. setData() is not safe to use because it changes memory buffer of the dataset object. Dataset operations such as write/read will fail if the buffer type or size is changed.- Parameters:
d
- the object data -must be an array of Objects
-
writeAttribute
Writes the memory buffer of this dataset to file.- Throws:
Exception
- if buffer can not be written
-
writeAttribute
Writes the given data buffer into this attribute in a file. The data buffer is a vector that contains the data values of compound fields. The data is written into file as one data blob.- Parameters:
buf
- The vector that contains the data values of compound fields.- Throws:
Exception
- If there is an error at the library level.
-
toAttributeString
Returns a string representation of the data value. For example, "0, 255". For a compound datatype, it will be a 1D array of strings with field members separated by the delimiter. For example, "{0, 10.5}, {255, 20.0}, {512, 30.0}" is a compound attribute of {int, float} of three data points.- Parameters:
delimiter
- The delimiter used to separate individual data points. It can be a comma, semicolon, tab or space. For example, toString(",") will separate data by commas.- Returns:
- the string representation of the data values.
-
toAttributeString
Returns a string representation of the data value. For example, "0, 255". For a compound datatype, it will be a 1D array of strings with field members separated by the delimiter. For example, "{0, 10.5}, {255, 20.0}, {512, 30.0}" is a compound attribute of {int, float} of three data points.- Parameters:
delimiter
- The delimiter used to separate individual data points. It can be a comma, semicolon, tab or space. For example, toString(",") will separate data by commas.maxItems
- The maximum number of Array values to return- Returns:
- the string representation of the data values.
-