Object
hdf.object.HObject
hdf.object.Group
hdf.object.h4.H4Group
- All Implemented Interfaces:
MetaDataContainer
,Serializable
An H4Group is a vgroup in HDF4, inheriting from Group.
A vgroup is a structure designed to associate related data objects. The
general structure of a vgroup is similar to that of the UNIX file system in
that the vgroup may contain references to other vgroups or HDF data objects
just as the UNIX directory may contain subdirectories or files.
- Version:
- 1.1 9/4/2007
- Author:
- Peter X. Cao
- See Also:
-
Field Summary
Fields inherited from class hdf.object.Group
CRT_ORDER_INDEXED, CRT_ORDER_TRACKED, LINK_TYPE_EXTERNAL, LINK_TYPE_HARD, LINK_TYPE_SOFT, nMembersInFile, parent
Fields inherited from class hdf.object.HObject
fileFormat, linkTargetObjName, oid, SEPARATOR
-
Constructor Summary
ConstructorDescriptionH4Group
(FileFormat theFile, String name, String path, Group parent) Creates a group object with specific name, path, and parent.H4Group
(FileFormat theFile, String name, String path, Group parent, long[] oid) Creates a group object with specific name, path, parent and oid. -
Method Summary
Modifier and TypeMethodDescriptionvoid
close
(long vgid) close group access.static H4Group
Creates a new group.Retrieves the object's metadata, such as attributes, from the file.getMetadata
(int... attrPropList) Retrieves the object's metadata, such as attributes, from the file.boolean
Check if the object has any attributes attached.long
open()
Opens an existing object such as a dataset or group for access.void
removeMetadata
(Object info) Deletes an existing piece of metadata from this object.void
updateMetadata
(Object info) Updates an existing piece of metadata attached to this object.void
writeMetadata
(Object info) Writes a specific piece of metadata (such as an attribute) into the file.Methods inherited from class hdf.object.Group
addToMemberList, breadthFirstMemberList, clear, depthFirstMemberList, getMember, getMemberList, getNumberOfMembersInFile, getParent, isRoot, removeFromMemberList, setName
Methods inherited from class hdf.object.HObject
createFullname, debug, equals, equals, equalsOID, getFID, getFile, getFileFormat, getFullName, getLinkTargetObjName, getName, getOID, getPath, hashCode, setFullname, setLinkTargetObjName, setPath, toString
-
Constructor Details
-
H4Group
Creates a group object with specific name, path, and parent.- Parameters:
theFile
- the HDF file.name
- the name of this group.path
- the full path of this group.parent
- the parent of this group.
-
H4Group
Creates a group object with specific name, path, parent and oid.- Parameters:
theFile
- the HDF file.name
- the name of this group.path
- the full path of this group.parent
- the parent of this group.oid
- the unique identifier of this data object.
-
-
Method Details
-
hasAttribute
Description copied from interface:MetaDataContainer
Check if the object has any attributes attached.- Returns:
- true if it has any attributes, false otherwise.
-
getMetadata
Retrieves the object's metadata, such as attributes, from the file. Metadata, such as attributes, is stored in a List.- Returns:
- the list of metadata objects.
- Throws:
hdf.hdflib.HDFException
- if the metadata can not be retrieved
-
writeMetadata
Writes a specific piece of metadata (such as an attribute) into the file. If an HDF(4&5) attribute exists in the file, this method updates its value. If the attribute does not exist in the file, it creates the attribute in the file and attaches it to the object. It will fail to write a new attribute to the object where an attribute with the same name already exists. To update the value of an existing attribute in the file, one needs to get the instance of the attribute by getMetadata(), change its values, then use writeMetadata() to write the value.- Parameters:
info
- the metadata to write.- Throws:
Exception
- if the metadata can not be written
-
removeMetadata
Deletes an existing piece of metadata from this object.- Parameters:
info
- the metadata to delete.- Throws:
hdf.hdflib.HDFException
- if the metadata can not be removed
-
updateMetadata
Updates an existing piece of metadata attached to this object.- Parameters:
info
- the metadata to update.- Throws:
Exception
- if the metadata can not be updated
-
open
Description copied from class:HObject
Opens an existing object such as a dataset or group for access. The return value is an object identifier obtained by implementing classes such as H5.H5Dopen(). This function is needed to allow other objects to be able to access the object. For instance, H5File class uses the open() function to obtain object identifier for copyAttributes(long src_id, long dst_id) and other purposes. The open() function should be used in pair with close(long) function. -
close
-
create
Creates a new group.- Parameters:
name
- the name of the group to create.pgroup
- the parent group of the new group.- Returns:
- the new group if successful. Otherwise returns null.
- Throws:
Exception
- if the group can not be created
-
getMetadata
Retrieves the object's metadata, such as attributes, from the file. Metadata, such as attributes, is stored in a List.- Parameters:
attrPropList
- the list of properties to get- Returns:
- the list of metadata objects.
- Throws:
Exception
- if the metadata can not be retrieved
-