public class SBMLConverterRegistry extends java.lang.Object
This class of objects is defined by libSBML only and has no direct equivalent in terms of SBML components. It is a class used in the implementation of extra functionality provided by libSBML.
LibSBML provides facilities for transforming and converting SBML
documents in various ways. These transformations can involve
essentially anything that can be written algorithmically examples
include converting the units of measurement in a model, or converting
from one Level+Version combination of SBML to another. Converters are
implemented as objects derived from the class SBMLConverter
.
The converter registry, implemented as a singleton object of class
SBMLConverterRegistry
, maintains a list of known converters and provides
methods for discovering them. Callers can use the method
SBMLConverterRegistry.getNumConverters()
to find out how many
converters are registered, then use
SBMLConverterRegistry.getConverterByIndex(int)
to
iterate over each one alternatively, callers can use
SBMLConverterRegistry.getConverterFor(ConversionProperties)
to search for a converter having specific properties.
Modifier and Type | Method and Description |
---|---|
int |
addConverter(SBMLConverter converter)
Adds the given converter to the registry of SBML converters.
|
void |
delete()
Explicitly deletes the underlying native object.
|
SBMLConverter |
getConverterByIndex(int index)
Returns the converter with the given index number.
|
SBMLConverter |
getConverterFor(ConversionProperties props)
Returns the converter that best matches the given configuration
properties.
|
static SBMLConverterRegistry |
getInstance()
Returns the singleton instance for the converter registry.
|
int |
getNumConverters()
Returns the number of converters known by the registry.
|
public void delete()
In general, application software will not need to call this method directly. The Java language binding for libSBML is implemented as a language wrapper that provides a Java interface to libSBML's underlying C++/C code. Some of the Java methods return objects that are linked to objects created not by Java code, but by C++ code. The Java objects wrapped around them will be deleted when the garbage collector invokes the corresponding C++ finalize()
methods for the objects. The finalize()
methods in turn call the SBMLConverterRegistry.delete()
method on the libSBML object.
This method is exposed in case calling programs want to ensure that the underlying object is freed immediately, and not at some arbitrary time determined by the Java garbage collector. In normal usage, callers do not need to invoke SBMLConverterRegistry.delete()
themselves.
public static SBMLConverterRegistry getInstance()
Prior to using the registry, callers have to obtain a copy of the registry. This static method provides the means for doing that.
public int addConverter(SBMLConverter converter)
converter
- the converter to add to the registry.
public SBMLConverter getConverterByIndex(int index)
Converters are given arbitrary index numbers by the registry. Callers
can use the method SBMLConverterRegistry.getNumConverters()
to find
out how many converters are registered, then use this method to
iterate over the list and obtain each one in turn.
index
- the zero-based index of the converter to fetch.
null
if the
number is less than 0
or there is no converter at the given index
position.public SBMLConverter getConverterFor(ConversionProperties props)
Many converters provide the ability to configure their behavior. This
is realized through the use of properties that offer different
options. The present method allows callers to search for converters
that have specific property values. Callers can do this by creating a
ConversionProperties
object, adding the desired option(s) to the
object, then passing the object to this method.
props
- a ConversionProperties
object defining the properties
to match against.
null
if no
suitable converter is found.
SBMLConverterRegistry.getConverterByIndex(int)
public int getNumConverters()
SBMLConverterRegistry.getConverterByIndex(int)