public class HdfReaderFactory
extends java.lang.Object
The HdfReaderFactory class contains static methods used to read elements from an HDF5 file.
Constructor and Description |
---|
HdfReaderFactory() |
Modifier and Type | Method and Description |
---|---|
static ncsa.hdf.object.h5.H5Group |
getChildH5Group(ncsa.hdf.object.h5.H5Group parentH5Group,
int index)
Returns the child H5Group at the provided index from parentH5Group's
member list.
|
static ncsa.hdf.object.h5.H5Group |
getChildH5Group(ncsa.hdf.object.h5.H5Group parentH5Group,
java.lang.String name)
Returns the child H5Group called name from parentH5Group.
|
static java.util.ArrayList<ncsa.hdf.object.h5.H5Group> |
getChildH5Groups(ncsa.hdf.object.h5.H5Group parentH5Group)
Returns an ArrayList of all child H5Groups from parentH5Group's member
list.
|
static java.util.ArrayList<ncsa.hdf.object.HObject> |
getChildH5Members(ncsa.hdf.object.h5.H5Group parentH5Group)
Returns an ArrayList of all child HObjects from a parentH5Group.
|
static ncsa.hdf.object.Dataset |
getDataset(ncsa.hdf.object.h5.H5Group h5Group,
java.lang.String name)
Returns the Dataset called name from h5Group.
|
static java.lang.Double |
readDoubleAttribute(ncsa.hdf.object.h5.H5Group h5Group,
java.lang.String name)
Reads and returns a Double object read from the Attribute called name
from the metadata for h5Group.
|
static java.lang.Integer |
readIntegerAttribute(ncsa.hdf.object.h5.H5Group h5Group,
java.lang.String name)
Reads and returns an Integer object read from the Attribute called name
from the metadata for h5Group.
|
static java.lang.String |
readStringAttribute(ncsa.hdf.object.h5.H5Group h5Group,
java.lang.String name)
Reads and returns a String object read from the Attribute called name
from the metadata for h5Group.
|
public static ncsa.hdf.object.h5.H5Group getChildH5Group(ncsa.hdf.object.h5.H5Group parentH5Group, java.lang.String name)
Returns the child H5Group called name from parentH5Group. If parentH5Group is null, then null is returned. If name is null or is an empty String, then null is returned. If there is no child H5Group called name, then null is returned.
parentH5Group
- The parent H5Group to search.
name
- The name of the child H5Group.
The child H5Group.
public static ncsa.hdf.object.h5.H5Group getChildH5Group(ncsa.hdf.object.h5.H5Group parentH5Group, int index)
Returns the child H5Group at the provided index from parentH5Group's member list. If parentH5Group is null, then null is returned. If index < 0, then null is returned. If parentH5Group has no children, then null is returned. If the object at located at the provided index is not an H5Group, then null is returned.
parentH5Group
- The parent H5Group to search.
index
- The index of the child H5Group in parentH5Group's member list.
The child H5Group.
public static java.util.ArrayList<ncsa.hdf.object.h5.H5Group> getChildH5Groups(ncsa.hdf.object.h5.H5Group parentH5Group)
Returns an ArrayList of all child H5Groups from parentH5Group's member list. If parentH5Group is null, then null is returned. If parentH5Group has no H5Group children, then an empty ArrayList is returned.
parentH5Group
- The parent H5Group to search.
An ArrayList of child H5Groups.
public static java.util.ArrayList<ncsa.hdf.object.HObject> getChildH5Members(ncsa.hdf.object.h5.H5Group parentH5Group)
parentH5Group
- The parent H5Group to query.public static ncsa.hdf.object.Dataset getDataset(ncsa.hdf.object.h5.H5Group h5Group, java.lang.String name)
Returns the Dataset called name from h5Group. If h5Group is null, then null is returned. If name is null or an empty String, then null is returned. If h5Group has no Datasets, then null is returned. If a Dataset called name can not be located, then null is returned.
h5Group
- The H5Group to search.
name
- The name of the Dataset to search for.
The located Dataset.
public static java.lang.Double readDoubleAttribute(ncsa.hdf.object.h5.H5Group h5Group, java.lang.String name)
Reads and returns a Double object read from the Attribute called name from the metadata for h5Group. If name is null or an empty String, then null is returned. If h5Group is null, then null is returned. If an Attribute called name cannot be located, then null is returned. If the Attribute called name is located but is not of Datatype.CLASS_FLOAT, then null is returned.
h5Group
- The H5Group to read.
name
- The name of the attribute.
The Attribute's value as a Double object.
public static java.lang.Integer readIntegerAttribute(ncsa.hdf.object.h5.H5Group h5Group, java.lang.String name)
Reads and returns an Integer object read from the Attribute called name from the metadata for h5Group. If name is null or an empty String, then null is returned. If h5Group is null, then null is returned. If an Attribute called name cannot be located, then null is returned. If the Attribute called name is located but is not of Datatype.CLASS_INTEGER, then null is returned.
h5Group
- The H5Group to read.
name
- The name of the attribute.
The Attribute's value as an Integer object.
public static java.lang.String readStringAttribute(ncsa.hdf.object.h5.H5Group h5Group, java.lang.String name)
Reads and returns a String object read from the Attribute called name from the metadata for h5Group. If name is null or an empty String, then null is returned. If h5Group is null, then null is returned. If an Attribute called name cannot be located, then null is returned. If the Attribute called name is located but is not of Datatype.CLASS_STRING, then null is returned.
h5Group
- The H5Group to read.
name
- The name of the attribute.
The Attribute's value as a String object.