Package hdf.object.h5

Class H5File

Object
File
hdf.object.FileFormat
hdf.object.h5.H5File
All Implemented Interfaces:
Serializable, Comparable<File>

public class H5File extends FileFormat
H5File is an implementation of the FileFormat class for HDF5 files. The HDF5 file structure is made up of HObjects stored in a tree-like fashion. Each tree node represents an HDF5 object: a Group, Dataset, or Named Datatype. Starting from the root of the tree, rootObject, the tree can be traversed to find a specific object. The following example shows the implementation of finding an object for a given path in FileFormat. User applications can directly call the static method FileFormat.findObject(file, objPath) to get the object.
 HObject findObject(FileFormat file, String path) {
     if (file == null || path == null)
         return null;
     if (!path.endsWith("/"))
         path = path + "/";
     HObject theRoot = file.getRootObject();
     if (theRoot == null)
         return null;
     else if (path.equals("/"))
         return theRoot;

     Iterator local_it = ((Group) theRoot)
             .breadthFirstMemberList().iterator();
     HObject theObj = null;
     while (local_it.hasNext()) {
         theObj = local_it.next();
         String fullPath = theObj.getFullName() + "/";
         if (path.equals(fullPath) &&  theObj.getPath() != null ) {
             break;
     }
     return theObj;
 }
 
Version:
2.4 9/4/2007
Author:
Peter X. Cao
See Also: