Object
hdf.object.HObject
hdf.object.Group
hdf.object.nc2.NC2Group
- All Implemented Interfaces:
MetaDataContainer
,Serializable
An NC2Group represents NetCDF3 group, inheriting from Group. Every NetCDF3 object
has at least one name. An NetCDF3 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:
-
Field Summary
Modifier and TypeFieldDescriptionprotected ucar.nc2.Group
The corresponding netcdf Group for this group.Fields inherited from class hdf.object.Group
CRT_ORDER_INDEXED, CRT_ORDER_TRACKED, LINK_TYPE_EXTERNAL, LINK_TYPE_HARD, LINK_TYPE_SOFT, nMembersInFile, parent
Fields inherited from class hdf.object.HObject
fileFormat, linkTargetObjName, oid, SEPARATOR
-
Constructor Summary
ConstructorDescriptionNC2Group
(FileFormat fileFormat, String name, String path, Group parent, long[] theID) Constructs an NC2 group with specific name, path, and parent. -
Method Summary
Modifier and TypeMethodDescriptionvoid
close
(long gid) Close a group.static NC2Group
Creates a new group.Retrieves the object's metadata, such as attributes, from the file.getMetadata
(int... attrPropList) Retrieves the object's metadata, such as attributes, from the file.ucar.nc2.Group
boolean
Check if the object has any attributes attached.boolean
netcdfAttributeString
(int index) Retrieves the attribute name.netcdfDimensionString
(int index) Retrieves the Dimension name.netcdfTypedefString
(int index) Retrieves the EnumTypedef name.long
open()
open a group.void
removeMetadata
(Object info) Deletes an attribute from this dataset.void
setNetCDFGroup
(ucar.nc2.Group netCDFGroup) Set the corresponding netcdf Group for this group.void
updateMetadata
(Object info) Updates an attribute from this dataset.void
writeMetadata
(Object info) Creates a new attribute and attached to this dataset if attribute does not exist.Methods inherited from class hdf.object.Group
addToMemberList, breadthFirstMemberList, clear, depthFirstMemberList, getMember, getMemberList, getNumberOfMembersInFile, getParent, isRoot, removeFromMemberList, setName
Methods inherited from class hdf.object.HObject
createFullname, debug, equals, equals, equalsOID, getFID, getFile, getFileFormat, getFullName, getLinkTargetObjName, getName, getOID, getPath, hashCode, setFullname, setLinkTargetObjName, setPath, toString
-
Field Details
-
netCDFGroup
The corresponding netcdf Group for this group.
-
-
Constructor Details
-
NC2Group
Constructs an NC2 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.theID
- the unique identifier of this data object.
-
-
Method Details
-
getNetCDFGroup
- Returns:
- the corresponding netcdf Group for this group.
-
setNetCDFGroup
Set the corresponding netcdf Group for this group.- Parameters:
netCDFGroup
- the ucar.nc2.Group to associate to this group
-
hasAttribute
Check if the object has any attributes attached.- Returns:
- true if it has any attributes, false otherwise.
-
hasDimension
- Returns:
- true if this group has an attached dimension.
-
getMetadata
Retrieves the object's metadata, such as attributes, from the file. Metadata, such as attributes, is stored in a List.- Returns:
- the list of metadata objects.
- Throws:
Exception
- if the metadata can not be retrieved
-
writeMetadata
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 attribute to attach- Throws:
Exception
- if there is an error
-
removeMetadata
Deletes an attribute from this dataset.- Parameters:
info
- the attribute to delete.- Throws:
Exception
- if there is an error
-
updateMetadata
Updates an attribute from this dataset.- Parameters:
info
- the attribute to update.- Throws:
Exception
- if there is an error
-
open
open a group. -
close
Close a group. -
create
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:
Exception
- if there is an error
-
getMetadata
Retrieves the object's metadata, such as attributes, from the file. Metadata, such as attributes, is stored in a List.- Parameters:
attrPropList
- the list of properties to get- Returns:
- the list of metadata objects.
- Throws:
Exception
- if the metadata can not be retrieved
-
netcdfAttributeString
Retrieves the attribute name.- Parameters:
index
- the index of the attribute to get- Returns:
- the attribute string.
-
netcdfDimensionString
Retrieves the Dimension name.- Parameters:
index
- the index of the Dimension to get- Returns:
- the Dimension string.
-
netcdfTypedefString
Retrieves the EnumTypedef name.- Parameters:
index
- the index of the EnumTypedef to get- Returns:
- the EnumTypedef string.
-