public interface IHDF5SimpleReader
extends java.io.Closeable
IHDF5Reader
, then assign the reader to a IHDF5SimpleReader
variable and let
the code completion of your IDE help you find the method you are looking for.
Usage:
IHDF5SimpleReader reader = HDF5FactoryProvider.get().openForReading(new File("test.h5")); float[] f = reader.readFloatArray("/some/path/dataset"); reader.close();
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes this object and the file referenced by this object.
|
boolean |
exists(java.lang.String objectPath)
Returns
true , if objectPath exists and false otherwise. |
HDF5DataSetInformation |
getDataSetInformation(java.lang.String dataSetPath)
Returns the information about a data set as a
HDF5DataSetInformation object. |
java.util.List<java.lang.String> |
getGroupMembers(java.lang.String groupPath)
Returns the members of groupPath.
|
boolean |
isGroup(java.lang.String objectPath)
Returns
true if the objectPath exists and represents a group and
false otherwise. |
byte[] |
readAsByteArray(java.lang.String objectPath)
Reads the data set objectPath as byte array (of rank 1).
|
java.util.BitSet |
readBitField(java.lang.String objectPath)
Reads a bit field (which can be considered the equivalent to a boolean array of rank 1) from
the data set objectPath and returns it as a Java
BitSet . |
boolean |
readBoolean(java.lang.String objectPath)
Reads a
Boolean value from the data set objectPath. |
<T> T |
readCompound(java.lang.String objectPath,
java.lang.Class<T> pojoClass)
Reads a compound from the data set objectPath.
|
<T> T[] |
readCompoundArray(java.lang.String objectPath,
java.lang.Class<T> pojoClass)
Reads a compound array (of rank 1) from the data set objectPath.
|
java.util.Date |
readDate(java.lang.String objectPath)
Reads a date value from the data set objectPath.
|
java.util.Date[] |
readDateArray(java.lang.String objectPath)
Reads a date array (of rank 1) from the data set objectPath.
|
double |
readDouble(java.lang.String objectPath)
Reads a
double value from the data set objectPath. |
double[] |
readDoubleArray(java.lang.String objectPath)
Reads a
double array (of rank 1) from the data set objectPath. |
double[][] |
readDoubleMatrix(java.lang.String objectPath)
Reads a
double matrix (array of arrays) from the data set objectPath. |
<T extends java.lang.Enum<T>> |
readEnum(java.lang.String objectPath,
java.lang.Class<T> enumClass)
Reads an
Enum value from the data set objectPath. |
<T extends java.lang.Enum<T>> |
readEnumArray(java.lang.String objectPath,
java.lang.Class<T> enumClass)
Reads an
Enum value array from the data set objectPath. |
java.lang.String[] |
readEnumArrayAsString(java.lang.String objectPath)
Reads an
Enum array (of rank 1) from the data set objectPath. |
java.lang.String |
readEnumAsString(java.lang.String objectPath)
Reads an
Enum value from the data set objectPath. |
float |
readFloat(java.lang.String objectPath)
Reads a
float value from the data set objectPath. |
float[] |
readFloatArray(java.lang.String objectPath)
Reads a
float array (of rank 1) from the data set objectPath. |
float[][] |
readFloatMatrix(java.lang.String objectPath)
Reads a
float matrix (array of arrays) from the data set objectPath. |
int |
readInt(java.lang.String objectPath)
Reads a
int value from the data set objectPath. |
int[] |
readIntArray(java.lang.String objectPath)
Reads a
int array (of rank 1) from the data set objectPath. |
int[][] |
readIntMatrix(java.lang.String objectPath)
Reads a
int matrix (array of arrays) from the data set objectPath. |
long |
readLong(java.lang.String objectPath)
Reads a
long value from the data set objectPath. |
long[] |
readLongArray(java.lang.String objectPath)
Reads a
long array (of rank 1) from the data set objectPath. |
long[][] |
readLongMatrix(java.lang.String objectPath)
Reads a
long matrix (array of arrays) from the data set objectPath. |
java.lang.String |
readString(java.lang.String objectPath)
Reads a
String from the data set objectPath. |
java.lang.String[] |
readStringArray(java.lang.String objectPath)
Reads a
String array (of rank 1) from the data set objectPath. |
HDF5TimeDuration |
readTimeDuration(java.lang.String objectPath)
Reads a time duration value from the data set objectPath.
|
HDF5TimeDurationArray |
readTimeDurationArray(java.lang.String objectPath)
Reads a time duration array from the data set objectPath.
|
void close()
close
in interface java.lang.AutoCloseable
close
in interface java.io.Closeable
boolean exists(java.lang.String objectPath)
true
, if objectPath exists and false
otherwise.boolean isGroup(java.lang.String objectPath)
true
if the objectPath exists and represents a group and
false
otherwise.HDF5DataSetInformation getDataSetInformation(java.lang.String dataSetPath)
HDF5DataSetInformation
object. It is a
failure condition if the dataSetPath does not exist or does not identify a data
set.dataSetPath
- The name (including path information) of the data set to return
information about.java.util.List<java.lang.String> getGroupMembers(java.lang.String groupPath)
groupPath
- The path of the group to get the members for.java.lang.IllegalArgumentException
- If groupPath is not a group.byte[] readAsByteArray(java.lang.String objectPath)
objectPath
- The name (including path information) of the data set object in the file.boolean readBoolean(java.lang.String objectPath) throws HDF5JavaException
Boolean
value from the data set objectPath.objectPath
- The name (including path information) of the data set object in the file.HDF5JavaException
- If the objectPath is not a boolean type.java.util.BitSet readBitField(java.lang.String objectPath) throws HDF5DatatypeInterfaceException
BitSet
.
Note that the storage form of the bit array is a long[]
. However, it is marked
in HDF5 to be interpreted bit-wise. Thus a data set written by
IHDF5LongWriter.writeArray(String, long[])
cannot be read back by this method but
will throw a HDF5DatatypeInterfaceException
.
objectPath
- The name (including path information) of the data set object in the file.BitSet
read from the data set.HDF5DatatypeInterfaceException
- If the objectPath is not of bit field type.int readInt(java.lang.String objectPath)
int
value from the data set objectPath. This method doesn't
check the data space but simply reads the first value.objectPath
- The name (including path information) of the data set object in the file.int[] readIntArray(java.lang.String objectPath)
int
array (of rank 1) from the data set objectPath.objectPath
- The name (including path information) of the data set object in the file.int[][] readIntMatrix(java.lang.String objectPath)
int
matrix (array of arrays) from the data set objectPath.objectPath
- The name (including path information) of the data set object in the file.long readLong(java.lang.String objectPath)
long
value from the data set objectPath. This method doesn't
check the data space but simply reads the first value.objectPath
- The name (including path information) of the data set object in the file.long[] readLongArray(java.lang.String objectPath)
long
array (of rank 1) from the data set objectPath.objectPath
- The name (including path information) of the data set object in the file.long[][] readLongMatrix(java.lang.String objectPath)
long
matrix (array of arrays) from the data set objectPath.objectPath
- The name (including path information) of the data set object in the file.float readFloat(java.lang.String objectPath)
float
value from the data set objectPath. This method doesn't
check the data space but simply reads the first value.objectPath
- The name (including path information) of the data set object in the file.float[] readFloatArray(java.lang.String objectPath)
float
array (of rank 1) from the data set objectPath.objectPath
- The name (including path information) of the data set object in the file.float[][] readFloatMatrix(java.lang.String objectPath)
float
matrix (array of arrays) from the data set objectPath.objectPath
- The name (including path information) of the data set object in the file.double readDouble(java.lang.String objectPath)
double
value from the data set objectPath. This method
doesn't check the data space but simply reads the first value.objectPath
- The name (including path information) of the data set object in the file.double[] readDoubleArray(java.lang.String objectPath)
double
array (of rank 1) from the data set objectPath.objectPath
- The name (including path information) of the data set object in the file.double[][] readDoubleMatrix(java.lang.String objectPath)
double
matrix (array of arrays) from the data set objectPath.objectPath
- The name (including path information) of the data set object in the file.java.util.Date readDate(java.lang.String objectPath) throws HDF5JavaException
IHDF5SimpleWriter.writeDate(String, Date)
.objectPath
- The name (including path information) of the data set object in the file.Date
.HDF5JavaException
- If the objectPath does not denote a time stamp.java.util.Date[] readDateArray(java.lang.String objectPath) throws HDF5JavaException
IHDF5SimpleWriter.writeDateArray(String, Date[])
.objectPath
- The name (including path information) of the data set object in the file.Date
.HDF5JavaException
- If the objectPath does not denote a time stamp.HDF5TimeDuration readTimeDuration(java.lang.String objectPath) throws HDF5JavaException
IHDF5SimpleWriter.writeTimeDuration(String, HDF5TimeDuration)
.objectPath
- The name (including path information) of the data set object in the file.HDF5JavaException
- If the objectPath is not tagged as a type variant that
corresponds to a time duration.HDF5TimeDurationArray readTimeDurationArray(java.lang.String objectPath) throws HDF5JavaException
IHDF5SimpleWriter.writeTimeDurationArray(String, HDF5TimeDurationArray)
.objectPath
- The name (including path information) of the data set object in the file.HDF5JavaException
- If the objectPath is not defined as type variant
HDF5DataTypeVariant.TIMESTAMP_MILLISECONDS_SINCE_START_OF_THE_EPOCH
.java.lang.String readString(java.lang.String objectPath) throws HDF5JavaException
String
from the data set objectPath. Considers '\0' as end of
string. This needs to be a string type.objectPath
- The name (including path information) of the data set object in the file.HDF5JavaException
- If the objectPath is not a string type.java.lang.String[] readStringArray(java.lang.String objectPath) throws HDF5JavaException
String
array (of rank 1) from the data set objectPath. The
elements of this data set need to be a string type.objectPath
- The name (including path information) of the data set object in the file.HDF5JavaException
<T> T readCompound(java.lang.String objectPath, java.lang.Class<T> pojoClass) throws HDF5JavaException
objectPath
- The name (including path information) of the data set object in the file.pojoClass
- The class to return the result in. Use HDF5CompoundDataMap
to get it
in a map, HDF5CompoundDataList
to get it in a list, and
Object[]
to get it in an array, or use a pojo (Data Transfer Object),
in which case the compound members will be mapped to Java fields.HDF5JavaException
- If the objectPath is not a compound data set.CompoundType
,
CompoundElement
<T> T[] readCompoundArray(java.lang.String objectPath, java.lang.Class<T> pojoClass) throws HDF5JavaException
objectPath
- The name (including path information) of the data set object in the file.pojoClass
- The class to return the result in. Use HDF5CompoundDataMap
to get it
in a map, HDF5CompoundDataList
to get it in a list, and
Object[]
to get it in an array, or use a pojo (Data Transfer Object),
in which case the compound members will be mapped to Java fields.HDF5JavaException
- If the objectPath is not a compound data set.CompoundType
,
CompoundElement
<T extends java.lang.Enum<T>> T readEnum(java.lang.String objectPath, java.lang.Class<T> enumClass) throws HDF5JavaException
Enum
value from the data set objectPath.objectPath
- The name (including path information) of the data set object in the file.enumClass
- the Enum
class to represent the values of.HDF5JavaException
- If the objectPath is not of enumType or if
enumClass is incompatible with the HDF5 enumeration type of
objectPath.java.lang.String readEnumAsString(java.lang.String objectPath) throws HDF5JavaException
Enum
value from the data set objectPath.objectPath
- The name (including path information) of the data set object in the file.HDF5JavaException
- If the objectPath is not an enum type.<T extends java.lang.Enum<T>> T[] readEnumArray(java.lang.String objectPath, java.lang.Class<T> enumClass) throws HDF5JavaException
Enum
value array from the data set objectPath.objectPath
- The name (including path information) of the data set object in the file.enumClass
- the Enum
class to represent the values of.HDF5JavaException
- If the objectPath is not of enumType.java.lang.String[] readEnumArrayAsString(java.lang.String objectPath) throws HDF5JavaException
Enum
array (of rank 1) from the data set objectPath.objectPath
- The name (including path information) of the data set object in the file.HDF5JavaException
- If the objectPath is not an enum type.