public class ConversionProperties 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.
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. These, too, are communicated by the values of
the SBML namespaces set on a ConversionProperties
object.
ConversionOption
,
SBMLNamespaces
Constructor and Description |
---|
ConversionProperties()
Constructor that initializes the conversion properties
with a specific SBML target namespace.
|
ConversionProperties(ConversionProperties orig)
Copy constructor.
|
ConversionProperties(SBMLNamespaces targetNS)
Constructor that initializes the conversion properties
with a specific SBML target namespace.
|
Modifier and Type | Method and Description |
---|---|
void |
addOption(ConversionOption option)
Adds a copy of the given option to this properties object.
|
void |
addOption(java.lang.String key)
Adds a new
ConversionOption object with the given parameters. |
void |
addOption(java.lang.String key,
boolean value)
Adds a new
ConversionOption object with the given parameters. |
void |
addOption(java.lang.String key,
boolean value,
java.lang.String description)
Adds a new
ConversionOption object with the given parameters. |
void |
addOption(java.lang.String key,
double value)
Adds a new
ConversionOption object with the given parameters. |
void |
addOption(java.lang.String key,
double value,
java.lang.String description)
Adds a new
ConversionOption object with the given parameters. |
void |
addOption(java.lang.String key,
float value)
Adds a new
ConversionOption object with the given parameters. |
void |
addOption(java.lang.String key,
float value,
java.lang.String description)
Adds a new
ConversionOption object with the given parameters. |
void |
addOption(java.lang.String key,
int value)
Adds a new
ConversionOption object with the given parameters. |
void |
addOption(java.lang.String key,
int value,
java.lang.String description)
Adds a new
ConversionOption object with the given parameters. |
void |
addOption(java.lang.String key,
java.lang.String value)
Adds a new
ConversionOption object with the given parameters. |
void |
addOption(java.lang.String key,
java.lang.String value,
int type)
Adds a new
ConversionOption object with the given parameters. |
void |
addOption(java.lang.String key,
java.lang.String value,
int type,
java.lang.String description)
Adds a new
ConversionOption object with the given parameters. |
void |
addOption(java.lang.String key,
java.lang.String value,
java.lang.String description)
Adds a new
ConversionOption object with the given parameters. |
ConversionProperties |
cloneObject()
Creates and returns a deep copy of this
ConversionProperties object. |
void |
delete()
Explicitly deletes the underlying native object.
|
boolean |
getBoolValue(java.lang.String key)
Returns the value of the given option as a Boolean.
|
java.lang.String |
getDescription(java.lang.String key)
Returns the description string for a given option in this properties
object.
|
double |
getDoubleValue(java.lang.String key)
Returns the value of the given option as a
double. |
float |
getFloatValue(java.lang.String key)
Returns the value of the given option as a
float. |
int |
getIntValue(java.lang.String key)
Returns the value of the given option as an integer.
|
ConversionOption |
getOption(java.lang.String key)
Returns the
ConversionOption object for a given key. |
SBMLNamespaces |
getTargetNamespaces()
Returns the current target SBML namespace.
|
int |
getType(java.lang.String key)
Returns the type of a given option in this properties object.
|
java.lang.String |
getValue(java.lang.String key)
Returns the value of the given option as a string.
|
boolean |
hasOption(java.lang.String key)
Returns
true if this properties object contains an option with
the given key. |
boolean |
hasTargetNamespaces()
Returns
true if the target SBML namespace has been set. |
ConversionOption |
removeOption(java.lang.String key)
Removes the option with the given key from this properties object.
|
void |
setBoolValue(java.lang.String key,
boolean value)
Sets the value of the given option to a Boolean.
|
void |
setDoubleValue(java.lang.String key,
double value)
Sets the value of the given option to a
double. |
void |
setFloatValue(java.lang.String key,
float value)
Sets the value of the given option to a
float. |
void |
setIntValue(java.lang.String key,
int value)
Sets the value of the given option to an integer.
|
void |
setTargetNamespaces(SBMLNamespaces targetNS)
Sets the target namespace.
|
void |
setValue(java.lang.String key,
java.lang.String value)
Sets the value of the given option to a string.
|
public ConversionProperties()
targetNS
- the target namespace to convert topublic ConversionProperties(ConversionProperties orig)
orig
- the object to copy.
SBMLConstructorException
- Thrown if the argument orig
is null.
public ConversionProperties(SBMLNamespaces targetNS)
targetNS
- the target namespace to convert topublic void addOption(ConversionOption option)
option
- the option to addpublic void addOption(java.lang.String key)
ConversionOption
object with the given parameters.
key
- the key for the new optionvalue
- (optional) the value of that optiontype
- (optional) the type of the optiondescription
- (optional) the description for the optionpublic void addOption(java.lang.String key, boolean value)
ConversionOption
object with the given parameters.
key
- the key for the new optionvalue
- the boolean value of that optiondescription
- (optional) the description for the optionpublic void addOption(java.lang.String key, boolean value, java.lang.String description)
ConversionOption
object with the given parameters.
key
- the key for the new optionvalue
- the boolean value of that optiondescription
- (optional) the description for the optionpublic void addOption(java.lang.String key, double value)
ConversionOption
object with the given parameters.
key
- the key for the new optionvalue
- the double value of that optiondescription
- (optional) the description for the optionpublic void addOption(java.lang.String key, double value, java.lang.String description)
ConversionOption
object with the given parameters.
key
- the key for the new optionvalue
- the double value of that optiondescription
- (optional) the description for the optionpublic void addOption(java.lang.String key, float value)
ConversionOption
object with the given parameters.
key
- the key for the new optionvalue
- the float value of that optiondescription
- (optional) the description for the optionpublic void addOption(java.lang.String key, float value, java.lang.String description)
ConversionOption
object with the given parameters.
key
- the key for the new optionvalue
- the float value of that optiondescription
- (optional) the description for the optionpublic void addOption(java.lang.String key, int value)
ConversionOption
object with the given parameters.
key
- the key for the new optionvalue
- the integer value of that optiondescription
- (optional) the description for the optionpublic void addOption(java.lang.String key, int value, java.lang.String description)
ConversionOption
object with the given parameters.
key
- the key for the new optionvalue
- the integer value of that optiondescription
- (optional) the description for the optionpublic void addOption(java.lang.String key, java.lang.String value)
ConversionOption
object with the given parameters.
key
- the key for the new optionvalue
- (optional) the value of that optiontype
- (optional) the type of the optiondescription
- (optional) the description for the optionpublic void addOption(java.lang.String key, java.lang.String value, int type)
ConversionOption
object with the given parameters.
key
- the key for the new optionvalue
- (optional) the value of that optiontype
- (optional) the type of the optiondescription
- (optional) the description for the optionpublic void addOption(java.lang.String key, java.lang.String value, int type, java.lang.String description)
ConversionOption
object with the given parameters.
key
- the key for the new optionvalue
- (optional) the value of that optiontype
- (optional) the type of the optiondescription
- (optional) the description for the optionpublic void addOption(java.lang.String key, java.lang.String value, java.lang.String description)
ConversionOption
object with the given parameters.
key
- the key for the new optionvalue
- the string value of that optiondescription
- (optional) the description for the optionpublic ConversionProperties cloneObject()
ConversionProperties
object.
ConversionProperties
object.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 ConversionProperties.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 ConversionProperties.delete()
themselves.
public boolean getBoolValue(java.lang.String key)
key
- the key for the option.
public java.lang.String getDescription(java.lang.String key)
key
- the key for the option.
public double getDoubleValue(java.lang.String key)
double.
key
- the key for the option.
public float getFloatValue(java.lang.String key)
float.
key
- the key for the option.
public int getIntValue(java.lang.String key)
key
- the key for the option.
public ConversionOption getOption(java.lang.String key)
ConversionOption
object for a given key.
key
- the key for the option.
public SBMLNamespaces getTargetNamespaces()
public int getType(java.lang.String key)
key
- the key for the option.
public java.lang.String getValue(java.lang.String key)
key
- the key for the option.
public boolean hasOption(java.lang.String key)
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.public boolean hasTargetNamespaces()
true
if the target SBML namespace has been set.
true
if the target namespace has been set, false
otherwise.public ConversionOption removeOption(java.lang.String key)
key
- the key for the new option to removepublic void setBoolValue(java.lang.String key, boolean value)
key
- the key for the option.
value
- the new Boolean value.public void setDoubleValue(java.lang.String key, double value)
double.
key
- the key for the option.
value
- the new double value.public void setFloatValue(java.lang.String key, float value)
float.
key
- the key for the option.
value
- the new float value.public void setIntValue(java.lang.String key, int value)
key
- the key for the option.
value
- the new integer value.public void setTargetNamespaces(SBMLNamespaces targetNS)
targetNS
- the target namespace to use.public void setValue(java.lang.String key, java.lang.String value)
key
- the key for the optionvalue
- the new value