public interface IHdfIOFactory
This is an interface for factories that can write and read objects to and from HDF5 files.
Bundles that write or read HDF files for data structures should implement
this interface or extend the basic implementation, HdfIOFactory
(which contains several useful methods for handling HDF5 files), and provide
the IHdfIOFactory
service via OSGi so that the factory is registered
with the IHdfIORegistry
.
Modifier and Type | Method and Description |
---|---|
java.util.List<java.lang.Class<?>> |
getSupportedClasses()
Gets the supported classes for this IHDFIOFactory.
|
java.lang.String |
getTag(java.lang.Class<?> supportedClass)
Gets a tag String for a supported class returned via
getSupportedClasses() . |
java.lang.Object |
read(int groupId,
java.lang.String tag)
Reads an object from an HDF5 file specified by a URI.
|
void |
write(int parentGroupId,
java.lang.Object object)
Writes an object to an HDF5 file specified by a URI.
|
java.util.List<java.lang.Class<?>> getSupportedClasses()
java.lang.String getTag(java.lang.Class<?> supportedClass)
getSupportedClasses()
. All classes should have a String tag that
will be written to the file.supportedClass
- The supported class.void write(int parentGroupId, java.lang.Object object) throws java.lang.NullPointerException, ncsa.hdf.hdf5lib.exceptions.HDF5Exception, ncsa.hdf.hdf5lib.exceptions.HDF5LibraryException
parentGroupId
- The HDF5 file ID for the parent group containing the object.object
- An object to write to HDF5. If the object type is not
supported by the handler, nothing is written.java.lang.NullPointerException
ncsa.hdf.hdf5lib.exceptions.HDF5Exception
ncsa.hdf.hdf5lib.exceptions.HDF5LibraryException
java.lang.Object read(int groupId, java.lang.String tag) throws java.lang.NullPointerException, ncsa.hdf.hdf5lib.exceptions.HDF5Exception, ncsa.hdf.hdf5lib.exceptions.HDF5LibraryException
groupId
- The HDF5 file ID for the group containing the object.tag
- The tag Attribute for the group. This specifies the type of
object to be read from the file.java.lang.NullPointerException
ncsa.hdf.hdf5lib.exceptions.HDF5Exception
ncsa.hdf.hdf5lib.exceptions.HDF5LibraryException