libSBML Python API  5.18.0
libsbml.ConversionOption Class Reference
Inheritance diagram for libsbml.ConversionOption:
[legend]

Detailed Description

A single configuration setting for an SBML converter.

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:

  • A key, acting as the name of the option.
  • A value of this option.
  • A type for the value; the type code is chosen from a set of integer constants whose names all begin with the prefix CNV_TYPE_. (See the separate subsection below for more information.)
  • A description consisting of a text string that describes the option in some way.

There are no constraints on the values of keys or descriptions; authors of SBML converters are free to choose them as they see fit.

Rule types for SBML Level 1

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
CNV_TYPE_BOOL Indicates the value type is a Boolean.
CNV_TYPE_DOUBLE Indicates the value type is a float-sized float.
CNV_TYPE_INT Indicates the value type is an integer.
CNV_TYPE_SINGLE Indicates the value type is a float.
CNV_TYPE_STRING Indicates the value type is a string.
See also
ConversionProperties

Public Member Functions

def __init__ (self, args)
 This method has multiple variants; they differ in the arguments they accept. More...
 
def clone (self)
 Creates and returns a deep copy of this ConversionOption object. More...
 
def getBoolValue (self)
 Returns the value of this option as a Boolean. More...
 
def getDescription (self)
 Returns the description string for this option. More...
 
def getDoubleValue (self)
 Returns the value of this option as a float. More...
 
def getFloatValue (self)
 Returns the value of this option as a float. More...
 
def getIntValue (self)
 Returns the value of this option as an integer. More...
 
def getKey (self)
 Returns the key for this option. More...
 
def getType (self)
 Returns the type of this option. More...
 
def getValue (self)
 Returns the value of this option. More...
 
def setBoolValue (self, value)
 Set the value of this option to a given Boolean value. More...
 
def setDescription (self, description)
 Sets the description text for this option. More...
 
def setDoubleValue (self, value)
 Set the value of this option to a given float value. More...
 
def setFloatValue (self, value)
 Set the value of this option to a given float value. More...
 
def setIntValue (self, value)
 Set the value of this option to a given int value. More...
 
def setKey (self, key)
 Sets the key for this option. More...
 
def setType (self, type)
 Sets the type of this option. More...
 
def setValue (self, value)
 Sets the value for this option. More...
 

Constructor & Destructor Documentation

def libsbml.ConversionOption.__init__ (   self,
  args 
)

This method has multiple variants; they differ in the arguments they accept.

__init__(string key, string value, long type, string description)   ConversionOption
__init__(string key, string value, long type)   ConversionOption
__init__(string key, string value)   ConversionOption
__init__(string key)   ConversionOption
__init__(string key, long  value, string description)   ConversionOption
__init__(string key, long  value)   ConversionOption
__init__(string key, bool value, string description)   ConversionOption
__init__(string key, bool value)   ConversionOption
__init__(string key, float value, string description)   ConversionOption
__init__(string key, float value)   ConversionOption
__init__(string key, float value, string description)   ConversionOption
__init__(string key, float value)   ConversionOption
__init__(string key, int value, string description)   ConversionOption
__init__(string key, int value)   ConversionOption
__init__(ConversionOption orig)   ConversionOption

Each variant is described separately below.


Method variant with the following signature:
ConversionOption(string key, bool value, string description='')

Creates a new ConversionOption specialized for Boolean-type options.

Parameters
keythe key for this option.
valuethe value for this option.
descriptionan optional description.

Method variant with the following signature:
ConversionOption(string key, string value='', long type, string description='')

Creates a new 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 libsbml.
Parameters
keythe key for this option.
valuean optional value for this option.
typethe type of this option.
descriptionthe description for this option.

Method variant with the following signature:
ConversionOption(string key, string value, string description='')

Creates a new ConversionOption specialized for string-type options.

Parameters
keythe key for this option.
valuethe value for this option.
descriptionan optional description.

Method variant with the following signature:
ConversionOption(string key, float value, string description='')

Creates a new ConversionOption specialized for float-type options.

Parameters
keythe key for this option.
valuethe value for this option.
descriptionan optional description.

Method variant with the following signature:
ConversionOption(string key, float value, string description='')

Creates a new ConversionOption specialized for float-type options.

Parameters
keythe key for this option.
valuethe value for this option.
descriptionan optional description.

Method variant with the following signature:
ConversionOption(string key, int value, string description='')

Creates a new ConversionOption specialized for integer-type options.

Parameters
keythe key for this option.
valuethe value for this option.
descriptionan optional description.

Method variant with the following signature:
ConversionOption(ConversionOption orig)

Copy constructor; creates a copy of an ConversionOption object.

Parameters
origthe ConversionOption object to copy.

Member Function Documentation

def libsbml.ConversionOption.clone (   self)

Creates and returns a deep copy of this ConversionOption object.

clone()   ConversionOption
Returns
the (deep) copy of this ConversionOption object.
def libsbml.ConversionOption.getBoolValue (   self)

Returns the value of this option as a Boolean.

getBoolValue()   bool
Returns
the value of this option.
def libsbml.ConversionOption.getDescription (   self)

Returns the description string for this option.

getDescription()   string
Returns
the description of this option.
def libsbml.ConversionOption.getDoubleValue (   self)

Returns the value of this option as a float.

getDoubleValue()   float
Returns
the value of this option.
def libsbml.ConversionOption.getFloatValue (   self)

Returns the value of this option as a float.

getFloatValue()   float
Returns
the value of this option as a float.
def libsbml.ConversionOption.getIntValue (   self)

Returns the value of this option as an integer.

getIntValue()   int
Returns
the value of this option, as an int.
def libsbml.ConversionOption.getKey (   self)

Returns the key for this option.

getKey()   string
Returns
the key, as a string.
def libsbml.ConversionOption.getType (   self)

Returns the type of this option.

Returns
the type of this option.
getType()   long
 
def libsbml.ConversionOption.getValue (   self)

Returns the value of this option.

getValue()   string
Returns
the value of this option, as a string.
def libsbml.ConversionOption.setBoolValue (   self,
  value 
)

Set the value of this option to a given Boolean value.

setBoolValue(bool value)

Invoking this method will also set the type of the option to CNV_TYPE_BOOL.

Parameters
valuethe Boolean value to set.
def libsbml.ConversionOption.setDescription (   self,
  description 
)

Sets the description text for this option.

setDescription(string description)
Parameters
descriptionthe description to set for this option.
def libsbml.ConversionOption.setDoubleValue (   self,
  value 
)

Set the value of this option to a given float value.

setDoubleValue (float value)

Invoking this method will also set the type of the option to CNV_TYPE_DOUBLE.

Parameters
valuethe value to set.
def libsbml.ConversionOption.setFloatValue (   self,
  value 
)

Set the value of this option to a given float value.

setFloatValue(float value)

Invoking this method will also set the type of the option to CNV_TYPE_SINGLE.

Parameters
valuethe value to set.
def libsbml.ConversionOption.setIntValue (   self,
  value 
)

Set the value of this option to a given int value.

setIntValue(int value)

Invoking this method will also set the type of the option to CNV_TYPE_INT.

Parameters
valuethe value to set.
def libsbml.ConversionOption.setKey (   self,
  key 
)

Sets the key for this option.

setKey(string key)
Parameters
keya string representing the key to set.
def libsbml.ConversionOption.setType (   self,
  type 
)

Sets the type of this option.

setType(long type)
The conversion type argument value must be one of the constants whose names begin with the characters CNV_TYPE_ in the interface class libsbml.
Parameters
typethe type value to use.
def libsbml.ConversionOption.setValue (   self,
  value 
)

Sets the value for this option.

setValue(string value)
Parameters
valuethe value to set, as a string.