|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectncsa.hdf.object.HObject
ncsa.hdf.object.Group
ncsa.hdf.object.h5.H5Group
public class H5Group
An H5Group object represents an existing HDF5 group in file.
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,
Field Summary | |
---|---|
static long |
serialVersionUID
|
Fields inherited from class ncsa.hdf.object.Group |
---|
CRT_ORDER_INDEXED, CRT_ORDER_TRACKED, LINK_TYPE_EXTERNAL, LINK_TYPE_HARD, LINK_TYPE_SOFT |
Fields inherited from class ncsa.hdf.object.HObject |
---|
separator |
Constructor Summary | |
---|---|
H5Group(FileFormat theFile,
java.lang.String name,
java.lang.String path,
Group parent)
Constructs an HDF5 group with specific name, path, and parent. |
|
H5Group(FileFormat theFile,
java.lang.String name,
java.lang.String path,
Group parent,
long[] oid)
Deprecated. Not for public use in the future. Using H5Group(FileFormat, String, String, Group) |
Method Summary | |
---|---|
void |
clear()
Clears up member list and other resources in memory for the group. |
void |
close(int gid)
Closes access to the object. |
static H5Group |
create(java.lang.String name,
Group pgroup,
int... gplist)
Creates a new group with a name in a group and with the group creation properties specified in gplist. |
java.util.List |
getMetadata()
Retrieves the metadata such as attributes from file. |
java.util.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. |
int |
open()
Opens an existing object such as dataset or group for access. |
void |
removeMetadata(java.lang.Object info)
Deletes an existing metadata from this data object. |
void |
setName(java.lang.String newName)
Sets the name of the group. |
void |
setPath(java.lang.String newPath)
Sets the path of the object. |
void |
writeMetadata(java.lang.Object info)
Writes a specific metadata (such as attribute) into file. |
Methods inherited from class ncsa.hdf.object.Group |
---|
addToMemberList, getMemberList, getParent, isRoot, removeFromMemberList |
Methods inherited from class ncsa.hdf.object.HObject |
---|
equalsOID, getFID, getFile, getFileFormat, getFullName, getLinkTargetObjName, getName, getOID, getPath, setLinkTargetObjName, toString |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final long serialVersionUID
HObject.serialVersionUID
,
Constant Field ValuesConstructor Detail |
---|
public H5Group(FileFormat theFile, java.lang.String name, java.lang.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, java.lang.String name, java.lang.String path, Group parent, long[] oid)
H5Group(FileFormat, String, String, Group)
Method Detail |
---|
public boolean hasAttribute()
DataFormat
public int getNumberOfMembersInFile()
Group
getNumberOfMembersInFile() returns the number of objects in this group. The number of objects in memory is obtained by getMemberList().size().
getNumberOfMembersInFile
in class Group
public void clear()
Group
clear
in class Group
public java.util.List getMetadata() throws HDF5Exception
DataFormat
Metadata such as attributes are stored in a List.
HDF5Exception
public java.util.List getMetadata(int... attrPropList) throws HDF5Exception
HDF5Exception
public void writeMetadata(java.lang.Object info) throws java.lang.Exception
DataFormat
If an HDF(4&5) attribute exists in file, the method updates its value. If the attribute does not exists in file, it creates the attribute in 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 file, one needs to get the instance of the attribute by getMetadata(), change its values, and use writeMetadata() to write the value.
info
- the metadata to write.
java.lang.Exception
public void removeMetadata(java.lang.Object info) throws HDF5Exception
DataFormat
info
- the metadata to delete.
HDF5Exception
public int open()
HObject
open
in class HObject
HObject.close(int)
public void close(int gid)
HObject
Sub-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 ncsa.hdf.hdf5lib.H5.H5Gclose() method and closes the group resource specified by the group id.
close
in class HObject
gid
- The object identifier.public static H5Group create(java.lang.String name, Group pgroup, int... gplist) throws java.lang.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.
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
java.lang.Exception
for the
order of property list identifiers.
public void setName(java.lang.String newName) throws java.lang.Exception
Group
setName (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.
setName
in class Group
newName
- The new name of the group.
java.lang.Exception
public void setPath(java.lang.String newPath) throws java.lang.Exception
HObject
setPath() is needed to change the path for an object when the name of a group conatining 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.
setPath
in class HObject
newPath
- The new path of the object.
java.lang.Exception
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |