public class HdfIORegistry extends java.lang.Object implements IHdfIORegistry
IHdfIORegistry
. To support
IHdfIOFactory
lookups based on both objects and tag Strings
(presumably read from a file), this class uses a map from tags to object
classes and a map from object classes to IHdfIOFactories.Constructor and Description |
---|
HdfIORegistry() |
Modifier and Type | Method and Description |
---|---|
IHdfIOFactory |
getHdfIOFactory(java.lang.Object object)
Gets an
IHdfIOFactory from the registry. |
IHdfIOFactory |
getHdfIOFactory(java.lang.String tag)
Gets an
IHdfIOFactory from the registry. |
void |
registerHdfIOFactory(IHdfIOFactory factory)
Registers an
IHdfIOFactory with the registry. |
public void registerHdfIOFactory(IHdfIOFactory factory)
IHdfIORegistry
IHdfIOFactory
with the registry. Only non-null
factories can be registered. If two factories share the same supported
classes, only the most recently registered factory will be associated
with those classes.registerHdfIOFactory
in interface IHdfIORegistry
factory
- The IHdfIOFactory to add to the registry.public IHdfIOFactory getHdfIOFactory(java.lang.Object object)
IHdfIORegistry
Gets an IHdfIOFactory
from the registry. This factory supports
writing and reading for the specified class.
This method is typically used for writing an object.
getHdfIOFactory
in interface IHdfIORegistry
object
- The object that needs to be written to or read from a file.public IHdfIOFactory getHdfIOFactory(java.lang.String tag)
IHdfIORegistry
Gets an IHdfIOFactory
from the registry. Instead of using a class
as a key, this uses a String tag read from a file.
This method is typically used for reading an object.
getHdfIOFactory
in interface IHdfIORegistry
tag
- The tag used to associated an object from a file with an
IHdfIOFactory.