public class Reaction extends AbstractNamedSBase implements CallableSBase, CompartmentalizedSBase, UniqueNamedSBase
Modifier and Type | Field and Description |
---|---|
private java.lang.String |
compartmentID
Represents the 'compartment' XML attribute of a reaction element.
|
private java.lang.Boolean |
fast
Deprecated.
|
private boolean |
isSetFast
Checks whether the
fast attribute has been set by using a default or
by changing its value. |
private boolean |
isSetReversible
Checks whether the
reversible attribute has been set by using a default or
by changing its value. |
private KineticLaw |
kineticLaw
Represents the 'kineticLaw' XML subNode of a reaction element.
|
private ListOf<ModifierSpeciesReference> |
listOfModifiers
Represents the 'listOfModifiers' XML subNode of a reaction element.
|
private ListOf<SpeciesReference> |
listOfProducts
Represents the 'listOfProducts' XML subNode of a reaction element.
|
private ListOf<SpeciesReference> |
listOfReactants
Represents the 'listOfReactants' XML subNode of a reaction element.
|
private java.lang.Boolean |
reversible
Represents the 'reversible' XML attribute of a reaction element.
|
private static long |
serialVersionUID
Generated serial version identifier.
|
ignoredExtensions, ignoredXMLElements, JSBML_WRONG_SBO_TERM, lv, packageName
listOfListeners, parent, resourceBundle
Constructor and Description |
---|
Reaction()
Creates a Reaction instance.
|
Reaction(int level,
int version)
Creates a new Reaction instance from a given SBML level and version.
|
Reaction(Reaction reaction)
Creates a Reaction instance from a given reaction.
|
Reaction(java.lang.String id) |
Reaction(java.lang.String id,
int level,
int version)
Creates a
Reaction instance from an id, level and version. |
Modifier and Type | Method and Description |
---|---|
boolean |
addModifier(ModifierSpeciesReference modspecref)
Adds a
ModifierSpeciesReference instance to this Reaction . |
boolean |
addProduct(SpeciesReference specref)
Adds a
SpeciesReference instance to the listOfProducts of this Reaction . |
boolean |
addReactant(SpeciesReference specref)
Adds a
SpeciesReference instance to the listOfReactants of this Reaction . |
Reaction |
clone()
Creates a deep copy of this object, i.e., a new
SBase with the same
properties
like this one. |
boolean |
containsUndeclaredUnits()
Returns
true or false depending on whether this
SBaseWithDerivedUnit refers to elements such as parameters or
numbers with undeclared units. |
KineticLaw |
createKineticLaw()
Creates a new
KineticLaw object, installs it as this
Reaction 's 'kineticLaw' sub-element, and returns it. |
ModifierSpeciesReference |
createModifier()
Creates a new
ModifierSpeciesReference , adds it to this
Reaction 's list of modifiers and returns it. |
ModifierSpeciesReference |
createModifier(Species species)
Creates a new
ModifierSpeciesReference , which points to the given
Species , adds it to this Reaction 's
listOfModifiers , and returns a pointer to it. |
ModifierSpeciesReference |
createModifier(java.lang.String id) |
ModifierSpeciesReference |
createModifier(java.lang.String id,
Species species)
Creates a new
ModifierSpeciesReference with the given
id as its identifier, which points to the given
Species , adds it to this Reaction 's
listOfModifiers , and returns a pointer to it. |
ModifierSpeciesReference |
createModifier(java.lang.String id,
java.lang.String species)
Creates a new
ModifierSpeciesReference with the given
id as its identifier, which points to the Species
with the given id , adds it to this Reaction 's
listOfModifiers , and returns a pointer to it. |
SpeciesReference |
createProduct()
|
SpeciesReference |
createProduct(Species species)
Creates a new
SpeciesReference , which points to the given
Species , adds it to this Reaction 's
listOfProducts and returns a pointer to it. |
SpeciesReference |
createProduct(java.lang.String id) |
SpeciesReference |
createProduct(java.lang.String id,
Species species)
Creates a new
SpeciesReference with the given id as
its identifier, which points to the given Species , adds it to
this Reaction 's listOfProducts and returns a pointer to
it. |
SpeciesReference |
createProduct(java.lang.String id,
java.lang.String species) |
SpeciesReference |
createReactant()
|
SpeciesReference |
createReactant(Species species)
|
SpeciesReference |
createReactant(java.lang.String id)
Creates a new
SpeciesReference with the given identifier and adds
it to this Reaction 's listOfReactants . |
SpeciesReference |
createReactant(java.lang.String id,
Species species)
Creates a new
SpeciesReference with the given id as
identifier, which points to the given Species and adds it to the
listOfReactants . |
SpeciesReference |
createReactant(java.lang.String id,
java.lang.String species) |
boolean |
equals(java.lang.Object object)
|
boolean |
getAllowsChildren() |
javax.swing.tree.TreeNode |
getChildAt(int index) |
int |
getChildCount() |
java.lang.String |
getCompartment()
Only available if Level >= 3.
|
Compartment |
getCompartmentInstance()
Returns the
Compartment that is referenced by this SBase . |
UnitDefinition |
getDerivedUnitDefinition()
Derives the unit of this quantity and tries to identify an
equivalent
UnitDefinition within the corresponding Model . |
java.lang.String |
getDerivedUnits()
Derives the unit of this quantity.
|
boolean |
getFast()
Deprecated.
|
KineticLaw |
getKineticLaw() |
ListOf<ModifierSpeciesReference> |
getListOfModifiers() |
ListOf<SpeciesReference> |
getListOfProducts() |
ListOf<SpeciesReference> |
getListOfReactants() |
ModifierSpeciesReference |
getModifier(int i) |
ModifierSpeciesReference |
getModifier(java.lang.String id)
Searches the first
ModifierSpeciesReference in the
listOfModifiers of this Reaction with the given
identifier. |
int |
getModifierCount() |
ModifierSpeciesReference |
getModifierForSpecies(java.lang.String id)
Returns the first
ModifierSpeciesReference in the
listOfModifiers of this Reaction whose 'species'
attribute points to a Species with the given identifier. |
int |
getNumModifiers() |
int |
getNumProducts() |
int |
getNumReactants() |
ListOf<Reaction> |
getParent()
This is equivalent to calling
AbstractSBase.getParentSBMLObject() , but this
method is needed for TreeNode . |
SpeciesReference |
getProduct(int i) |
SpeciesReference |
getProduct(java.lang.String id)
Searches the first
SpeciesReference in the listOfProducts of this
Reaction with the given identifier. |
int |
getProductCount() |
SpeciesReference |
getProductForSpecies(java.lang.String id)
Returns the first
SpeciesReference in the listOfProducts
of this Reaction whose 'species' attribute points to a
Species with the given identifier. |
SpeciesReference |
getReactant(int i) |
SpeciesReference |
getReactant(java.lang.String id)
Searches the first
SpeciesReference in the listOfReactants of
this Reaction with the given identifier. |
int |
getReactantCount() |
SpeciesReference |
getReactantForSpecies(java.lang.String id)
Returns the first
SpeciesReference in the
listOfReactants of this Reaction whose 'species'
attribute points to a Species with the given identifier. |
boolean |
getReversible() |
int |
hashCode()
Returns a hash code value for this
SBase instance. |
boolean |
hasModifier(Species s) |
boolean |
hasProduct(Species s) |
boolean |
hasReactant(Species s) |
void |
initDefaults()
Initializes the default values using the current Level/Version configuration.
|
void |
initDefaults(int level,
int version)
Initializes the default variables of this Reaction.
|
void |
initDefaults(int level,
int version,
boolean explicit) |
boolean |
involves(Species s)
Convenient test if the given species takes part in this reaction as a
reactant, product, or modifier.
|
boolean |
isCompartmentMandatory() |
boolean |
isFast()
Deprecated.
|
boolean |
isIdMandatory()
Returns
true if the identifier of this
SBase is required to be defined (i.e., not null )
in the definition of SBML. |
boolean |
isListOfModifiersEmpty()
Returns
true if the listOfModifiers of this Reaction is empty. |
boolean |
isListOfProductsEmpty()
Returns
true if the listOfProducts of this reaction is empty. |
boolean |
isListOfReactantsEmpty()
Returns
true if the listOfReactants of this Reaction is empty. |
boolean |
isReversible() |
boolean |
isSetCompartment() |
boolean |
isSetCompartmentInstance() |
boolean |
isSetFast() |
boolean |
isSetKineticLaw() |
boolean |
isSetListOfModifiers() |
boolean |
isSetListOfProducts() |
boolean |
isSetListOfReactants() |
boolean |
isSetReversible() |
boolean |
readAttribute(java.lang.String attributeName,
java.lang.String prefix,
java.lang.String value)
Sets the given attribute in this
SBase . |
private boolean |
references(ListOf<? extends SimpleSpeciesReference> list,
Species s)
Checks whether the given list references the given species.
|
private <T extends SimpleSpeciesReference> |
remove(ListOf<T> list,
java.lang.String id) |
ModifierSpeciesReference |
removeModifier(int i)
Removes the nth modifier species (ModifierSpeciesReference object) in the
list of modifiers in this Reaction and returns it.
|
boolean |
removeModifier(ModifierSpeciesReference modspecref)
Removes the ModifierSpeciesReference 'modspecref' from this Reaction.
|
ModifierSpeciesReference |
removeModifier(java.lang.String id)
Removes the modifier species (ModifierSpeciesReference object) having the
given 'species' attribute in the list of modifiers in this Reaction and
returns it.
|
SpeciesReference |
removeProduct(int i)
Removes the nth product species (SpeciesReference object) in the list of
products in this Reaction and returns it.
|
void |
removeProduct(SpeciesReference specref)
Removes the SpeciesReference 'modspecref' from the listOfProducts of this
Reaction.
|
SpeciesReference |
removeProduct(java.lang.String id)
Removes the product species (SpeciesReference object) having the given
'species' attribute in the list of products in this Reaction and returns
it.
|
SpeciesReference |
removeReactant(int i)
Removes the nth reactant species (SpeciesReference object) in the list of
reactants in this Reaction and returns it.
|
boolean |
removeReactant(SpeciesReference specref)
Removes the SpeciesReference 'modspecref' from the listOfReactants of
this Reaction.
|
SpeciesReference |
removeReactant(java.lang.String id)
Removes the reactant species (SpeciesReference object) having the given
'species' attribute in the list of reactants in this Reaction and returns
it.
|
boolean |
setCompartment(Compartment compartment)
Sets the compartment identifiers of this
CompartmentalizedSBase to
the id of the Compartment 'compartment'. |
boolean |
setCompartment(java.lang.String compartmentID)
Sets the compartmentID of this Reaction to 'compartmentID'.
|
void |
setFast(boolean fast)
Deprecated.
|
void |
setKineticLaw(KineticLaw kineticLaw)
Sets the kineticLaw of this
Reaction . |
void |
setListOfModifiers(ListOf<ModifierSpeciesReference> listOfModifiers)
Sets the listOfModifiers of this
Reaction . |
void |
setListOfProducts(ListOf<SpeciesReference> listOfProducts)
Sets the
listOfProducts of this Reaction . |
void |
setListOfReactants(ListOf<SpeciesReference> listOfReactants)
Sets the listOfReactants of this
Reaction . |
void |
setReversible(boolean reversible)
Sets the reversible Boolean of this
Reaction . |
boolean |
unsetCompartment()
Remove the reference to a compartment, i.e., unset the value of the
variable 'compartment'.
|
void |
unsetFast()
Deprecated.
|
boolean |
unsetKineticLaw()
|
boolean |
unsetListOfModifiers()
Removes the
listOfModifiers from this Reaction and notifies
all registered instances of TreeNodeChangeListener . |
boolean |
unsetListOfProducts()
Removes the
listOfProducts from this Reaction and notifies
all registered instances of TreeNodeChangeListener . |
boolean |
unsetListOfReactants()
Removes the
listOfReactants from this Reaction and notifies
all registered instances of TreeNodeChangeListener . |
void |
unsetReversible()
Sets the reversible Boolean of this
Reaction to null . |
java.util.Map<java.lang.String,java.lang.String> |
writeXMLAttributes()
Returns a map with all the attributes of this
SBase that
need to be written out in XML. |
isValidId
addCVTerm, addDeclaredNamespace, addExtension, addPlugin, appendAnnotation, appendAnnotation, appendNotes, appendNotes, checkAndSetPackageNamespaceAndVersion, checkAndSetPackageNamespaceAndVersion, checkAttribute, checkIdentifier, checkLevelAndVersionCompatibility, createHistory, createPlugin, disablePackage, enablePackage, enablePackage, filterCVTerms, filterCVTerms, filterCVTerms, filterCVTerms, fireNodeRemovedEvent, firePropertyChange, getAnnotation, getAnnotationString, getCVTerm, getCVTermCount, getCVTerms, getDeclaredNamespaces, getElementByMetaId, getElementBySId, getElementName, getExtension, getExtensionCount, getExtensionPackages, getHistory, getId, getIdManager, getLevel, getLevelAndVersion, getMetaId, getModel, getName, getNamespace, getNotes, getNotesString, getNumCVTerms, getNumPlugins, getPackageName, getPackageVersion, getParentSBMLObject, getPlugin, getSBMLDocument, getSBOTerm, getSBOTermID, getURI, getVersion, hasValidAnnotation, hasValidLevelVersionNamespaceCombination, isExtendedByOtherPackages, isPackageEnabled, isPackageURIEnabled, isPkgEnabled, isPkgURIEnabled, isSetAnnotation, isSetHistory, isSetId, isSetLevel, isSetLevelAndVersion, isSetMetaId, isSetName, isSetNotes, isSetPackageVErsion, isSetParentSBMLObject, isSetPlugin, isSetSBOTerm, isSetVersion, isValidLevelAndVersionCombination, isValidMetaId, notifyChildChange, registerChild, removeCVTerm, removeCVTerm, setAnnotation, setAnnotation, setAnnotation, setHistory, setId, setLevel, setLevelAndVersion, setMetaId, setName, setNamespace, setNotes, setNotes, setPackageNamespaceAndVersion, setPackageVersion, setParentSBML, setParentSBMLObject, setSBOTerm, setSBOTerm, setThisAsParentSBMLObject, setVersion, toString, unregisterChild, unsetAnnotation, unsetCVTerms, unsetExtension, unsetHistory, unsetId, unsetMetaId, unsetName, unsetNamespace, unsetNotes, unsetPlugin, unsetSBOTerm
addAllChangeListeners, addAllChangeListeners, addTreeNodeChangeListener, addTreeNodeChangeListener, children, clearUserObjects, containsUserObjectKey, filter, filter, filter, fireNodeAddedEvent, getIndex, getListOfTreeNodeChangeListeners, getNumChildren, getRoot, getTreeNodeChangeListenerCount, getUserObject, indexOf, isLeaf, isReadingInProgress, isRoot, isSetParent, isSetUserObjects, putUserObject, removeAllTreeNodeChangeListeners, removeAllTreeNodeChangeListeners, removeFromParent, removeTreeNodeChangeListener, removeTreeNodeChangeListener, removeUserObject, setParent, userObjectKeySet
finalize, getClass, notify, notifyAll, wait, wait, wait
getId, getName, isSetId, isSetName, setId, setName, unsetId, unsetName
addCVTerm, addDeclaredNamespace, addExtension, addPlugin, appendAnnotation, appendAnnotation, appendNotes, appendNotes, createPlugin, disablePackage, enablePackage, enablePackage, filterCVTerms, filterCVTerms, filterCVTerms, filterCVTerms, getAnnotation, getAnnotationString, getCVTerm, getCVTermCount, getCVTerms, getDeclaredNamespaces, getElementByMetaId, getElementBySId, getElementName, getExtension, getExtensionCount, getExtensionPackages, getHistory, getLevel, getLevelAndVersion, getMetaId, getModel, getNamespace, getNotes, getNotesString, getNumCVTerms, getNumPlugins, getPackageName, getPackageVersion, getParentSBMLObject, getPlugin, getSBMLDocument, getSBOTerm, getSBOTermID, getURI, getVersion, hasValidAnnotation, hasValidLevelVersionNamespaceCombination, isExtendedByOtherPackages, isPackageEnabled, isPackageURIEnabled, isPkgEnabled, isPkgURIEnabled, isSetAnnotation, isSetHistory, isSetLevel, isSetLevelAndVersion, isSetMetaId, isSetNotes, isSetPackageVErsion, isSetParentSBMLObject, isSetPlugin, isSetSBOTerm, isSetVersion, registerChild, removeCVTerm, removeCVTerm, removeTreeNodeChangeListener, setAnnotation, setAnnotation, setAnnotation, setHistory, setLevel, setMetaId, setNotes, setNotes, setPackageVersion, setSBOTerm, setSBOTerm, setThisAsParentSBMLObject, setVersion, unregisterChild, unsetAnnotation, unsetCVTerms, unsetExtension, unsetHistory, unsetMetaId, unsetNotes, unsetPlugin, unsetSBOTerm
addAllChangeListeners, addAllChangeListeners, addTreeNodeChangeListener, addTreeNodeChangeListener, clearUserObjects, containsUserObjectKey, filter, filter, filter, fireNodeAddedEvent, fireNodeRemovedEvent, firePropertyChange, getListOfTreeNodeChangeListeners, getRoot, getTreeNodeChangeListenerCount, getUserObject, isRoot, isSetParent, isSetUserObjects, putUserObject, removeAllTreeNodeChangeListeners, removeAllTreeNodeChangeListeners, removeFromParent, removeTreeNodeChangeListener, removeUserObject, userObjectKeySet
private static final long serialVersionUID
private java.lang.String compartmentID
@Deprecated private java.lang.Boolean fast
private boolean isSetFast
fast
attribute has been set by using a default or
by changing its value.private boolean isSetReversible
reversible
attribute has been set by using a default or
by changing its value.private KineticLaw kineticLaw
private ListOf<ModifierSpeciesReference> listOfModifiers
private ListOf<SpeciesReference> listOfProducts
private ListOf<SpeciesReference> listOfReactants
private java.lang.Boolean reversible
public Reaction()
listOfReactants
, listOfProducts
and
listOfModifiers
are empty.public Reaction(int level, int version)
level
- the SBML levelversion
- the SBML versionpublic Reaction(Reaction reaction)
reaction
- public Reaction(java.lang.String id)
id
- public Reaction(java.lang.String id, int level, int version)
Reaction
instance from an id, level and version. By default,
the compartmentID, kineticLaw
, listOfReactants
, listOfProducts
and
listOfModifiers
are empty.id
- level
- version
- public boolean addModifier(ModifierSpeciesReference modspecref)
ModifierSpeciesReference
instance to this Reaction
.modspecref
- true
if the listOfModifiers
was
changed as a result of this call.public boolean addProduct(SpeciesReference specref)
SpeciesReference
instance to the listOfProducts of this Reaction
.specref
- true
if the listOfProducts
was
changed as a result of this call.public boolean addReactant(SpeciesReference specref)
SpeciesReference
instance to the listOfReactants of this Reaction
.specref
- true
if the listOfReactants
was
changed as a result of this call.public Reaction clone()
SBase
SBase
with the same
properties
like this one.clone
in interface SBase
clone
in class AbstractSBase
public boolean containsUndeclaredUnits()
SBaseWithDerivedUnit
true
or false
depending on whether this
SBaseWithDerivedUnit
refers to elements such as parameters or
numbers with undeclared units.
A return value of true indicates that the UnitDefinition
returned by SBaseWithDerivedUnit.getDerivedUnitDefinition()
may not accurately
represent the units of the expression.containsUndeclaredUnits
in interface SBaseWithDerivedUnit
true
if the math expression of this SBaseWithDerivedUnit
includes parameters/numbers with undeclared units,
false
otherwise.public KineticLaw createKineticLaw()
KineticLaw
object, installs it as this
Reaction
's 'kineticLaw' sub-element, and returns it.
If this Reaction
had a previous KineticLaw, it will be destroyed.KineticLaw
objectpublic ModifierSpeciesReference createModifier()
ModifierSpeciesReference
, adds it to this
Reaction
's list of modifiers and returns it.ModifierSpeciesReference
object.public ModifierSpeciesReference createModifier(Species species)
ModifierSpeciesReference
, which points to the given
Species
, adds it to this Reaction
's
listOfModifiers
, and returns a pointer to it.species
- the Species
to which this modifier should point.createModifier(String, Species)
public ModifierSpeciesReference createModifier(java.lang.String id)
id
- public ModifierSpeciesReference createModifier(java.lang.String id, Species species)
ModifierSpeciesReference
with the given
id
as its identifier, which points to the given
Species
, adds it to this Reaction
's
listOfModifiers
, and returns a pointer to it.id
- the identifier of the ModifierSpeciesReference
to be
created.species
- the Species
to which this modifier should point.ModifierSpeciesReference
.public ModifierSpeciesReference createModifier(java.lang.String id, java.lang.String species)
ModifierSpeciesReference
with the given
id
as its identifier, which points to the Species
with the given id
, adds it to this Reaction
's
listOfModifiers
, and returns a pointer to it.id
- the identifier of the ModifierSpeciesReference
to be
created.species
- the identifier of the Species
to be referenced.ModifierSpeciesReference
.public SpeciesReference createProduct()
SpeciesReference
object.public SpeciesReference createProduct(Species species)
SpeciesReference
, which points to the given
Species
, adds it to this Reaction
's
listOfProducts
and returns a pointer to it.species
- the Species
to which the SpeciesReference
should point.SpeciesReference
that has
been added to this Reaction
's listOfProducts
.createProduct(String, Species)
public SpeciesReference createProduct(java.lang.String id)
id
- public SpeciesReference createProduct(java.lang.String id, Species species)
SpeciesReference
with the given id
as
its identifier, which points to the given Species
, adds it to
this Reaction
's listOfProducts
and returns a pointer to
it.id
- the identifier of the SpeciesReference
to be created.species
- the Species
to which the SpeciesReference
should point.SpeciesReference
that has
been added to this Reaction
's listOfProducts
.public SpeciesReference createProduct(java.lang.String id, java.lang.String species)
id
- species
- public SpeciesReference createReactant()
public SpeciesReference createReactant(Species species)
species
- SpeciesReference
that
points to the given Species
.createReactant(String, Species)
public SpeciesReference createReactant(java.lang.String id)
SpeciesReference
with the given identifier and adds
it to this Reaction
's listOfReactants
.id
- the id of the SpeciesReference
that is to be created.SpeciesReference
, which is already linked
to this Reaction
.public SpeciesReference createReactant(java.lang.String id, Species species)
SpeciesReference
with the given id
as
identifier, which points to the given Species
and adds it to the
listOfReactants
.id
- the identifier of the SpeciesReference
to be created.species
- the Species
to which this reactant should point.SpeciesReference
.public SpeciesReference createReactant(java.lang.String id, java.lang.String species)
id
- species
- public boolean equals(java.lang.Object object)
SBase
public boolean getAllowsChildren()
getAllowsChildren
in interface javax.swing.tree.TreeNode
getAllowsChildren
in class AbstractSBase
public javax.swing.tree.TreeNode getChildAt(int index)
getChildAt
in interface javax.swing.tree.TreeNode
getChildAt
in class AbstractSBase
public int getChildCount()
getChildCount
in interface javax.swing.tree.TreeNode
getChildCount
in class AbstractSBase
public java.lang.String getCompartment()
getCompartment
in interface CompartmentalizedSBase
Reaction
. The empty
String
if it is not set.public Compartment getCompartmentInstance()
CompartmentalizedSBase
Compartment
that is referenced by this SBase
.
Note that the return type of this method is NamedSBase
because it
could be possible that some subclasses link other elements than
Compartment
.getCompartmentInstance
in interface CompartmentalizedSBase
Model
that represents the linked
Compartment
or null
if it does not exist or cannot
be retrieved (e.g., if this component has not yet been linked to a
Model
).public UnitDefinition getDerivedUnitDefinition()
SBaseWithDerivedUnit
UnitDefinition
within the corresponding Model
.
If no equivalent unit definition can be found, a new unit definition will
be created that is not part of the model but represents the unit of this
quantity. If it is not possible to derive a unit for this quantity, null
will be returned.getDerivedUnitDefinition
in interface SBaseWithDerivedUnit
UnitDefinition
that represent the derived unit of this quantity, or null
if it is not possible to derive a unit.public java.lang.String getDerivedUnits()
SBaseWithDerivedUnit
Unit.Kind
this
method will return the String
representation of this
Unit.Kind
.getDerivedUnits
in interface SBaseWithDerivedUnit
String
that represent the id of a UnitDefinition
. This UnitDefinition
represent the derived unit of this quantity. If it is not possible to derive a unit for this quantity
or if no equivalent UnitDefinition
can be found in the Model
, null is returned.@Deprecated public boolean getFast()
In SBML Level 3 Version 2, the fast attribute has been removed: every Reaction in a Level 3 Version 2 Core
model is equivalent to an SBML Level 3 Version 1 Reaction with a fast value of 'false'. This means that
for Level 3 Version 2 Core, the speed of every Reaction will always be determined by its KineticLaw. To
achieve the same or similar effects as setting the fast attribute to 'true' in a previous version of SBML,
the KineticLaw
should be constructed to produce a value in the desired time scale, or the reaction can be
replaced with an AssignmentRule
or AlgebraicRule
object as in the example of Section 7.5 on p. 122
of the SBML Level 3 Version 2 specification.
PropertyNotAvailableException
- if used for SBML L3V2 or above.public KineticLaw getKineticLaw()
public ListOf<ModifierSpeciesReference> getListOfModifiers()
public ListOf<SpeciesReference> getListOfProducts()
public ListOf<SpeciesReference> getListOfReactants()
public ModifierSpeciesReference getModifier(int i)
i
- public ModifierSpeciesReference getModifier(java.lang.String id)
ModifierSpeciesReference
in the
listOfModifiers
of this Reaction
with the given
identifier.id
- identifier of the desired ModifierSpeciesReference
.
Note that this is not the identifier of the Species
.ModifierSpeciesReference
of the
listOfModifiers
which has 'id' as id (or name depending
on the level and version). Can be null if it doesn't exist.public int getModifierCount()
ModifierSpeciesReference
s of this
Reaction
.public ModifierSpeciesReference getModifierForSpecies(java.lang.String id)
ModifierSpeciesReference
in the
listOfModifiers
of this Reaction
whose 'species'
attribute points to a Species
with the given identifier.id
- The identifier of a referenced Species
ModifierSpeciesReference
of the
listOfModifiers
which has 'id' as species attribute (or
name depending on the level and version). Can be null if it
doesn't exist.public int getNumModifiers()
ModifierSpeciesReference
s of this
Reaction
.public int getNumProducts()
SpeciesReference
.public int getNumReactants()
SpeciesReference
.public ListOf<Reaction> getParent()
AbstractSBase
AbstractSBase.getParentSBMLObject()
, but this
method is needed for TreeNode
.getParent
in interface javax.swing.tree.TreeNode
getParent
in class AbstractSBase
AbstractSBase.getParentSBMLObject()
public SpeciesReference getProduct(int i)
i
- public SpeciesReference getProduct(java.lang.String id)
SpeciesReference
in the listOfProducts of this
Reaction
with the given identifier.id
- identifier of the desired SpeciesReference
. Note that
this is not the identifier of the Species
.SpeciesReference
of the listOfProducts
which has 'id' as id
(or name depending on the level and version). Can be null if it
doesn't exist.public int getProductCount()
SpeciesReference
.public SpeciesReference getProductForSpecies(java.lang.String id)
SpeciesReference
in the listOfProducts
of this Reaction
whose 'species' attribute points to a
Species
with the given identifier.id
- The identifier of a referenced Species
SpeciesReference
of the listOfProducts
which
has 'id' as species attribute (or name depending on the level and
version). Can be null if it doesn't exist.public SpeciesReference getReactant(int i)
i
- SpeciesReference
of the listOfReactants.
Can be null if it doesn't exist.public SpeciesReference getReactant(java.lang.String id)
SpeciesReference
in the listOfReactants of
this Reaction
with the given identifier.id
- identifier of the desired SpeciesReference
. Note that
this is not the identifier of the Species
.SpeciesReference
of the listOfReactants which has
'id' as id (or name depending on the level and version). Can be
null if it doesn't exist.public int getReactantCount()
SpeciesReference
.public SpeciesReference getReactantForSpecies(java.lang.String id)
SpeciesReference
in the
listOfReactants
of this Reaction
whose 'species'
attribute points to a Species
with the given identifier.id
- The identifier of a referenced Species
SpeciesReference
of the listOfReactants
which has 'id' as species attribute (or name depending on the
level and version). Can be null if it doesn't exist.public boolean getReversible()
public int hashCode()
SBase
SBase
instance.hashCode
in interface SBase
hashCode
in class AbstractSBase
SBase
instance.Object.hashCode()
public boolean hasModifier(Species s)
s
- public boolean hasProduct(Species s)
s
- public boolean hasReactant(Species s)
s
- public void initDefaults()
public void initDefaults(int level, int version)
level
- version
- public void initDefaults(int level, int version, boolean explicit)
level
- version
- explicit
- public boolean involves(Species s)
s
- public boolean isCompartmentMandatory()
isCompartmentMandatory
in interface CompartmentalizedSBase
true
if for this object the compartment attribute is
mandatory, false
otherwise.@Deprecated public boolean isFast()
false
otherwise.
In SBML Level 3 Version 2, the fast attribute has been removed: every Reaction in a Level 3 Version 2 Core
model is equivalent to an SBML Level 3 Version 1 Reaction with a fast value of 'false'. This means that
for Level 3 Version 2 Core, the speed of every Reaction will always be determined by its KineticLaw. To
achieve the same or similar effects as setting the fast attribute to 'true' in a previous version of SBML,
the KineticLaw
should be constructed to produce a value in the desired time scale, or the reaction can be
replaced with an AssignmentRule
or AlgebraicRule
object as in the example of Section 7.5 on p. 122
of the SBML Level 3 Version 2 specification.
false
otherwise.PropertyNotAvailableException
- if used for SBML L3V2 or above.getFast()
public boolean isIdMandatory()
SBase
true
if the identifier of this
SBase
is required to be defined (i.e., not null
)
in the definition of SBML.isIdMandatory
in interface NamedSBase
isIdMandatory
in interface SBase
isIdMandatory
in class AbstractSBase
true
if the identifier of this element must be set in
order to create a valid SBML representation. false
otherwise, i.e., if the identifier can be understood as an optional
attribute.public boolean isListOfModifiersEmpty()
true
if the listOfModifiers of this Reaction is empty.true
if the listOfModifiers of this Reaction is empty.public boolean isListOfProductsEmpty()
true
if the listOfProducts of this reaction is empty.true
if the listOfProducts of this reaction is empty.public boolean isListOfReactantsEmpty()
true
if the listOfReactants of this Reaction is empty.true
if the listOfReactants of this Reaction is empty.public boolean isReversible()
false
otherwise.public boolean isSetCompartment()
isSetCompartment
in interface CompartmentalizedSBase
true
if compartment attribute is set, i.e., not
null
, false
otherwise.public boolean isSetCompartmentInstance()
isSetCompartmentInstance
in interface CompartmentalizedSBase
true
if the Compartment
which has the compartment
identifier stored in this CompartmentalizedSBase
as id is
not null
and this Compartment
can be retrieved from
the Model
that contains this CompartmentalizedSBase
.
In other words, this method also returns false
if the
this object is not linked to any model.public boolean isSetFast()
true
if fast is not null
.public boolean isSetKineticLaw()
true
if the kineticLaw of this Reaction is not null
.public boolean isSetListOfModifiers()
true
if the listOfModifiers of this Reaction is not true
and not
empty.public boolean isSetListOfProducts()
true
if the listOfProducts of this reaction is not true
and not
empty.public boolean isSetListOfReactants()
true
if the listOfReactants of this Reaction is not true
and not
empty.public boolean isSetReversible()
true
if reversible is not null
.public boolean readAttribute(java.lang.String attributeName, java.lang.String prefix, java.lang.String value)
SBase
SBase
.
If the given attribute name is not recognized, nothing is done and
false
is returned.
readAttribute
in interface SBase
readAttribute
in class AbstractSBase
attributeName
- localName of the XML attributeprefix
- prefix of the XML attributevalue
- value of the XML attributetrue
if the attribute has been successfully read.private boolean references(ListOf<? extends SimpleSpeciesReference> list, Species s)
list
- s
- private <T extends SimpleSpeciesReference> T remove(ListOf<T> list, java.lang.String id)
list
- id
- public ModifierSpeciesReference removeModifier(int i)
i
- the index of the ModifierSpeciesReference object to remove.public boolean removeModifier(ModifierSpeciesReference modspecref)
modspecref
- public ModifierSpeciesReference removeModifier(java.lang.String id)
id
- the 'species' attribute of the ModifierSpeciesReference object
(which correspond to a species id).public SpeciesReference removeProduct(int i)
i
- the index of the SpeciesReference object to remove.public void removeProduct(SpeciesReference specref)
specref
- public SpeciesReference removeProduct(java.lang.String id)
id
- the 'species' attribute of the SpeciesReference object (which
correspond to a species id).public SpeciesReference removeReactant(int i)
i
- the index of the SpeciesReference object to remove.public boolean removeReactant(SpeciesReference specref)
specref
- public SpeciesReference removeReactant(java.lang.String id)
id
- the 'species' attribute of the SpeciesReference object (which
correspond to a species id).public boolean setCompartment(Compartment compartment)
CompartmentalizedSBase
CompartmentalizedSBase
to
the id of the Compartment
'compartment'.
The compartment attribute is used to add a reference to the id of
the corresponding Compartment
in the Model
.
In some situations, the compartment might be optional, so that the user can
even specify Compartment
s that are not part of the Model
.
setCompartment
in interface CompartmentalizedSBase
compartment
- the Compartment
whose identifier should be referenced.true
if this operation caused any change.CompartmentalizedSBase.setCompartment(String)
,
CompartmentalizedSBase.isCompartmentMandatory()
public boolean setCompartment(java.lang.String compartmentID)
setCompartment
in interface CompartmentalizedSBase
compartmentID
- true
if this operation caused any change.PropertyNotAvailableException
- if Level < 3.CompartmentalizedSBase.setCompartment(Compartment)
,
CompartmentalizedSBase.isCompartmentMandatory()
@Deprecated public void setFast(boolean fast)
Reaction
.
In SBML Level 3 Version 2, the fast attribute has been removed: every Reaction in a Level 3 Version 2 Core
model is equivalent to an SBML Level 3 Version 1 Reaction with a fast value of 'false'. This means that
for Level 3 Version 2 Core, the speed of every Reaction will always be determined by its KineticLaw. To
achieve the same or similar effects as setting the fast attribute to 'true' in a previous version of SBML,
the KineticLaw
should be constructed to produce a value in the desired time scale, or the reaction can be
replaced with an AssignmentRule
or AlgebraicRule
object as in the example of Section 7.5 on p. 122
of the SBML Level 3 Version 2 specification.
fast
- - the value to set for the fast attributePropertyNotAvailableException
- if used for SBML L3V2 or above.public void setKineticLaw(KineticLaw kineticLaw)
Reaction
.kineticLaw
- public void setListOfModifiers(ListOf<ModifierSpeciesReference> listOfModifiers)
Reaction
. Automatically sets the
parentSBML object of the list to this Reaction
instance.listOfModifiers
- public void setListOfProducts(ListOf<SpeciesReference> listOfProducts)
listOfProducts
of this Reaction
. Automatically sets the
parentSBML object of the list to this Reaction
instance.listOfProducts
- public void setListOfReactants(ListOf<SpeciesReference> listOfReactants)
Reaction
. Automatically sets the
parentSBML object of the list to this Reaction
instance.listOfReactants
- public void setReversible(boolean reversible)
Reaction
.reversible
- public boolean unsetCompartment()
CompartmentalizedSBase
unsetCompartment
in interface CompartmentalizedSBase
true
if compartment was set before, otherwise false
.@Deprecated public void unsetFast()
null
.public boolean unsetKineticLaw()
true
if calling this method changed the properties
of this element.public boolean unsetListOfModifiers()
listOfModifiers
from this Reaction
and notifies
all registered instances of TreeNodeChangeListener
.true
if calling this method lead to a change in this
data structure.public boolean unsetListOfProducts()
listOfProducts
from this Reaction
and notifies
all registered instances of TreeNodeChangeListener
.true
if calling this method lead to a change in this
data structure.public boolean unsetListOfReactants()
listOfReactants
from this Reaction
and notifies
all registered instances of TreeNodeChangeListener
.true
if calling this method lead to a change in this
data structure.public void unsetReversible()
Reaction
to null
.public java.util.Map<java.lang.String,java.lang.String> writeXMLAttributes()
SBase
SBase
that
need to be written out in XML.
The attribute name is used as a key and the attribute value as value. If a prefix is needed for the attribute name, it need to be set directly in this map.
writeXMLAttributes
in interface SBase
writeXMLAttributes
in class AbstractSBase
Map
containing the XML attributes of this object.