ncsa.hdf.object.h4
Class H4Group

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

public class H4Group
extends Group

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.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class ncsa.hdf.object.HObject
hasAttribute, oid, separator
 
Constructor Summary
H4Group(FileFormat fileFormat, java.lang.String name, java.lang.String path, Group parent)
           
H4Group(FileFormat fileFormat, java.lang.String name, java.lang.String path, Group parent, long[] theID)
          Creates a group object with specific name, path, and parent.
 
Method Summary
 void close(int vgid)
          close group access.
static H4Group 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 existing metadata from this data object.
 void writeMetadata(java.lang.Object info)
          Saves a specific metadata into file.
 
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, setName, setPath, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

H4Group

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

H4Group

public H4Group(FileFormat fileFormat,
               java.lang.String name,
               java.lang.String path,
               Group parent,
               long[] theID)
Creates a group object with specific name, path, and parent.

Parameters:
fileFormat - the HDF file.
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 HDFException
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:
HDFException
See Also:
List

writeMetadata

public void writeMetadata(java.lang.Object info)
                   throws java.lang.Exception
Description copied from interface: DataFormat
Saves a specific metadata into file. If the metadata exists, it updates its value. If the metadata does not exists, it creates and attach the new metadata to the object and saves it into file.

Parameters:
info - the specific metadata.
Throws:
java.lang.Exception

removeMetadata

public void removeMetadata(java.lang.Object info)
                    throws HDFException
Description copied from interface: DataFormat
Deletes an existing metadata from this data object.

Parameters:
info - the metadata to delete.
Throws:
HDFException

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 vgid)
close group access.

Specified by:
close in class HObject
Parameters:
vgid - 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 H4Group 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