org.dawb.hdf5
Interface IHierarchicalDataFile


public interface IHierarchicalDataFile

Having this big interface here is not ideal but is designed to avoid temptation of talking to objects directly in the HierarchicalDataFile which are not thread safe.

Author:
gerring

Field Summary
static int NUMBER_ARRAY
           
static int TEXT
           
 
Method Summary
 void close()
          Must be called to close the file.
 Dataset createDataset(java.lang.String name, Datatype dtype, long[] shape, java.lang.Object buffer, Group data)
          Creates and returns a new dataset with the given name and parent If it already exists then an integer will be appended to the name and it will still be written.
 Dataset createDataset(java.lang.String name, java.lang.String value, Group parent)
          Creates and returns a new dataset with the given name and parent If it already exists then an integer will be appended to the name and it will still be written.
 HObject getData(java.lang.String fullPath)
           
 java.util.List<java.lang.String> getDatasetNames()
           
 java.util.List<java.lang.String> getDatasetNames(int dataType)
          dataType one of NUMBER_ARRAY or TEXT or one of the Datatype.CLASS_* variables.
 java.util.Map<java.lang.String,int[]> getDatasetShapes()
           
 java.util.Map<java.lang.String,java.lang.Integer> getDatasetSizes()
           
 javax.swing.tree.TreeNode getNode()
          Get the root TreeNode
 java.lang.String getPath()
          Return the file path
 Group getRoot()
          Return the root Group
 Group group(java.lang.String name)
          A group at the top level, creating one if it does not exist.
 Group group(java.lang.String name, Group parent)
          A group in this parent, creating one if it does not exist.
 void print()
          Print the full file tree
 void setNexusAttribute(HObject object, java.lang.String attribute)
          Does not set the attribute again if it is already set.
 

Field Detail

NUMBER_ARRAY

static final int NUMBER_ARRAY
See Also:
Constant Field Values

TEXT

static final int TEXT
See Also:
Constant Field Values
Method Detail

close

void close()
           throws java.lang.Exception
Must be called to close the file.

Throws:
java.lang.Exception

getNode

javax.swing.tree.TreeNode getNode()
Get the root TreeNode

Returns:

getPath

java.lang.String getPath()
Return the file path

Returns:

getRoot

Group getRoot()
Return the root Group

Returns:

print

void print()
           throws java.lang.Exception
Print the full file tree

Throws:
java.lang.Exception

getData

HObject getData(java.lang.String fullPath)
                throws java.lang.Exception
Parameters:
fullPath -
Returns:
Throws:
java.lang.Exception

getDatasetNames

java.util.List<java.lang.String> getDatasetNames()
                                                 throws java.lang.Exception
Returns:
Throws:
java.lang.Exception

getDatasetNames

java.util.List<java.lang.String> getDatasetNames(int dataType)
                                                 throws java.lang.Exception
dataType one of NUMBER_ARRAY or TEXT or one of the Datatype.CLASS_* variables.

Returns:
Throws:
java.lang.Exception

getDatasetSizes

java.util.Map<java.lang.String,java.lang.Integer> getDatasetSizes()
                                                                  throws java.lang.Exception
Returns:
Throws:
java.lang.Exception

getDatasetShapes

java.util.Map<java.lang.String,int[]> getDatasetShapes()
                                                       throws java.lang.Exception
Returns:
Throws:
java.lang.Exception

group

Group group(java.lang.String name)
            throws java.lang.Exception
A group at the top level, creating one if it does not exist.

Parameters:
string -
Returns:
Throws:
java.lang.Exception

group

Group group(java.lang.String name,
            Group parent)
            throws java.lang.Exception
A group in this parent, creating one if it does not exist.

Parameters:
string -
Returns:
Throws:
java.lang.Exception

setNexusAttribute

void setNexusAttribute(HObject object,
                       java.lang.String attribute)
                       throws java.lang.Exception
Does not set the attribute again if it is already set.

Parameters:
object -
attribute - one of the values defined in Nexus
Throws:
java.lang.Exception

createDataset

Dataset createDataset(java.lang.String name,
                      java.lang.String value,
                      Group parent)
                      throws java.lang.Exception
Creates and returns a new dataset with the given name and parent If it already exists then an integer will be appended to the name and it will still be written.

Parameters:
name -
value -
Throws:
java.lang.Exception

createDataset

Dataset createDataset(java.lang.String name,
                      Datatype dtype,
                      long[] shape,
                      java.lang.Object buffer,
                      Group data)
                      throws java.lang.Exception
Creates and returns a new dataset with the given name and parent If it already exists then an integer will be appended to the name and it will still be written.

Parameters:
name -
shape -
buffer -
data -
Throws:
java.lang.Exception