public class H5Group extends Group
In HDF5, every object has at least one name. An HDF5 group is used to store a set of the names together in one place, i.e. a group. The general structure of a group is similar to that of the UNIX file system in that the group may contain references to other groups or data objects just as the UNIX directory may contain sub-directories or files.
For more information on HDF5 Groups, HDF5 User's Guide
| Modifier and Type | Field and Description |
|---|---|
protected List |
attributeList
The list of attributes of this data object.
|
CRT_ORDER_INDEXED, CRT_ORDER_TRACKED, LINK_TYPE_EXTERNAL, LINK_TYPE_HARD, LINK_TYPE_SOFT, nMembersInFile, parentfileFormat, linkTargetObjName, oid, separator| Constructor and Description |
|---|
H5Group(FileFormat theFile,
String name,
String path,
Group parent)
Constructs an HDF5 group with specific name, path, and parent.
|
H5Group(FileFormat theFile,
String name,
String path,
Group parent,
long[] oid)
Deprecated.
Not for public use in the future.
Using H5Group(FileFormat, String, String, Group) |
| Modifier and Type | Method and Description |
|---|---|
void |
clear()
Clears up member list and other resources in memory for the group.
|
void |
close(long gid)
Closes access to the object.
|
static H5Group |
create(String name,
Group pgroup,
long... gplist)
Creates a new group with a name in a group and with the group creation
properties specified in gplist.
|
List |
getMetadata()
Retrieves the object's metadata, such as attributes, from the file.
|
List |
getMetadata(int... attrPropList) |
int |
getNumberOfMembersInFile()
Returns the total number of members of this group in file.
|
boolean |
hasAttribute()
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 |
setName(String newName)
Sets the name of the group.
|
void |
setPath(String newPath)
Sets the path of the 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.
|
addToMemberList, breadthFirstMemberList, depthFirstMemberList, getMember, getMemberList, getParent, isRoot, removeFromMemberListdebug, equals, equalsOID, getFID, getFile, getFileFormat, getFullName, getLinkTargetObjName, getName, getOID, getPath, setLinkTargetObjName, toStringprotected List attributeList
public H5Group(FileFormat theFile, String name, String path, Group parent)
theFile - the file which containing the group.name - the name of this group, e.g. "grp01".path - the full path of this group, e.g. "/groups/".parent - the parent of this group.@Deprecated public H5Group(FileFormat theFile, String name, String path, Group parent, long[] oid)
H5Group(FileFormat, String, String, Group)theFile - the file which containing the group.name - the name of this group, e.g. "grp01".path - the full path of this group, e.g. "/groups/".parent - the parent of this group.oid - the oid of this group.public boolean hasAttribute()
MetaDataContainerpublic int getNumberOfMembersInFile()
GroupgetNumberOfMembersInFile() returns the number of objects in this group. The number of objects in memory is obtained by getMemberList().size().
getNumberOfMembersInFile in class Grouppublic void clear()
Grouppublic List getMetadata() throws hdf.hdf5lib.exceptions.HDF5Exception
MetaDataContainerMetadata, such as attributes, is stored in a List.
hdf.hdf5lib.exceptions.HDF5Exceptionpublic List getMetadata(int... attrPropList) throws hdf.hdf5lib.exceptions.HDF5Exception
hdf.hdf5lib.exceptions.HDF5Exceptionpublic void writeMetadata(Object info) throws Exception
MetaDataContainerinfo - the metadata to write.Exception - if the metadata can not be writtenpublic void removeMetadata(Object info) throws hdf.hdf5lib.exceptions.HDF5Exception
MetaDataContainerinfo - the metadata to delete.hdf.hdf5lib.exceptions.HDF5Exceptionpublic void updateMetadata(Object info) throws hdf.hdf5lib.exceptions.HDF5Exception
MetaDataContainerinfo - the metadata to update.hdf.hdf5lib.exceptions.HDF5Exceptionpublic long open()
HObjectopen in class HObjectHObject.close(long)public void close(long gid)
HObjectSub-classes must implement this interface because different data objects have their own ways of how the data resources are closed.
For example, H5Group.close() calls the hdf.hdf5lib.H5.H5Gclose() method and closes the group resource specified by the group id.
public static H5Group create(String name, Group pgroup, long... gplist) throws Exception
The gplist contains a sequence of group creation property list identifiers, lcpl, gcpl, gapl. It allows the user to create a group with group creation properties. It will close the group creation properties specified in gplist.
name - The name of a new group.pgroup - The parent group object.gplist - The group creation properties, in which the order of the
properties conforms the HDF5 library API, H5Gcreate(), i.e.
lcpl, gcpl and gapl, where
Exception - if there is a failure.for the
order of property list identifiers.public void setName(String newName) throws Exception
GroupsetName (String newName) changes the name of the group in memory and file.
setName() updates the path in memory for all the objects that are under the group with the new name.
public void setPath(String newPath) throws Exception
HObjectsetPath() is needed to change the path for an object when the name of a group containing the object is changed by setName(). The path of the object in memory under this group should be updated to the new path to the group. Unlike setName(), setPath() does not change anything in file.
Copyright © 2018. All Rights Reserved.