ncsa.hdf.object.h5
Class H5Group

java.lang.Object
  extended byncsa.hdf.object.HObject
      extended byncsa.hdf.object.Group
          extended byncsa.hdf.object.h5.H5Group
All Implemented Interfaces:
DataFormat, java.io.Serializable

public class H5Group
extends Group

An H5Group represents HDF5 group, inheriting from Group. Every HDF5 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 subdirectories or files.

See Also:
Serialized Form

Field Summary
static long[] DEFAULT_OID
          The default object ID for HDF5 objects
 
Fields inherited from class ncsa.hdf.object.HObject
hasAttribute, oid, separator
 
Constructor Summary
H5Group(FileFormat fileFormat, java.lang.String name, java.lang.String path, Group parent)
           
H5Group(FileFormat fileFormat, java.lang.String name, java.lang.String path, Group parent, long[] theID)
          Constructs an HDF5 group with specific name, path, and parent.
 
Method Summary
 void close(int gid)
          close group access
static H5Group create(java.lang.String name, Group pgroup)
          Creates a new group.
 java.util.List getMetadata()
          Loads the metadata such as attributes and type of the the data object into memory if the metadata is not loaded.
 int open()
          Opens access to this object.
 void removeMetadata(java.lang.Object info)
          Deletes an attribute from this dataset.
 void setName(java.lang.String newName)
          Sets the name of the data object.
 void setPath(java.lang.String newPath)
          Sets the path of the data object.
 void writeMetadata(java.lang.Object info)
          Creates a new attribute and attached to this dataset if attribute does not exist.
 
Methods inherited from class ncsa.hdf.object.Group
addToMemberList, getMemberList, getNumberOfMembersInFile, getParent, isRoot, removeFromMemberList, setNumberOfMembersInFile
 
Methods inherited from class ncsa.hdf.object.HObject
equalsOID, getFID, getFile, getFileFormat, getName, getOID, getPath, hasAttribute, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DEFAULT_OID

public static final long[] DEFAULT_OID
The default object ID for HDF5 objects

Constructor Detail

H5Group

public H5Group(FileFormat fileFormat,
               java.lang.String name,
               java.lang.String path,
               Group parent)

H5Group

public H5Group(FileFormat fileFormat,
               java.lang.String name,
               java.lang.String path,
               Group parent,
               long[] theID)
Constructs an HDF5 group with specific name, path, and parent.

Parameters:
fileFormat - the file which containing the group.
name - the name of this group.
path - the full path of this group.
parent - the parent of this group.
Method Detail

getMetadata

public java.util.List getMetadata()
                           throws HDF5Exception
Description copied from interface: DataFormat
Loads the metadata such as attributes and type of the the data object into memory if the metadata is not loaded. If the metadata is loaded, it returns the metadata. The metadata is stored as a collection of metadata ojbects in a List.

Returns:
the list of metadata objects.
Throws:
HDF5Exception
See Also:
List

writeMetadata

public void writeMetadata(java.lang.Object info)
                   throws java.lang.Exception
Creates a new attribute and attached to this dataset if attribute does not exist. Otherwise, just update the value of the attribute.

Parameters:
info - the atribute to attach
Throws:
java.lang.Exception

removeMetadata

public void removeMetadata(java.lang.Object info)
                    throws HDF5Exception
Deletes an attribute from this dataset.

Parameters:
info - the attribute to delete.
Throws:
HDF5Exception

open

public int open()
Description copied from class: HObject
Opens access to this object.

Sub-classes have to implement this interface so that different data objects have their own ways of how the data resources are opened.

Specified by:
open in class HObject
Returns:
the interface identifier for access this object.

close

public void close(int gid)
close group access

Specified by:
close in class HObject
Parameters:
gid - the object identifier. Sub-classes have to implement this interface so that different data objects have their own ways of how the data resources are closed.

create

public static H5Group create(java.lang.String name,
                             Group pgroup)
                      throws java.lang.Exception
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:
java.lang.Exception

setName

public void setName(java.lang.String newName)
             throws java.lang.Exception
Sets the name of the data object.

Overrides:
setName in class HObject
Parameters:
newName - the new name of the object.
Throws:
java.lang.Exception

setPath

public void setPath(java.lang.String newPath)
             throws java.lang.Exception
Sets the path of the data object.

Overrides:
setPath in class HObject
Parameters:
newPath - the new path of the object.
Throws:
java.lang.Exception