ncsa.hdf.object.fits
Class FitsGroup

java.lang.Object
  extended by ncsa.hdf.object.HObject
      extended by ncsa.hdf.object.Group
          extended by ncsa.hdf.object.fits.FitsGroup
All Implemented Interfaces:
java.io.Serializable, DataFormat

public class FitsGroup
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.

Version:
1.1 9/4/2007
Author:
Peter X. Cao
See Also:
Serialized Form

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
FitsGroup(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 FitsGroup create(java.lang.String name, Group pgroup)
          Creates a new group.
 java.util.List getMetadata()
          Retrieves the metadata such as attributes from file.
 java.util.List getMetadata(int... attrPropList)
           
 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 attribute from this dataset.
 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, clear, getMemberList, getNumberOfMembersInFile, getParent, isRoot, removeFromMemberList, setName
 
Methods inherited from class ncsa.hdf.object.HObject
equalsOID, getFID, getFile, getFileFormat, getFullName, getLinkTargetObjName, getName, getOID, getPath, setLinkTargetObjName, setPath, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

serialVersionUID

public static final long serialVersionUID
See Also:
Constant Field Values
Constructor Detail

FitsGroup

public FitsGroup(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.
oid - the unique identifier of this data object.
Method Detail

hasAttribute

public boolean hasAttribute()
Description copied from interface: DataFormat
Check if the object has any attributes attached.

Returns:
true if it has any attribute(s), false otherwise.

getMetadata

public java.util.List getMetadata()
                           throws java.lang.Exception
Description copied from interface: DataFormat
Retrieves the metadata such as attributes from file.

Metadata such as attributes are stored in a List.

Returns:
the list of metadata objects.
Throws:
java.lang.Exception

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 java.lang.Exception
Deletes an attribute from this dataset.

Parameters:
info - the attribute to delete.
Throws:
java.lang.Exception

open

public int open()
Description copied from class: HObject
Opens an existing object such as 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(int src_id, int dst_id) and other purposes. The open() function should be used in pair with close(int) function.

Specified by:
open in class HObject
Returns:
the object identifier if successful; otherwise returns a negative value.
See Also:
HObject.close(int)

close

public void close(int gid)
close group access

Specified by:
close in class HObject
Parameters:
gid - The object identifier.

create

public static FitsGroup create(java.lang.String name,
                               Group pgroup)
                        throws java.lang.Exception
Creates a new group.

Parameters:
file - the file which the group is added to.
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

getMetadata

public java.util.List getMetadata(int... attrPropList)
                           throws java.lang.Exception
Throws:
java.lang.Exception