public class ConversionOption 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 a number of converters that can perform transformations
on SBML documents. These converters allow their behaviors to be
controlled by setting property values. Converter properties are
communicated using objects of class ConversionProperties
, and within
such objects, individual options are encapsulated using ConversionOption
objects.
A ConversionOption
object consists of
four parts:
CNV_TYPE_
. (See the separate subsection below for more
information.)
There are no constraints on the values of keys or descriptions authors of SBML converters are free to choose them as they see fit.
An option in ConversionOption
must have a data type declared, to
indicate whether it is a string value, an integer, and so forth. The
possible types of values are taken from
a set of
constants whose symbol names begin with the prefix
CNV_TYPE_
. The following are the possible values:
Enumerator | Meaning |
|
Indicates the value type is a Boolean. |
|
Indicates the value type is a double-sized float. |
|
Indicates the value type is an integer. |
|
Indicates the value type is a float. |
|
Indicates the value type is a string. |
ConversionProperties
Constructor and Description |
---|
ConversionOption(ConversionOption orig)
Copy constructor creates a copy of an
ConversionOption object. |
ConversionOption(java.lang.String key)
Creates a new
ConversionOption . |
ConversionOption(java.lang.String key,
boolean value)
Creates a new
ConversionOption specialized for Boolean-type options. |
ConversionOption(java.lang.String key,
boolean value,
java.lang.String description)
Creates a new
ConversionOption specialized for Boolean-type options. |
ConversionOption(java.lang.String key,
double value)
Creates a new
ConversionOption specialized for double-type options. |
ConversionOption(java.lang.String key,
double value,
java.lang.String description)
Creates a new
ConversionOption specialized for double-type options. |
ConversionOption(java.lang.String key,
float value)
Creates a new
ConversionOption specialized for float-type options. |
ConversionOption(java.lang.String key,
float value,
java.lang.String description)
Creates a new
ConversionOption specialized for float-type options. |
ConversionOption(java.lang.String key,
int value)
Creates a new
ConversionOption specialized for integer-type options. |
ConversionOption(java.lang.String key,
int value,
java.lang.String description)
Creates a new
ConversionOption specialized for integer-type options. |
ConversionOption(java.lang.String key,
java.lang.String value)
Creates a new
ConversionOption . |
ConversionOption(java.lang.String key,
java.lang.String value,
int type)
Creates a new
ConversionOption . |
ConversionOption(java.lang.String key,
java.lang.String value,
int type,
java.lang.String description)
Creates a new
ConversionOption . |
ConversionOption(java.lang.String key,
java.lang.String value,
java.lang.String description)
Creates a new
ConversionOption specialized for string-type options. |
Modifier and Type | Method and Description |
---|---|
ConversionOption |
cloneObject()
Creates and returns a deep copy of this
ConversionOption object. |
void |
delete()
Explicitly deletes the underlying native object.
|
boolean |
getBoolValue()
Returns the value of this option as a Boolean.
|
java.lang.String |
getDescription()
Returns the description string for this option.
|
double |
getDoubleValue()
Returns the value of this option as a
double. |
float |
getFloatValue()
Returns the value of this option as a
float. |
int |
getIntValue()
Returns the value of this option as an
integer. |
java.lang.String |
getKey()
Returns the key for this option.
|
int |
getType()
Returns the type of this option
|
java.lang.String |
getValue()
Returns the value of this option.
|
void |
setBoolValue(boolean value)
Set the value of this option to a given Boolean value.
|
void |
setDescription(java.lang.String description)
Sets the description text for this option.
|
void |
setDoubleValue(double value)
Set the value of this option to a given
double value. |
void |
setFloatValue(float value)
Set the value of this option to a given
float value. |
void |
setIntValue(int value)
Set the value of this option to a given
int value. |
void |
setKey(java.lang.String key)
Sets the key for this option.
|
void |
setType(int type)
Sets the type of this option.
|
void |
setValue(java.lang.String value)
Sets the value for this option.
|
public ConversionOption(java.lang.String key, java.lang.String value, int type, java.lang.String description)
ConversionOption
.
This is the general constructor, taking arguments for all aspects of an option. Other constructors exist with different arguments.
The conversion type
argument value must be one of
the constants whose names begin
with the characters CNV_TYPE_
in the interface class
libsbmlConstants
.
key
- the key for this option.value
- an optional value for this option.type
- the type of this option.description
- the description for this option.
public ConversionOption(java.lang.String key, java.lang.String value, int type)
ConversionOption
.
This is the general constructor, taking arguments for all aspects of an option. Other constructors exist with different arguments.
The conversion type
argument value must be one of
the constants whose names begin
with the characters CNV_TYPE_
in the interface class
libsbmlConstants
.
key
- the key for this option.value
- an optional value for this option.type
- the type of this option.description
- the description for this option.
public ConversionOption(java.lang.String key, java.lang.String value)
ConversionOption
.
This is the general constructor, taking arguments for all aspects of an option. Other constructors exist with different arguments.
The conversion type
argument value must be one of
the constants whose names begin
with the characters CNV_TYPE_
in the interface class
libsbmlConstants
.
key
- the key for this option.value
- an optional value for this option.type
- the type of this option.description
- the description for this option.
public ConversionOption(java.lang.String key)
ConversionOption
.
This is the general constructor, taking arguments for all aspects of an option. Other constructors exist with different arguments.
The conversion type
argument value must be one of
the constants whose names begin
with the characters CNV_TYPE_
in the interface class
libsbmlConstants
.
key
- the key for this option.value
- an optional value for this option.type
- the type of this option.description
- the description for this option.
public ConversionOption(java.lang.String key, java.lang.String value, java.lang.String description)
ConversionOption
specialized for string-type options.
key
- the key for this option.value
- the value for this option.description
- an optional description.
public ConversionOption(java.lang.String key, boolean value, java.lang.String description)
ConversionOption
specialized for Boolean-type options.
key
- the key for this option.value
- the value for this option.description
- an optional description.
public ConversionOption(java.lang.String key, boolean value)
ConversionOption
specialized for Boolean-type options.
key
- the key for this option.value
- the value for this option.description
- an optional description.
public ConversionOption(java.lang.String key, double value, java.lang.String description)
ConversionOption
specialized for double-type options.
key
- the key for this option.value
- the value for this option.description
- an optional description.
public ConversionOption(java.lang.String key, double value)
ConversionOption
specialized for double-type options.
key
- the key for this option.value
- the value for this option.description
- an optional description.
public ConversionOption(java.lang.String key, float value, java.lang.String description)
ConversionOption
specialized for float-type options.
key
- the key for this option.value
- the value for this option.description
- an optional description.
public ConversionOption(java.lang.String key, float value)
ConversionOption
specialized for float-type options.
key
- the key for this option.value
- the value for this option.description
- an optional description.
public ConversionOption(java.lang.String key, int value, java.lang.String description)
ConversionOption
specialized for integer-type options.
key
- the key for this option.value
- the value for this option.description
- an optional description.
public ConversionOption(java.lang.String key, int value)
ConversionOption
specialized for integer-type options.
key
- the key for this option.value
- the value for this option.description
- an optional description.
public ConversionOption(ConversionOption orig)
ConversionOption
object.
orig
- the ConversionOption
object to copy.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 ConversionOption.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 ConversionOption.delete()
themselves.
public ConversionOption cloneObject()
ConversionOption
object.
ConversionOption
object.public java.lang.String getKey()
public void setKey(java.lang.String key)
key
- a string representing the key to set.public java.lang.String getValue()
public void setValue(java.lang.String value)
value
- the value to set, as a string.public java.lang.String getDescription()
public void setDescription(java.lang.String description)
description
- the description to set for this option.public int getType()
public void setType(int type)
The conversion type
argument value must be one of
the constants whose names begin
with the characters CNV_TYPE_
in the interface class
libsbmlConstants
.
type
- the type value to use.public boolean getBoolValue()
public void setBoolValue(boolean value)
Invoking this method will also set the type of the option to
CNV_TYPE_BOOL
.
value
- the Boolean value to set.public double getDoubleValue()
double.
public void setDoubleValue(double value)
double
value.
Invoking this method will also set the type of the option to
CNV_TYPE_DOUBLE
.
value
- the value to set.public float getFloatValue()
float.
public void setFloatValue(float value)
float
value.
Invoking this method will also set the type of the option to
CNV_TYPE_SINGLE
.
value
- the value to set.public int getIntValue()
integer.
public void setIntValue(int value)
int
value.
Invoking this method will also set the type of the option to
CNV_TYPE_INT
.
value
- the value to set.