public class Reaction extends SBase
A reaction represents any transformation, transport or binding process, typically a chemical reaction, that can change the quantity of one or more species. In SBML, a reaction is defined primarily in terms of the participating reactants and products (and their corresponding stoichiometries), along with optional modifier species, an optional rate at which the reaction takes place, and optional parameters.
As with other major objects in SBML, Reaction
has a mandatory attribute,
'id', used to give the compartment type an identifier. The identifier
must be a text string conforming to the identifer syntax permitted in
SBML. In SBML Level 2 and Level 3, the reaction 'id'
identifier can be used in mathematical formulas elsewhere in an SBML
model to represent the rate of that reaction this usage is explained
below. Reaction
also has an optional 'name' attribute, of type
string.
The 'id' and 'name' must be used according to the guidelines
described in the SBML specification.
The species participating as reactants, products, and/or modifiers in a
reaction are declared using lists of SpeciesReference
and/or
ModifierSpeciesReference
instances stored in subelements
'listOfReactants', 'listOfProducts' and 'listOfModifiers'. Certain
restrictions are placed on the appearance of species in reaction
definitions:
Species
for more information.
Reaction
must be declared in at
least one of that Reaction
's lists of reactants, products, and/or
modifiers. Put another way, it is an error for a reaction's kinetic law
formula to refer to species that have not been declared for that
reaction.
A reaction can contain up to one KineticLaw
object in a subelement named
'kineticLaw'. It defines the speed at which the process defined by the
reaction takes place. The description of KineticLaw
provides more
details about its use. Note that although the inclusion of a KineticLaw
object in an instance of a Reaction
component is optional, there is no
useful default that can be substituted in place of a missing rate
expression in a reaction. Moreover, a reaction's rate cannot be defined
in any other way in SBML&mdashInitialAssignment
, AssignmentRule
,
RateRule
, AlgebraicRule
, Event
, and other constructs in SBML cannot be
used to set the reaction rate separately. Nevertheless, for some
modeling applications, reactions without any defined rate can be
perfectly acceptable.
Reaction
also has a boolean attribute named 'reversible' for indicating
whether the reaction is reversible. This attribute is optional in SBML
Level 2, with a default of true
it is mandatory in SBML
Level 3 (with no default value). To say that a reaction is
reversible is to say it can proceed in either the forward or the reverse
direction. Although the reversibility of a reaction can sometimes be
deduced by inspecting its rate expression, this is not always the case,
especially for complicated expressions. Moreover, the need in SBML to
allow rate expressions (i.e., KineticLaw
) to be optional leads to the
need for a separate flag indicating reversibility. Note that labeling a
reaction as irreversible is an assertion that the reaction always
proceeds in the given forward direction. (Why else would it be flagged
as irreversible?) This implies the rate expression in the KineticLaw
always has a non-negative value during simulations. Software tools
could provide a means of optionally testing that this condition holds.
The presence of reversibility information in two places (i.e., the rate
expression and the 'reversible' attribute on Reaction
) leaves open the
possibility that a model could contain contradictory information, but
the creation of such a model would be an error on the part of the
software generating it.
The Reaction
object class has another boolean attribute called 'fast'.
This attribute is optional in SBML Level 2, with a default of
false
it is mandatory in SBML Level 3 (with no default value).
In SBML Level 3 Version 2, a value of true
for the 'fast'
attribute is deprecated in favor of all reactions having a 'fast' value
of false.
It
is used to indicate that a reaction occurs on a vastly faster time scale
than others in a system. Readers are directed to the SBML Level 2
Version 4 specification, which provides more detail about the
conditions under which a reaction can be considered to be fast in this
sense. SBML Level 1
and Level 2 Version 1 incorrectly claimed that software tools
could ignore this attribute if they did not implement support for the
corresponding concept however, further research in SBML has revealed
that this is not true, and 'fast' cannot be ignored if it is
set to true.
SBML Level 2 Versions 2&ndash4 therefore
stipulate that if a model has any reactions with 'fast' set to true
,
a software tool must be able to respect the attribute or else indicate
to the user that it does not have the capacity to do so. Analysis
software cannot ignore the value of the 'fast' attribute because doing
so may lead to different results as compared to a software system that
does make use of 'fast'.
In SBML Level 3 Version 2, values of true
for the 'fast' attribute were deprecated, and in future
versions of the specification, the attribute itself will
be removed. Users should be aware that even for previous
levels/versions of the specification, the 'fast' attribute
has never achieved widespread support, and many software
packages may ignore it. To achieve the same or similar
effects as setting the fast attribute to 'true' for a given
reaction, the KineticLaw
attribute should be constructed to
produce a value in the desired time scale, or else the
reaction could be replaced with an AssignmentRule
or
AlgebraicRule
.
In SBML Level 3, the Reaction
object has an
additional optional attribute named 'compartment', whose value must be
the identifier of a compartment defined in the enclosing Model
object.
The 'compartment' attribute can be used to indicate the compartment in
which the reaction is assumed to take place. If the attribute is
present, its value must be the identifier of a Compartment
object
defined in the enclosing Model
object. Similar to the 'reversible'
attribute, the value of the 'compartment' attribute has no direct impact
on the construction of mathematical equations for the SBML model. When
a kinetic law is given for a reaction, the compartment location may
already be implicit in the kinetic law (although this cannot always be
guaranteed). Nevertheless, software tools may find the 'compartment'
attribute value useful for such purposes as analyzing the structure of
the model, guiding the modeler in constructing correct rate formulas,
and visualization purposes.
Readers are urged to read the SBML specification for more details about
the proper use of Reaction
.
Constructor and Description |
---|
Reaction(long level,
long version)
|
Reaction(Reaction orig)
Copy constructor creates a copy of this
Reaction . |
Reaction(SBMLNamespaces sbmlns)
|
Modifier and Type | Method and Description |
---|---|
int |
addModifier(ModifierSpeciesReference msr)
Adds a given
ModifierSpeciesReference object as a product in this
Reaction . |
int |
addModifier(Species species)
Adds the given species as a modifier to this reaction
|
int |
addModifier(Species species,
java.lang.String id)
Adds the given species as a modifier to this reaction
|
int |
addProduct(Species species)
Adds the given species as a product with the given stoichiometry
|
int |
addProduct(Species species,
double stoichiometry)
Adds the given species as a product with the given stoichiometry
|
int |
addProduct(Species species,
double stoichiometry,
java.lang.String id)
Adds the given species as a product with the given stoichiometry
|
int |
addProduct(Species species,
double stoichiometry,
java.lang.String id,
boolean constant)
Adds the given species as a product with the given stoichiometry
|
int |
addProduct(SpeciesReference sr)
Adds a given
SpeciesReference object as a product in this Reaction . |
int |
addReactant(Species species)
Adds the given species as a reactant with the given stoichiometry
|
int |
addReactant(Species species,
double stoichiometry)
Adds the given species as a reactant with the given stoichiometry
|
int |
addReactant(Species species,
double stoichiometry,
java.lang.String id)
Adds the given species as a reactant with the given stoichiometry
|
int |
addReactant(Species species,
double stoichiometry,
java.lang.String id,
boolean constant)
Adds the given species as a reactant with the given stoichiometry
|
int |
addReactant(SpeciesReference sr)
Adds a given
SpeciesReference object as a reactant in this Reaction . |
Reaction |
cloneObject()
Creates and returns a deep copy of this
Reaction object. |
void |
connectToChild()   |
KineticLaw |
createKineticLaw()
Creates a new
KineticLaw object, installs it as this Reaction 's
'kineticLaw' subelement, and returns it. |
ModifierSpeciesReference |
createModifier()
Creates a new
ModifierSpeciesReference , adds it to this Reaction 's
list of modifiers and returns it. |
SpeciesReference |
createProduct()
Creates a new
SpeciesReference , adds it to this Reaction 's list of
products, and returns it. |
SpeciesReference |
createReactant()
Creates a new
SpeciesReference , adds it to this Reaction 's list of
reactants, and returns it. |
void |
delete()
Explicitly deletes the underlying native object.
|
java.lang.String |
getCompartment()
(SBML Level 3 only) Returns the value of the 'compartment'
attribute on the
Reaction . |
SBase |
getElementByMetaId(java.lang.String metaid)
Returns the first child element it can find with the given
metaid , or
null if no such object is found. |
SBase |
getElementBySId(java.lang.String id)
Returns the first child element found that has the given
id in the
model-wide SId namespace, or null if no such object is found. |
java.lang.String |
getElementName()
Returns the XML element name of this object, which for
Reaction , is
always 'reaction'. |
boolean |
getFast()
Returns the value of the 'fast' attribute of this
Reaction . |
java.lang.String |
getId()
Returns the value of the 'id' attribute of this
Reaction . |
KineticLaw |
getKineticLaw()
Returns the
KineticLaw object contained in this Reaction . |
ListOfSpeciesReferences |
getListOfModifiers()
Returns the list of modifiers in this
Reaction object. |
ListOfSpeciesReferences |
getListOfProducts()
Returns the list of products in this
Reaction object. |
ListOfSpeciesReferences |
getListOfReactants()
Returns the list of reactants in this
Reaction object. |
ModifierSpeciesReference |
getModifier(long n)
Returns the nth modifier species (as a
ModifierSpeciesReference object)
in the list of modifiers of this Reaction . |
ModifierSpeciesReference |
getModifier(java.lang.String species)
Returns the modifier species (as a
ModifierSpeciesReference object)
having a specific identifier in this Reaction . |
java.lang.String |
getName()
Returns the value of the 'name' attribute of this
Reaction object. |
long |
getNumModifiers()
Returns the number of modifier species in this
Reaction . |
long |
getNumProducts()
Returns the number of product species in this
Reaction . |
long |
getNumReactants()
Returns the number of reactant species in this
Reaction . |
SpeciesReference |
getProduct(long n)
Returns the nth product species (as a
SpeciesReference object) in
the list of products in this Reaction . |
SpeciesReference |
getProduct(java.lang.String species)
Returns the product species (as a
SpeciesReference object) having
a specific identifier in this Reaction . |
SpeciesReference |
getReactant(long n)
Returns the nth reactant species (as a
SpeciesReference object) in
the list of reactants in this Reaction . |
SpeciesReference |
getReactant(java.lang.String species)
Returns the reactant species (as a
SpeciesReference object) having
a specific identifier in this Reaction . |
boolean |
getReversible()
Returns the value of the 'reversible' attribute on the
Reaction as a
boolean value. |
int |
getTypeCode()
Returns the libSBML type code for this SBML object.
|
boolean |
hasRequiredAttributes()
Predicate returning
true if all the required attributes for this
Reaction object have been set. |
void |
initDefaults()
Initializes the fields of this
Reaction object to 'typical' default
values. |
boolean |
isSetCompartment()
Predicate returning
true if this
Reaction 's 'compartment' attribute is set. |
boolean |
isSetFast()
Predicate returning
true if the value of
the 'fast' attribute on this Reaction is set. |
boolean |
isSetId()
Predicate returning
true if this
Reaction 's 'id' attribute is set. |
boolean |
isSetKineticLaw()
Predicate returning
true if this
Reaction contains a kinetic law object. |
boolean |
isSetName()
Predicate returning
true if this
Reaction 's 'name' attribute is set. |
boolean |
isSetReversible()
Predicate returning
true if this
Reaction 's 'reversible' attribute is set. |
ModifierSpeciesReference |
removeModifier(long n)
Removes the nth modifier species (ModifierSpeciesReference object) in
the list of modifiers in this
Reaction and returns a pointer to it. |
ModifierSpeciesReference |
removeModifier(java.lang.String species)
Removes the modifier species (ModifierSpeciesReference object) having
the given 'species' attribute in this
Reaction and returns a pointer to it. |
SpeciesReference |
removeProduct(long n)
Removes the nth product species (SpeciesReference object) in the list of
products in this
Reaction and returns a pointer to it. |
SpeciesReference |
removeProduct(java.lang.String species)
Removes the product species (SpeciesReference object) having the given
'species' attribute in this
Reaction and returns a pointer to it. |
SpeciesReference |
removeReactant(long n)
Removes the nth reactant species (SpeciesReference object) in the list of
reactants in this
Reaction and returns a pointer to it. |
SpeciesReference |
removeReactant(java.lang.String species)
Removes the reactant species (SpeciesReference object) having the given
'species' attribute in this
Reaction and returns a pointer to it. |
void |
renameSIdRefs(java.lang.String oldid,
java.lang.String newid)
Replaces all uses of a given
SIdRef type attribute value with another
value. |
int |
setCompartment(java.lang.String sid)
Sets the value of the 'compartment' attribute of this
Reaction . |
int |
setFast(boolean value)
Sets the value of the 'fast' attribute of this
Reaction . |
int |
setId(java.lang.String sid)
Sets the value of the 'id' attribute of this
Reaction . |
int |
setKineticLaw(KineticLaw kl)
Sets the 'kineticLaw' subelement of this
Reaction to a copy of the
given KineticLaw object. |
int |
setName(java.lang.String name)
Sets the value of the 'name' attribute of this
Reaction . |
int |
setReversible(boolean value)
Sets the value of the 'reversible' attribute of this
Reaction . |
int |
unsetCompartment()
Unsets the value of the 'compartment' attribute of this
Reaction . |
int |
unsetFast()
Unsets the value of the 'fast' attribute of this
Reaction . |
int |
unsetKineticLaw()
Unsets the 'kineticLaw' subelement of this
Reaction . |
int |
unsetName()
Unsets the value of the 'name' attribute of this
Reaction . |
int |
unsetReversible()
Unsets the value of the 'reversible' attribute of this
Reaction . |
addCVTerm, addCVTerm, appendAnnotation, appendAnnotation, appendNotes, appendNotes, deleteDisabledPlugins, deleteDisabledPlugins, disablePackage, enablePackage, equals, getAncestorOfType, getAncestorOfType, getAnnotation, getAnnotationString, getColumn, getCVTerm, getCVTerms, getDisabledPlugin, getIdAttribute, getLevel, getLine, getListOfAllElements, getListOfAllElements, getListOfAllElementsFromPlugins, getListOfAllElementsFromPlugins, getMetaId, getModel, getModelHistory, getNamespaces, getNotes, getNotesString, getNumCVTerms, getNumDisabledPlugins, getNumPlugins, getObjectVersion, getPackageName, getPackageVersion, getParentSBMLObject, getPlugin, getPlugin, getPrefix, getResourceBiologicalQualifier, getResourceModelQualifier, getSBMLDocument, getSBOTerm, getSBOTermAsURL, getSBOTermID, getURI, getVersion, hashCode, hasValidLevelVersionNamespaceCombination, isPackageEnabled, isPackageURIEnabled, isPkgEnabled, isPkgURIEnabled, isSetAnnotation, isSetIdAttribute, isSetMetaId, isSetModelHistory, isSetNotes, isSetSBOTerm, isSetUserData, matchesRequiredSBMLNamespacesForAddition, matchesSBMLNamespaces, removeFromParentAndDelete, removeTopLevelAnnotationElement, removeTopLevelAnnotationElement, removeTopLevelAnnotationElement, renameMetaIdRefs, renameUnitSIdRefs, replaceTopLevelAnnotationElement, replaceTopLevelAnnotationElement, setAnnotation, setAnnotation, setIdAttribute, setMetaId, setModelHistory, setNamespaces, setNotes, setNotes, setNotes, setSBOTerm, setSBOTerm, toSBML, toXMLNode, unsetAnnotation, unsetCVTerms, unsetId, unsetIdAttribute, unsetMetaId, unsetModelHistory, unsetNotes, unsetSBOTerm, unsetUserData
public Reaction(long level, long version) throws SBMLConstructorException
level
- a long integer, the SBML Level to assign to this Reaction
.
version
- a long integer, the SBML Version to assign to this
Reaction
.
SBMLConstructorException
- Thrown if the given level
and version
combination are invalid
or if this object is incompatible with the given level and version.
SBMLDocument
having a different
combination of SBML Level, Version and XML namespaces than the object
itself will result in an error at the time a caller attempts to make the
addition. A parent object must have compatible Level, Version and XML
namespaces. (Strictly speaking, a parent may also have more XML
namespaces than a child, but the reverse is not permitted.) The
restriction is necessary to ensure that an SBML model has a consistent
overall structure. This requires callers to manage their objects
carefully, but the benefit is increased flexibility in how models can be
created by permitting callers to create objects bottom-up if desired. In
situations where objects are not yet attached to parents (e.g.,
SBMLDocument
), knowledge of the intented SBML Level and Version help
libSBML determine such things as whether it is valid to assign a
particular value to an attribute.public Reaction(SBMLNamespaces sbmlns) throws SBMLConstructorException
Reaction
using the given SBMLNamespaces
object
sbmlns
.
The SBMLNamespaces
object encapsulates SBML Level/Version/namespaces
information. It is used to communicate the SBML Level, Version, and (in
Level 3) packages used in addition to SBML Level 3 Core. A
common approach to using libSBML's SBMLNamespaces
facilities is to create an
SBMLNamespaces
object somewhere in a program once, then hand that object
as needed to object constructors that accept SBMLNamespaces
as arguments.
sbmlns
- an SBMLNamespaces
object.
SBMLConstructorException
- Thrown if the given sbmlns
is inconsistent or incompatible
with this object.
SBMLDocument
having a different
combination of SBML Level, Version and XML namespaces than the object
itself will result in an error at the time a caller attempts to make the
addition. A parent object must have compatible Level, Version and XML
namespaces. (Strictly speaking, a parent may also have more XML
namespaces than a child, but the reverse is not permitted.) The
restriction is necessary to ensure that an SBML model has a consistent
overall structure. This requires callers to manage their objects
carefully, but the benefit is increased flexibility in how models can be
created by permitting callers to create objects bottom-up if desired. In
situations where objects are not yet attached to parents (e.g.,
SBMLDocument
), knowledge of the intented SBML Level and Version help
libSBML determine such things as whether it is valid to assign a
particular value to an attribute.public Reaction(Reaction orig) throws SBMLConstructorException
Reaction
.
orig
- the object to copy.SBMLConstructorException
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 Reaction.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 Reaction.delete()
themselves.
public Reaction cloneObject()
Reaction
object.
cloneObject
 in class SBase
Reaction
object.public SBase getElementBySId(java.lang.String id)
id
in the
model-wide SId namespace, or null
if no such object is found.
getElementBySId
 in class SBase
id
- string representing the id of the object to find.
id
.public SBase getElementByMetaId(java.lang.String metaid)
metaid
, or
null
if no such object is found.
getElementByMetaId
 in class SBase
metaid
- string representing the metaid of the object to find.
metaid
.public void renameSIdRefs(java.lang.String oldid, java.lang.String newid)
Replaces all uses of a given SIdRef
type attribute value with another
value.
In SBML, object identifiers are of a data type called SId
.
In SBML Level 3, an explicit data type called SIdRef
was
introduced for attribute values that refer to SId
values in
previous Levels of SBML, this data type did not exist and attributes were
simply described to as 'referring to an identifier', but the effective
data type was the same as SIdRef
in Level 3. These and
other methods of libSBML refer to the type SIdRef
for all
Levels of SBML, even if the corresponding SBML specification did not
explicitly name the data type.
This method works by looking at all attributes and (if appropriate)
mathematical formulas in MathML content, comparing the referenced
identifiers to the value of oldid
. If any matches are found, the
matching values are replaced with newid
. The method does not
descend into child elements.
renameSIdRefs
 in class SBase
oldid
- the old identifier.newid
- the new identifier.public void initDefaults()
Reaction
object to 'typical' default
values.
The SBML Reaction
component has slightly different aspects and
default attribute values in different SBML Levels and Versions.
This method sets the values to certain common defaults, based
mostly on what they are in SBML Level 2. Specifically:
true
false
true.
Beginning with SBML Level 2 Versions 2, the SBML specifications
therefore stipulate that if a model has any reactions with 'fast' set to
true
, a software tool must be able to respect the attribute or else
indicate to the user that it does not have the capacity to do so. Readers
are directed to the SBML specifications, which provides more detail about
the conditions under which a reaction can be considered to be fast in this
sense.public java.lang.String getId()
Reaction
.
getId
 in class SBase
Reaction
.
SBase.getIdAttribute()
,
SBase.setIdAttribute(String sid)
,
SBase.isSetIdAttribute()
,
SBase.unsetIdAttribute()
The identifier given by an object's 'id' attribute value
is used to identify the object within the SBML model definition.
Other objects can refer to the component using this identifier. The
data type of 'id' is always SId
or a type derived
from that, such as UnitSId
, depending on the object in
question. All data types are defined as follows:
letter .= 'a'..'z','A'..'Z' digit .= '0'..'9' idChar .= letter | digit | '_' SId .= ( letter | '_' ) idChar*
The characters (
and )
are used for grouping, the
character *
'zero or more times', and the character
|
indicates logical 'or'. The equality of SBML identifiers is
determined by an exact character sequence match i.e., comparisons must be
performed in a case-sensitive manner. This applies to all uses of SId
,
SIdRef
, and derived types.
In SBML Level 3 Version 2, the 'id' and 'name' attributes were
moved to SBase
directly, instead of being defined individually for many
(but not all) objects. Libsbml has for a long time provided functions
defined on SBase
itself to get, set, check, and unset those attributes, which
would fail or otherwise return empty strings if executed on any object
for which those attributes were not defined. Now that all SBase
objects
define those attributes, those functions now succeed for any object with
the appropriate level and version.
The exception to this rule is that for InitialAssignment
, EventAssignment
,
AssignmentRule
, and RateRule
objects, the getId() function and the isSetId()
functions (though not the setId() or unsetId() functions) would instead
reference the value of the 'variable' attribute (for the rules and event
assignments) or the 'symbol' attribute (for initial assignments).
The AlgebraicRule
fell into this category as well, though because it
contained neither a 'variable' nor a 'symbol' attribute, getId() would
always return an empty string, and isSetId() would always return false.
For this reason, four new functions are now provided
(getIdAttribute(), setIdAttribute(String),
isSetIdAttribute(), and unsetIdAttribute()) that will always
act on the actual 'id' attribute, regardless of the object's type. The
new functions should be used instead of the old ones unless the old behavior
is somehow necessary.
Regardless of the level and version of the SBML, these functions allow client applications to use more generalized code in some situations (for instance, when manipulating objects that are all known to have identifiers). If the object in question does not posess an 'id' attribute according to the SBML specification for the Level and Version in use, libSBML will not allow the identifier to be set, nor will it read or write 'id' attributes for those objects.
public java.lang.String getName()
Reaction
object.
In SBML Level 3 Version 2, the 'id' and 'name' attributes were
moved to SBase
directly, instead of being defined individually for many
(but not all) objects. Libsbml has for a long time provided functions
defined on SBase
itself to get, set, and unset those attributes, which
would fail or otherwise return empty strings if executed on any object
for which those attributes were not defined. Now that all SBase
objects
define those attributes, those functions now succeed for any object with
the appropriate level and version.
The 'name' attribute is
optional and is not intended to be used for cross-referencing purposes
within a model. Its purpose instead is to provide a human-readable
label for the component. The data type of 'name' is the type
string
defined in XML Schema. SBML imposes no
restrictions as to the content of 'name' attributes beyond those
restrictions defined by the string
type in XML Schema.
The recommended practice for handling 'name' is as follows. If a software tool has the capability for displaying the content of 'name' attributes, it should display this content to the user as a component's label instead of the component's 'id'. If the user interface does not have this capability (e.g., because it cannot display or use special characters in symbol names), or if the 'name' attribute is missing on a given component, then the user interface should display the value of the 'id' attribute instead. (Script language interpreters are especially likely to display 'id' instead of 'name'.)
As a consequence of the above, authors of systems that automatically generate the values of 'id' attributes should be aware some systems may display the 'id''s to the user. Authors therefore may wish to take some care to have their software create 'id' values that are: (a) reasonably easy for humans to type and read and (b) likely to be meaningful, for example by making the 'id' attribute be an abbreviated form of the name attribute value.
An additional point worth mentioning is although there are restrictions on the uniqueness of 'id' values, there are no restrictions on the uniqueness of 'name' values in a model. This allows software applications leeway in assigning component identifiers.
Regardless of the level and version of the SBML, these functions allow client applications to use more generalized code in some situations (for instance, when manipulating objects that are all known to have names). If the object in question does not posess a 'name' attribute according to the SBML specification for the Level and Version in use, libSBML will not allow the name to be set, nor will it read or write 'name' attributes for those objects.
getName
 in class SBase
SBase.getIdAttribute()
,
Reaction.isSetName()
,
Reaction.setName(String sid)
,
Reaction.unsetName()
public KineticLaw getKineticLaw()
KineticLaw
object contained in this Reaction
.
KineticLaw
instance.public boolean getReversible()
Reaction
as a
boolean value.
Reaction
.public boolean getFast()
Reaction
.
In SBML Level 3 Version 2, values of true
for the 'fast' attribute were deprecated, and in future
versions of the specification, the attribute itself will
be removed. Users should be aware that even for previous
levels/versions of the specification, the 'fast' attribute
has never achieved widespread support, and many software
packages may ignore it. To achieve the same or similar
effects as setting the fast attribute to 'true' for a given
reaction, the KineticLaw
attribute should be constructed to
produce a value in the desired time scale, or else the
reaction could be replaced with an AssignmentRule
or
AlgebraicRule
.
Reaction
.
true.
Beginning with SBML Level 2 Versions 2, the SBML specifications
therefore stipulate that if a model has any reactions with 'fast' set to
true
, a software tool must be able to respect the attribute or else
indicate to the user that it does not have the capacity to do so. Readers
are directed to the SBML specifications, which provides more detail about
the conditions under which a reaction can be considered to be fast in this
sense.public java.lang.String getCompartment()
Reaction
.
public boolean isSetId()
isSetId
 in class SBase
true
if the 'id' attribute of this SBML object is
set, false
otherwise.
SBase.getIdAttribute()
,
SBase.setIdAttribute(String sid)
,
SBase.unsetIdAttribute()
,
SBase.isSetIdAttribute()
The identifier given by an object's 'id' attribute value
is used to identify the object within the SBML model definition.
Other objects can refer to the component using this identifier. The
data type of 'id' is always SId
or a type derived
from that, such as UnitSId
, depending on the object in
question. All data types are defined as follows:
letter .= 'a'..'z','A'..'Z' digit .= '0'..'9' idChar .= letter | digit | '_' SId .= ( letter | '_' ) idChar*
The characters (
and )
are used for grouping, the
character *
'zero or more times', and the character
|
indicates logical 'or'. The equality of SBML identifiers is
determined by an exact character sequence match i.e., comparisons must be
performed in a case-sensitive manner. This applies to all uses of SId
,
SIdRef
, and derived types.
In SBML Level 3 Version 2, the 'id' and 'name' attributes were
moved to SBase
directly, instead of being defined individually for many
(but not all) objects. Libsbml has for a long time provided functions
defined on SBase
itself to get, set, check, and unset those attributes, which
would fail or otherwise return empty strings if executed on any object
for which those attributes were not defined. Now that all SBase
objects
define those attributes, those functions now succeed for any object with
the appropriate level and version.
The exception to this rule is that for InitialAssignment
, EventAssignment
,
AssignmentRule
, and RateRule
objects, the getId() function and the isSetId()
functions (though not the setId() or unsetId() functions) would instead
reference the value of the 'variable' attribute (for the rules and event
assignments) or the 'symbol' attribute (for initial assignments).
The AlgebraicRule
fell into this category as well, though because it
contained neither a 'variable' nor a 'symbol' attribute, getId() would
always return an empty string, and isSetId() would always return false.
For this reason, four new functions are now provided
(getIdAttribute(), setIdAttribute(String),
isSetIdAttribute(), and unsetIdAttribute()) that will always
act on the actual 'id' attribute, regardless of the object's type. The
new functions should be used instead of the old ones unless the old behavior
is somehow necessary.
Regardless of the level and version of the SBML, these functions allow client applications to use more generalized code in some situations (for instance, when manipulating objects that are all known to have identifiers). If the object in question does not posess an 'id' attribute according to the SBML specification for the Level and Version in use, libSBML will not allow the identifier to be set, nor will it read or write 'id' attributes for those objects.
public boolean isSetName()
true
if this
Reaction
's 'name' attribute is set.
In SBML Level 3 Version 2, the 'id' and 'name' attributes were
moved to SBase
directly, instead of being defined individually for many
(but not all) objects. Libsbml has for a long time provided functions
defined on SBase
itself to get, set, and unset those attributes, which
would fail or otherwise return empty strings if executed on any object
for which those attributes were not defined. Now that all SBase
objects
define those attributes, those functions now succeed for any object with
the appropriate level and version.
The 'name' attribute is
optional and is not intended to be used for cross-referencing purposes
within a model. Its purpose instead is to provide a human-readable
label for the component. The data type of 'name' is the type
string
defined in XML Schema. SBML imposes no
restrictions as to the content of 'name' attributes beyond those
restrictions defined by the string
type in XML Schema.
The recommended practice for handling 'name' is as follows. If a software tool has the capability for displaying the content of 'name' attributes, it should display this content to the user as a component's label instead of the component's 'id'. If the user interface does not have this capability (e.g., because it cannot display or use special characters in symbol names), or if the 'name' attribute is missing on a given component, then the user interface should display the value of the 'id' attribute instead. (Script language interpreters are especially likely to display 'id' instead of 'name'.)
As a consequence of the above, authors of systems that automatically generate the values of 'id' attributes should be aware some systems may display the 'id''s to the user. Authors therefore may wish to take some care to have their software create 'id' values that are: (a) reasonably easy for humans to type and read and (b) likely to be meaningful, for example by making the 'id' attribute be an abbreviated form of the name attribute value.
An additional point worth mentioning is although there are restrictions on the uniqueness of 'id' values, there are no restrictions on the uniqueness of 'name' values in a model. This allows software applications leeway in assigning component identifiers.
Regardless of the level and version of the SBML, these functions allow client applications to use more generalized code in some situations (for instance, when manipulating objects that are all known to have names). If the object in question does not posess a 'name' attribute according to the SBML specification for the Level and Version in use, libSBML will not allow the name to be set, nor will it read or write 'name' attributes for those objects.
isSetName
 in class SBase
true
if the 'name' attribute of this SBML object is
set, false
otherwise.
Reaction.getName()
,
Reaction.setName(String sid)
,
Reaction.unsetName()
public boolean isSetKineticLaw()
true
if this
Reaction
contains a kinetic law object.
true
if a KineticLaw
is present in this Reaction
,, false
otherwise.public boolean isSetFast()
true
if the value of
the 'fast' attribute on this Reaction
is set.
In SBML Level 3 Version 2, values of true
for the 'fast' attribute were deprecated, and in future
versions of the specification, the attribute itself will
be removed. Users should be aware that even for previous
levels/versions of the specification, the 'fast' attribute
has never achieved widespread support, and many software
packages may ignore it. To achieve the same or similar
effects as setting the fast attribute to 'true' for a given
reaction, the KineticLaw
attribute should be constructed to
produce a value in the desired time scale, or else the
reaction could be replaced with an AssignmentRule
or
AlgebraicRule
.
true
if the 'fast' attribute is set, false
otherwise.
true.
Beginning with SBML Level 2 Versions 2, the SBML specifications
therefore stipulate that if a model has any reactions with 'fast' set to
true
, a software tool must be able to respect the attribute or else
indicate to the user that it does not have the capacity to do so. Readers
are directed to the SBML specifications, which provides more detail about
the conditions under which a reaction can be considered to be fast in this
sense.public boolean isSetCompartment()
true
if this
Reaction
's 'compartment' attribute is set.
public boolean isSetReversible()
true
if this
Reaction
's 'reversible' attribute is set.
true
if the 'reversible' attribute of this Reaction
is
set, false
otherwise.public int setId(java.lang.String sid)
Reaction
.
The string sid
is copied.
The identifier given by an object's 'id' attribute value
is used to identify the object within the SBML model definition.
Other objects can refer to the component using this identifier. The
data type of 'id' is always SId
or a type derived
from that, such as UnitSId
, depending on the object in
question. All data types are defined as follows:
letter .= 'a'..'z','A'..'Z' digit .= '0'..'9' idChar .= letter | digit | '_' SId .= ( letter | '_' ) idChar*
The characters (
and )
are used for grouping, the
character *
'zero or more times', and the character
|
indicates logical 'or'. The equality of SBML identifiers is
determined by an exact character sequence match i.e., comparisons must be
performed in a case-sensitive manner. This applies to all uses of SId
,
SIdRef
, and derived types.
In SBML Level 3 Version 2, the 'id' and 'name' attributes were
moved to SBase
directly, instead of being defined individually for many
(but not all) objects. Libsbml has for a long time provided functions
defined on SBase
itself to get, set, check, and unset those attributes, which
would fail or otherwise return empty strings if executed on any object
for which those attributes were not defined. Now that all SBase
objects
define those attributes, those functions now succeed for any object with
the appropriate level and version.
The exception to this rule is that for InitialAssignment
, EventAssignment
,
AssignmentRule
, and RateRule
objects, the getId() function and the isSetId()
functions (though not the setId() or unsetId() functions) would instead
reference the value of the 'variable' attribute (for the rules and event
assignments) or the 'symbol' attribute (for initial assignments).
The AlgebraicRule
fell into this category as well, though because it
contained neither a 'variable' nor a 'symbol' attribute, getId() would
always return an empty string, and isSetId() would always return false.
For this reason, four new functions are now provided
(getIdAttribute(), setIdAttribute(String),
isSetIdAttribute(), and unsetIdAttribute()) that will always
act on the actual 'id' attribute, regardless of the object's type. The
new functions should be used instead of the old ones unless the old behavior
is somehow necessary.
Regardless of the level and version of the SBML, these functions allow client applications to use more generalized code in some situations (for instance, when manipulating objects that are all known to have identifiers). If the object in question does not posess an 'id' attribute according to the SBML specification for the Level and Version in use, libSBML will not allow the identifier to be set, nor will it read or write 'id' attributes for those objects.
setId
 in class SBase
sid
- the string to use as the identifier of this object.
SBase.getIdAttribute()
,
SBase.setIdAttribute(String sid)
,
SBase.isSetIdAttribute()
,
SBase.unsetIdAttribute()
public int setName(java.lang.String name)
public int setKineticLaw(KineticLaw kl)
Reaction
to a copy of the
given KineticLaw
object.
kl
- the KineticLaw
object to use.
public int setReversible(boolean value)
Reaction
.
value
- the value of the 'reversible' attribute.
public int setFast(boolean value)
Reaction
.
In SBML Level 3 Version 2, values of true
for the 'fast' attribute were deprecated, and in future
versions of the specification, the attribute itself will
be removed. Users should be aware that even for previous
levels/versions of the specification, the 'fast' attribute
has never achieved widespread support, and many software
packages may ignore it. To achieve the same or similar
effects as setting the fast attribute to 'true' for a given
reaction, the KineticLaw
attribute should be constructed to
produce a value in the desired time scale, or else the
reaction could be replaced with an AssignmentRule
or
AlgebraicRule
.
Calling this function with an argument of true
for an
SBML Level 3 Version 2 Reaction
will set
the value, but will result in a return value of
LIBSBML_DEPRECATED_ATTRIBUTE
.
value
- the value of the 'fast' attribute.
true.
Beginning with SBML Level 2 Versions 2, the SBML specifications
therefore stipulate that if a model has any reactions with 'fast' set to
true
, a software tool must be able to respect the attribute or else
indicate to the user that it does not have the capacity to do so. Readers
are directed to the SBML specifications, which provides more detail about
the conditions under which a reaction can be considered to be fast in this
sense.public int setCompartment(java.lang.String sid)
Reaction
.
The string sid
is copied.
sid
- the string to use as the compartment of this Reaction
.
Reaction
in
lower Levels of SBML.public int unsetName()
Reaction
.
In SBML Level 3 Version 2, the 'id' and 'name' attributes were
moved to SBase
directly, instead of being defined individually for many
(but not all) objects. Libsbml has for a long time provided functions
defined on SBase
itself to get, set, and unset those attributes, which
would fail or otherwise return empty strings if executed on any object
for which those attributes were not defined. Now that all SBase
objects
define those attributes, those functions now succeed for any object with
the appropriate level and version.
The 'name' attribute is
optional and is not intended to be used for cross-referencing purposes
within a model. Its purpose instead is to provide a human-readable
label for the component. The data type of 'name' is the type
string
defined in XML Schema. SBML imposes no
restrictions as to the content of 'name' attributes beyond those
restrictions defined by the string
type in XML Schema.
The recommended practice for handling 'name' is as follows. If a software tool has the capability for displaying the content of 'name' attributes, it should display this content to the user as a component's label instead of the component's 'id'. If the user interface does not have this capability (e.g., because it cannot display or use special characters in symbol names), or if the 'name' attribute is missing on a given component, then the user interface should display the value of the 'id' attribute instead. (Script language interpreters are especially likely to display 'id' instead of 'name'.)
As a consequence of the above, authors of systems that automatically generate the values of 'id' attributes should be aware some systems may display the 'id''s to the user. Authors therefore may wish to take some care to have their software create 'id' values that are: (a) reasonably easy for humans to type and read and (b) likely to be meaningful, for example by making the 'id' attribute be an abbreviated form of the name attribute value.
An additional point worth mentioning is although there are restrictions on the uniqueness of 'id' values, there are no restrictions on the uniqueness of 'name' values in a model. This allows software applications leeway in assigning component identifiers.
Regardless of the level and version of the SBML, these functions allow client applications to use more generalized code in some situations (for instance, when manipulating objects that are all known to have names). If the object in question does not posess a 'name' attribute according to the SBML specification for the Level and Version in use, libSBML will not allow the name to be set, nor will it read or write 'name' attributes for those objects.
unsetName
 in class SBase
Reaction.getName()
,
Reaction.setName(String sid)
,
Reaction.isSetName()
public int unsetKineticLaw()
Reaction
.
public int unsetFast()
Reaction
.
In SBML Level 3 Version 2, values of true
for the 'fast' attribute were deprecated, and in future
versions of the specification, the attribute itself will
be removed. Users should be aware that even for previous
levels/versions of the specification, the 'fast' attribute
has never achieved widespread support, and many software
packages may ignore it. To achieve the same or similar
effects as setting the fast attribute to 'true' for a given
reaction, the KineticLaw
attribute should be constructed to
produce a value in the desired time scale, or else the
reaction could be replaced with an AssignmentRule
or
AlgebraicRule
.
true.
Beginning with SBML Level 2 Versions 2, the SBML specifications
therefore stipulate that if a model has any reactions with 'fast' set to
true
, a software tool must be able to respect the attribute or else
indicate to the user that it does not have the capacity to do so. Readers
are directed to the SBML specifications, which provides more detail about
the conditions under which a reaction can be considered to be fast in this
sense.public int unsetCompartment()
Reaction
.
Reaction
in
lower Levels of SBML.public int unsetReversible()
Reaction
.
public int addReactant(SpeciesReference sr)
SpeciesReference
object as a reactant in this Reaction
.
The SpeciesReference
instance in sr
is copied.
sr
- a SpeciesReference
object referring to a Species
in the
enclosing Model
.
LIBSBML_OPERATION_SUCCESS
LIBSBML_LEVEL_MISMATCH
LIBSBML_VERSION_MISMATCH
LIBSBML_DUPLICATE_OBJECT_ID
LIBSBML_INVALID_OBJECT
LIBSBML_OPERATION_FAILED
Reaction.createReactant()
create
)
for alternatives that do not lead to these issues.
public int addReactant(Species species, double stoichiometry, java.lang.String id, boolean constant)
species
- the species to be added as reactant.
stoichiometry
- an optional parameter specifying the
stoichiometry of the product (defaulting to 1).
id
- an optional id to be given to the species reference that will
be created. (defaulting to empty string, i.e. not set).
constant
- an attribute specifying whether the species reference is
constant or not (defaulting to true).
LIBSBML_OPERATION_SUCCESS
LIBSBML_INVALID_OBJECT
LIBSBML_INVALID_ATTRIBUTE_VALUE
LIBSBML_DUPLICATE_OBJECT_ID
Reaction.createProduct()
create
)
for alternatives that do not lead to these issues.
, the Species
object itself is NOT added to the model
public int addReactant(Species species, double stoichiometry, java.lang.String id)
species
- the species to be added as reactant.
stoichiometry
- an optional parameter specifying the
stoichiometry of the product (defaulting to 1).
id
- an optional id to be given to the species reference that will
be created. (defaulting to empty string, i.e. not set).
constant
- an attribute specifying whether the species reference is
constant or not (defaulting to true).
LIBSBML_OPERATION_SUCCESS
LIBSBML_INVALID_OBJECT
LIBSBML_INVALID_ATTRIBUTE_VALUE
LIBSBML_DUPLICATE_OBJECT_ID
Reaction.createProduct()
create
)
for alternatives that do not lead to these issues.
, the Species
object itself is NOT added to the model
public int addReactant(Species species, double stoichiometry)
species
- the species to be added as reactant.
stoichiometry
- an optional parameter specifying the
stoichiometry of the product (defaulting to 1).
id
- an optional id to be given to the species reference that will
be created. (defaulting to empty string, i.e. not set).
constant
- an attribute specifying whether the species reference is
constant or not (defaulting to true).
LIBSBML_OPERATION_SUCCESS
LIBSBML_INVALID_OBJECT
LIBSBML_INVALID_ATTRIBUTE_VALUE
LIBSBML_DUPLICATE_OBJECT_ID
Reaction.createProduct()
create
)
for alternatives that do not lead to these issues.
, the Species
object itself is NOT added to the model
public int addReactant(Species species)
species
- the species to be added as reactant.
stoichiometry
- an optional parameter specifying the
stoichiometry of the product (defaulting to 1).
id
- an optional id to be given to the species reference that will
be created. (defaulting to empty string, i.e. not set).
constant
- an attribute specifying whether the species reference is
constant or not (defaulting to true).
LIBSBML_OPERATION_SUCCESS
LIBSBML_INVALID_OBJECT
LIBSBML_INVALID_ATTRIBUTE_VALUE
LIBSBML_DUPLICATE_OBJECT_ID
Reaction.createProduct()
create
)
for alternatives that do not lead to these issues.
, the Species
object itself is NOT added to the model
public int addProduct(SpeciesReference sr)
SpeciesReference
object as a product in this Reaction
.
The SpeciesReference
instance in sr
is copied.
sr
- a SpeciesReference
object referring to a Species
in the
enclosing Model
.
Reaction.createProduct()
create
)
for alternatives that do not lead to these issues.
public int addProduct(Species species, double stoichiometry, java.lang.String id, boolean constant)
species
- the species to be added as product.
stoichiometry
- an optional parameter specifying the
stoichiometry of the product (defaulting to 1).
id
- an optional id to be given to the species reference that will
be created. (defaulting to empty string, i.e. not set).
constant
- an attribute specifying whether the species reference is
constant or not (defaulting to true).
LIBSBML_OPERATION_SUCCESS
LIBSBML_INVALID_OBJECT
LIBSBML_INVALID_ATTRIBUTE_VALUE
LIBSBML_DUPLICATE_OBJECT_ID
Reaction.createProduct()
create
)
for alternatives that do not lead to these issues.
, the Species
object itself is NOT added to the model
public int addProduct(Species species, double stoichiometry, java.lang.String id)
species
- the species to be added as product.
stoichiometry
- an optional parameter specifying the
stoichiometry of the product (defaulting to 1).
id
- an optional id to be given to the species reference that will
be created. (defaulting to empty string, i.e. not set).
constant
- an attribute specifying whether the species reference is
constant or not (defaulting to true).
LIBSBML_OPERATION_SUCCESS
LIBSBML_INVALID_OBJECT
LIBSBML_INVALID_ATTRIBUTE_VALUE
LIBSBML_DUPLICATE_OBJECT_ID
Reaction.createProduct()
create
)
for alternatives that do not lead to these issues.
, the Species
object itself is NOT added to the model
public int addProduct(Species species, double stoichiometry)
species
- the species to be added as product.
stoichiometry
- an optional parameter specifying the
stoichiometry of the product (defaulting to 1).
id
- an optional id to be given to the species reference that will
be created. (defaulting to empty string, i.e. not set).
constant
- an attribute specifying whether the species reference is
constant or not (defaulting to true).
LIBSBML_OPERATION_SUCCESS
LIBSBML_INVALID_OBJECT
LIBSBML_INVALID_ATTRIBUTE_VALUE
LIBSBML_DUPLICATE_OBJECT_ID
Reaction.createProduct()
create
)
for alternatives that do not lead to these issues.
, the Species
object itself is NOT added to the model
public int addProduct(Species species)
species
- the species to be added as product.
stoichiometry
- an optional parameter specifying the
stoichiometry of the product (defaulting to 1).
id
- an optional id to be given to the species reference that will
be created. (defaulting to empty string, i.e. not set).
constant
- an attribute specifying whether the species reference is
constant or not (defaulting to true).
LIBSBML_OPERATION_SUCCESS
LIBSBML_INVALID_OBJECT
LIBSBML_INVALID_ATTRIBUTE_VALUE
LIBSBML_DUPLICATE_OBJECT_ID
Reaction.createProduct()
create
)
for alternatives that do not lead to these issues.
, the Species
object itself is NOT added to the model
public int addModifier(ModifierSpeciesReference msr)
ModifierSpeciesReference
object as a product in this
Reaction
.
The ModifierSpeciesReference
instance in msr
is copied.
msr
- a ModifierSpeciesReference
object referring to a Species
in
the enclosing Model
.
LIBSBML_OPERATION_SUCCESS
LIBSBML_UNEXPECTED_ATTRIBUTE
LIBSBML_LEVEL_MISMATCH
LIBSBML_DUPLICATE_OBJECT_ID
LIBSBML_VERSION_MISMATCH
LIBSBML_OPERATION_FAILED
Reaction.createModifier()
create
)
for alternatives that do not lead to these issues.
public int addModifier(Species species, java.lang.String id)
species
- the species to be added as modifier.
id
- an optional id to be given to the species reference that will
be created. (defaulting to empty string, i.e. not set).
LIBSBML_OPERATION_SUCCESS
LIBSBML_INVALID_OBJECT
LIBSBML_INVALID_ATTRIBUTE_VALUE
LIBSBML_DUPLICATE_OBJECT_ID
Reaction.createModifier()
create
)
for alternatives that do not lead to these issues.
, the Species
object itself is NOT added to the model
public int addModifier(Species species)
species
- the species to be added as modifier.
id
- an optional id to be given to the species reference that will
be created. (defaulting to empty string, i.e. not set).
LIBSBML_OPERATION_SUCCESS
LIBSBML_INVALID_OBJECT
LIBSBML_INVALID_ATTRIBUTE_VALUE
LIBSBML_DUPLICATE_OBJECT_ID
Reaction.createModifier()
create
)
for alternatives that do not lead to these issues.
, the Species
object itself is NOT added to the model
public SpeciesReference createReactant()
SpeciesReference
, adds it to this Reaction
's list of
reactants, and returns it.
SpeciesReference
object.public SpeciesReference createProduct()
SpeciesReference
, adds it to this Reaction
's list of
products, and returns it.
SpeciesReference
object.public ModifierSpeciesReference createModifier()
ModifierSpeciesReference
, adds it to this Reaction
's
list of modifiers and returns it.
ModifierSpeciesReference
object.public KineticLaw createKineticLaw()
KineticLaw
object, installs it as this Reaction
's
'kineticLaw' subelement, and returns it.
If this Reaction
had a previous KineticLaw
, it will be destroyed.
KineticLaw
object.public ListOfSpeciesReferences getListOfReactants()
Reaction
object.
ListOfSpeciesReferences
containing the references to the
species acting as reactants in this reaction.public ListOfSpeciesReferences getListOfProducts()
Reaction
object.
ListOfSpeciesReferences
containing the references to the
species acting as products in this reaction.public ListOfSpeciesReferences getListOfModifiers()
Reaction
object.
ListOfSpeciesReferences
containing the references to the
species acting as modifiers in this reaction.public SpeciesReference getReactant(long n)
SpeciesReference
object) in
the list of reactants in this Reaction
.
Callers should first call getNumReactants() to find out how many reactants there are, to avoid using an invalid index number.
n
- the index of the reactant sought.
SpeciesReference
object) of this
Reaction
.public SpeciesReference getReactant(java.lang.String species)
SpeciesReference
object) having
a specific identifier in this Reaction
.
species
- the identifier of the reactant Species
('species'
attribute of the reactant SpeciesReference
object).
SpeciesReference
object, or null
if no species with the
given identifier species
appears as a reactant in this Reaction
.public SpeciesReference getProduct(long n)
SpeciesReference
object) in
the list of products in this Reaction
.
Callers should first call getNumProducts() to find out how many products there are, to avoid using an invalid index number.
n
- the index of the product sought.
SpeciesReference
object) of this
Reaction
.public SpeciesReference getProduct(java.lang.String species)
SpeciesReference
object) having
a specific identifier in this Reaction
.
species
- the identifier of the product Species
('species'
attribute of the product SpeciesReference
object).
SpeciesReference
object, or null
if no species with the
given identifier species
appears as a product in this Reaction
.public ModifierSpeciesReference getModifier(long n)
ModifierSpeciesReference
object)
in the list of modifiers of this Reaction
.
Callers should first call getNumModifiers() to find out how many modifiers there are, to avoid using an invalid index number.
n
- the index of the modifier species sought.
ModifierSpeciesReference
object) of
this Reaction
.public ModifierSpeciesReference getModifier(java.lang.String species)
ModifierSpeciesReference
object)
having a specific identifier in this Reaction
.
species
- the identifier of the modifier Species
('species'
attribute of the ModifierSpeciesReference
object).
ModifierSpeciesReference
object, or null
if no species with
the given identifier species
appears as a modifier in this
Reaction
.public long getNumReactants()
Reaction
.
Reaction
.public long getNumProducts()
Reaction
.
Reaction
.public long getNumModifiers()
Reaction
.
Reaction
.public SpeciesReference removeReactant(long n)
Reaction
and returns a pointer to it.
The caller owns the returned object and is responsible for deleting it. The caller should first call getNumReactants() to find out how many reactants there are, to avoid using an invalid index number.
n
- the index of the reactant SpeciesReference
object to remove.
SpeciesReference
object, or null
if the
given index is out of range.public SpeciesReference removeReactant(java.lang.String species)
Reaction
and returns a pointer to it.
The caller owns the returned object and is responsible for deleting it.
species
- the 'species' attribute of the reactant SpeciesReference
object.
SpeciesReference
object, or null
if no
reactant SpeciesReference
object with the given 'species' attribute
species
exists in this Reaction
.public SpeciesReference removeProduct(long n)
Reaction
and returns a pointer to it.
The caller owns the returned object and is responsible for deleting it. The caller should first call getNumProducts() to find out how many products there are, to avoid using an invalid index number.
n
- the index of the product SpeciesReference
object to remove.
SpeciesReference
object, or null
if the
given index is out of range.public SpeciesReference removeProduct(java.lang.String species)
Reaction
and returns a pointer to it.
The caller owns the returned object and is responsible for deleting it.
species
- the 'species' attribute of the product SpeciesReference
object.
SpeciesReference
object, or null
if no
product SpeciesReference
object with the given 'species' attribute
species
exists in this Reaction
.public ModifierSpeciesReference removeModifier(long n)
Reaction
and returns a pointer to it.
The caller owns the returned object and is responsible for deleting it. The caller should first call getNumModifiers() to find out how many modifiers there are, to avoid using an invalid index number.
n
- the index of the ModifierSpeciesReference
object to remove.
ModifierSpeciesReference
object, or null
if the
given index is out of range.public ModifierSpeciesReference removeModifier(java.lang.String species)
Reaction
and returns a pointer to it.
The caller owns the returned object and is responsible for deleting it.
species
- the 'species' attribute of the ModifierSpeciesReference
object.
ModifierSpeciesReference
object, or null
if no
ModifierSpeciesReference
object with the given 'species' attribute @p
species exists in this Reaction
.public void connectToChild()
connectToChild
 in class SBase
public int getTypeCode()
LibSBML attaches an identifying code to every kind of SBML object. These
are integer constants known as SBML type codes. The names of all
the codes begin with the characters SBML_
.
In the Java language interface for libSBML, the
type codes are defined as static integer constants in the interface class
libsbmlConstants
. Note that different Level 3
package plug-ins may use overlapping type codes to identify the package
to which a given object belongs, call the getPackageName()
method on the object.
getTypeCode
 in class SBase
SBML_REACTION
(default).
Reaction.getElementName()
,
SBase.getPackageName()
public java.lang.String getElementName()
Reaction
, is
always 'reaction'.
getElementName
 in class SBase
'reaction'.
public boolean hasRequiredAttributes()
true
if all the required attributes for this
Reaction
object have been set.
The required attributes for a Reaction
object are:
hasRequiredAttributes
 in class SBase
true
if the required attributes have been set, false
otherwise.