libSBML C# API
5.18.0
|
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 a number of converters that can perform transformations on SBML documents. The properties of SBML converters are communicated using objects of class ConversionProperties, and within such objects, individual options are encapsulated using ConversionOption objects. The ConversionProperties class provides numerous methods for setting and getting options.
ConversionProperties objects are also used to determine the target SBML namespace when an SBML converter's behavior depends on the intended Level+Version combination of SBML. In addition, it is conceivable that conversions may be affected by SBML Level 3 packages being used by an SBML document; consequently, the packages in use are also communicated by the values of the SBML namespaces set on a ConversionProperties object.
The use of all the converters follows a similar approach. First, one creates a ConversionProperties object and calls ConversionProperties::addOption() on this object with one argument: a text string that identifies the desired converter. (The text string is specific to each converter; consult the documentation for a given converter to find out how it should be enabled.)
Next, for some converters, the caller can optionally set some converter-specific properties using additional calls to ConversionProperties::addOption(). Many converters provide the ability to configure their behavior to some extent; this is realized through the use of properties that offer different options. The default property values for each converter can be interrogated using the method SBMLConverter::getDefaultProperties() on the converter class in question .
Finally, the caller should invoke the method SBMLDocument::convert() with the ConversionProperties object as an argument.
The following code fragment illustrates an example using SBMLReactionConverter, which is invoked using the option string 'replaceReactions'
:
In the case of SBMLReactionConverter, there are no options to affect its behavior, so the next step is simply to invoke the converter on an SBMLDocument object. Continuing the example code:
Here is an example of using a converter that offers an option. The following code invokes SBMLStripPackageConverter to remove the SBML Level 3 Layout package from a model. It sets the name of the package to be removed by adding a value for the option named 'package'
defined by that converter:
LibSBML provides a number of built-in converters; by convention, their names end in Converter. The following are the built-in converters provided by libSBML 5.18.0:
Public Member Functions | |
new void | addOption (ConversionOption option) |
Adds a copy of the given option to this properties object. More... | |
new void | addOption (string key, string value, int type, string description) |
Adds a new ConversionOption object with the given parameters. More... | |
new void | addOption (string key, string value, int type) |
Adds a new ConversionOption object with the given parameters. More... | |
new void | addOption (string key, string value) |
Adds a new ConversionOption object with the given parameters. More... | |
new void | addOption (string key) |
Adds a new ConversionOption object with the given parameters. More... | |
new void | addOption (string key, string value, string description) |
Adds a new ConversionOption object with the given parameters. More... | |
new void | addOption (string key, bool value, string description) |
Adds a new ConversionOption object with the given parameters. More... | |
new void | addOption (string key, bool value) |
Adds a new ConversionOption object with the given parameters. More... | |
new void | addOption (string key, double value, string description) |
Adds a new ConversionOption object with the given parameters. More... | |
new void | addOption (string key, double value) |
Adds a new ConversionOption object with the given parameters. More... | |
new void | addOption (string key, float value, string description) |
Adds a new ConversionOption object with the given parameters. More... | |
new void | addOption (string key, float value) |
Adds a new ConversionOption object with the given parameters. More... | |
new void | addOption (string key, int value, string description) |
Adds a new ConversionOption object with the given parameters. More... | |
new void | addOption (string key, int value) |
Adds a new ConversionOption object with the given parameters. More... | |
new ConversionProperties | clone () |
Creates and returns a deep copy of this ConversionProperties object. More... | |
ConversionProperties (SBMLNamespaces targetNS) | |
Constructor that initializes the conversion properties with a specific SBML target namespace. More... | |
ConversionProperties () | |
Constructor that initializes the conversion properties with a specific SBML target namespace. More... | |
ConversionProperties (ConversionProperties orig) | |
Copy constructor. More... | |
virtual void | Dispose () |
new bool | getBoolValue (string key) |
Returns the value of the given option as a Boolean. More... | |
new string | getDescription (string key) |
Returns the description string for a given option in this properties object. More... | |
new double | getDoubleValue (string key) |
Returns the value of the given option as a double . More... | |
new float | getFloatValue (string key) |
Returns the value of the given option as a float . More... | |
new int | getIntValue (string key) |
Returns the value of the given option as an integer. More... | |
new int | getNumOptions () |
Returns the number of options in this Conversion Properties object. More... | |
new ConversionOption | getOption (string key) |
Returns the ConversionOption object for a given key. More... | |
new ConversionOption | getOption (int index) |
Returns the ConversionOption object for the given index . More... | |
new SBMLNamespaces | getTargetNamespaces () |
Returns the current target SBML namespace. More... | |
new int | getType (string key) |
Returns the type of a given option in this properties object. More... | |
new string | getValue (string key) |
Returns the value of the given option as a string. More... | |
new bool | hasOption (string key) |
Returns true if this properties object contains an option with the given key. More... | |
new bool | hasTargetNamespaces () |
Returns true if the target SBML namespace has been set. More... | |
new ConversionOption | removeOption (string key) |
Removes the option with the given key from this properties object. More... | |
new void | setBoolValue (string key, bool value) |
Sets the value of the given option to a Boolean. More... | |
new void | setDoubleValue (string key, double value) |
Sets the value of the given option to a double . More... | |
new void | setFloatValue (string key, float value) |
Sets the value of the given option to a float . More... | |
new void | setIntValue (string key, int value) |
Sets the value of the given option to an integer. More... | |
new void | setTargetNamespaces (SBMLNamespaces targetNS) |
Sets the target namespace. More... | |
new void | setValue (string key, string value) |
Sets the value of the given option to a string. More... | |
Protected Attributes | |
bool | swigCMemOwn |
libsbmlcs.ConversionProperties.ConversionProperties | ( | SBMLNamespaces | targetNS | ) |
Constructor that initializes the conversion properties with a specific SBML target namespace.
targetNS | the target namespace to convert to. |
libsbmlcs.ConversionProperties.ConversionProperties | ( | ) |
Constructor that initializes the conversion properties with a specific SBML target namespace.
targetNS | the target namespace to convert to. |
libsbmlcs.ConversionProperties.ConversionProperties | ( | ConversionProperties | orig | ) |
Copy constructor.
orig | the object to copy. |
new void libsbmlcs.ConversionProperties.addOption | ( | ConversionOption | option | ) |
Adds a copy of the given option to this properties object.
option | the option to add. |
new void libsbmlcs.ConversionProperties.addOption | ( | string | key, |
string | value, | ||
int | type, | ||
string | description | ||
) |
Adds a new ConversionOption object with the given parameters.
key | the key for the new option. |
value | (optional) the value of that option. |
type | (optional) the type of the option (see the documentation for ConversionOption for more information about the types). |
description | (optional) the description for the option. |
new void libsbmlcs.ConversionProperties.addOption | ( | string | key, |
string | value, | ||
int | type | ||
) |
Adds a new ConversionOption object with the given parameters.
key | the key for the new option. |
value | (optional) the value of that option. |
type | (optional) the type of the option (see the documentation for ConversionOption for more information about the types). |
description | (optional) the description for the option. |
new void libsbmlcs.ConversionProperties.addOption | ( | string | key, |
string | value | ||
) |
Adds a new ConversionOption object with the given parameters.
key | the key for the new option. |
value | (optional) the value of that option. |
type | (optional) the type of the option (see the documentation for ConversionOption for more information about the types). |
description | (optional) the description for the option. |
new void libsbmlcs.ConversionProperties.addOption | ( | string | key | ) |
Adds a new ConversionOption object with the given parameters.
key | the key for the new option. |
value | (optional) the value of that option. |
type | (optional) the type of the option (see the documentation for ConversionOption for more information about the types). |
description | (optional) the description for the option. |
new void libsbmlcs.ConversionProperties.addOption | ( | string | key, |
string | value, | ||
string | description | ||
) |
Adds a new ConversionOption object with the given parameters.
key | the key for the new option. |
value | the string value of that option. |
description | (optional) the description for the option. |
new void libsbmlcs.ConversionProperties.addOption | ( | string | key, |
bool | value, | ||
string | description | ||
) |
Adds a new ConversionOption object with the given parameters.
key | the key for the new option. |
value | the boolean value of that option. |
description | (optional) the description for the option. |
new void libsbmlcs.ConversionProperties.addOption | ( | string | key, |
bool | value | ||
) |
Adds a new ConversionOption object with the given parameters.
key | the key for the new option. |
value | the boolean value of that option. |
description | (optional) the description for the option. |
new void libsbmlcs.ConversionProperties.addOption | ( | string | key, |
double | value, | ||
string | description | ||
) |
Adds a new ConversionOption object with the given parameters.
key | the key for the new option. |
value | the double value of that option. |
description | (optional) the description for the option. |
new void libsbmlcs.ConversionProperties.addOption | ( | string | key, |
double | value | ||
) |
Adds a new ConversionOption object with the given parameters.
key | the key for the new option. |
value | the double value of that option. |
description | (optional) the description for the option. |
new void libsbmlcs.ConversionProperties.addOption | ( | string | key, |
float | value, | ||
string | description | ||
) |
Adds a new ConversionOption object with the given parameters.
key | the key for the new option. |
value | the float value of that option. |
description | (optional) the description for the option. |
new void libsbmlcs.ConversionProperties.addOption | ( | string | key, |
float | value | ||
) |
Adds a new ConversionOption object with the given parameters.
key | the key for the new option. |
value | the float value of that option. |
description | (optional) the description for the option. |
new void libsbmlcs.ConversionProperties.addOption | ( | string | key, |
int | value, | ||
string | description | ||
) |
Adds a new ConversionOption object with the given parameters.
key | the key for the new option. |
value | the integer value of that option. |
description | (optional) the description for the option. |
new void libsbmlcs.ConversionProperties.addOption | ( | string | key, |
int | value | ||
) |
Adds a new ConversionOption object with the given parameters.
key | the key for the new option. |
value | the integer value of that option. |
description | (optional) the description for the option. |
new ConversionProperties libsbmlcs.ConversionProperties.clone | ( | ) |
Creates and returns a deep copy of this ConversionProperties object.
|
virtual |
new bool libsbmlcs.ConversionProperties.getBoolValue | ( | string | key | ) |
Returns the value of the given option as a Boolean.
key | the key for the option. |
new string libsbmlcs.ConversionProperties.getDescription | ( | string | key | ) |
Returns the description string for a given option in this properties object.
key | the key for the option. |
new double libsbmlcs.ConversionProperties.getDoubleValue | ( | string | key | ) |
Returns the value of the given option as a double
.
key | the key for the option. |
new float libsbmlcs.ConversionProperties.getFloatValue | ( | string | key | ) |
Returns the value of the given option as a float
.
key | the key for the option. |
new int libsbmlcs.ConversionProperties.getIntValue | ( | string | key | ) |
Returns the value of the given option as an integer.
key | the key for the option. |
new int libsbmlcs.ConversionProperties.getNumOptions | ( | ) |
Returns the number of options in this Conversion Properties object.
new ConversionOption libsbmlcs.ConversionProperties.getOption | ( | string | key | ) |
Returns the ConversionOption object for a given key.
key | the key for the option. |
new ConversionOption libsbmlcs.ConversionProperties.getOption | ( | int | index | ) |
Returns the ConversionOption object for the given index
.
index | the index for the option. |
index
. new SBMLNamespaces libsbmlcs.ConversionProperties.getTargetNamespaces | ( | ) |
Returns the current target SBML namespace.
new int libsbmlcs.ConversionProperties.getType | ( | string | key | ) |
Returns the type of a given option in this properties object.
key | the key for the option. |
new string libsbmlcs.ConversionProperties.getValue | ( | string | key | ) |
Returns the value of the given option as a string.
key | the key for the option. |
new bool libsbmlcs.ConversionProperties.hasOption | ( | string | key | ) |
Returns true
if this properties object contains an option with the given key.
key | the key of the option to find. |
true
if an option with the given key
exists in this properties object, false
otherwise. new bool libsbmlcs.ConversionProperties.hasTargetNamespaces | ( | ) |
Returns true
if the target SBML namespace has been set.
true
if the target namespace has been set, false
otherwise. new ConversionOption libsbmlcs.ConversionProperties.removeOption | ( | string | key | ) |
Removes the option with the given key from this properties object.
key | the key for the new option to remove. |
new void libsbmlcs.ConversionProperties.setBoolValue | ( | string | key, |
bool | value | ||
) |
Sets the value of the given option to a Boolean.
key | the key for the option. |
value | the new Boolean value. |
new void libsbmlcs.ConversionProperties.setDoubleValue | ( | string | key, |
double | value | ||
) |
Sets the value of the given option to a double
.
key | the key for the option. |
value | the new double value. |
new void libsbmlcs.ConversionProperties.setFloatValue | ( | string | key, |
float | value | ||
) |
Sets the value of the given option to a float
.
key | the key for the option. |
value | the new float value. |
new void libsbmlcs.ConversionProperties.setIntValue | ( | string | key, |
int | value | ||
) |
Sets the value of the given option to an integer.
key | the key for the option. |
value | the new integer value. |
new void libsbmlcs.ConversionProperties.setTargetNamespaces | ( | SBMLNamespaces | targetNS | ) |
Sets the target namespace.
targetNS | the target namespace to use. |
new void libsbmlcs.ConversionProperties.setValue | ( | string | key, |
string | value | ||
) |
Sets the value of the given option to a string.
key | the key for the option. |
value | the new value. |
|
protected |