org.sbml.jsbml
public abstract class ExplicitRule extends Rule implements Assignment, SBaseWithUnit
Rule
is a rule that explicitly declares its variable
element. Hence, this class provides methods to access and manipulate the
variable field of the underlying Rule
.Modifier and Type | Field and Description |
---|---|
private static long |
serialVersionUID
Generated serial version identifier.
|
protected java.lang.String |
unitsID
Deprecated.
This is a requirement for Level 1 Version 1 and Version 2,
but can only be used in conjunction with
Parameter s.
In this case this AssignmentRule represents the SBML
element ParameterRule. |
(package private) java.lang.String |
variableID
Represents the id of a
Variable . |
ignoredExtensions, ignoredXMLElements, lv
listOfListeners, parent, UNKNOWN_ATTRIBUTES, UNKNOWN_ELEMENTS
ILLEGAL_CONSTANT_VARIABLE_MSG, ILLEGAL_VARIABLE_EXCEPTION_MSG, NO_SUCH_VARIABLE_EXCEPTION_MSG
Constructor and Description |
---|
ExplicitRule()
Creates a new
ExplicitRule . |
ExplicitRule(ASTNode math,
int level,
int version)
Creates a new
ExplicitRule |
ExplicitRule(ASTNode math,
Variable variable)
Creates a new
ExplicitRule with the given ASTNode element
for the assignment to the given Variable or the derivative of the
Variable . |
ExplicitRule(ExplicitRule rule)
Creates a new
ExplicitRule |
ExplicitRule(int level,
int version)
Creates a new
ExplicitRule |
ExplicitRule(Parameter parameter)
Creates a new
ExplicitRule |
ExplicitRule(Parameter parameter,
ASTNode math)
Creates a new
ExplicitRule |
ExplicitRule(Variable variable)
Creates an
ExplicitRule instance from a given Variable . |
ExplicitRule(Variable variable,
ASTNode math)
Creates a new
ExplicitRule |
Modifier and Type | Method and Description |
---|---|
abstract ExplicitRule |
clone()
Creates a deep copy of this object, i.e., a new
SBase with the same properties
like this one. |
boolean |
equals(java.lang.Object object)
|
java.lang.String |
getUnits()
Deprecated.
This is a requirement for Level 1 Version 1 and Version 2,
but can only be used in conjunction with
Parameter s.
In this case this AssignmentRule represents the SBML
element ParameterRule. |
UnitDefinition |
getUnitsInstance()
Deprecated.
This is a requirement for Level 1 Version 1 and Version 2,
but can only be used in conjunction with
Parameter s.
In this case this AssignmentRule represents the SBML
element ParameterRule. |
java.lang.String |
getVariable()
Returns the variableID of this
Assignment . |
Variable |
getVariableInstance()
Returns the
Variable instance which has the variableID of this
Assignment as id. |
int |
hashCode()
Returns a hash code value for this
SBase instance. |
void |
initDefaults() |
boolean |
isCompartmentVolume()
(SBML Level 1 only) Predicate returning true or false depending on
whether this Rule is an CompartmentVolumeRule.
|
boolean |
isParameter()
(SBML Level 1 only) Predicate returning true or false depending on
whether this Rule is an ParameterRule.
|
abstract boolean |
isScalar()
Predicate returning true or false depending on whether this Rule is an
AssignmentRule (SBML Level 2) or has a 'type' attribute value of 'scalar'
(SBML Level 1).
|
boolean |
isSetUnits()
Deprecated.
This is a requirement for Level 1 Version 1 and Version 2,
but can only be used in conjunction with
Parameter s.
In this case this AssignmentRule represents the SBML
element ParameterRule. |
boolean |
isSetUnitsInstance()
Deprecated.
This is a requirement for Level 1 Version 1 and Version 2,
but can only be used in conjunction with
Parameter s.
In this case this AssignmentRule represents the SBML
element ParameterRule. |
boolean |
isSetVariable()
|
boolean |
isSetVariableInstance()
Returns
true if the Variable instance which has the variableID of
this Assignment as id is not null . |
boolean |
isSpeciesConcentration()
(SBML Level 1 only) Predicate returning
true or false depending on
whether this Rule is an SpeciesConcentrationRule. |
boolean |
readAttribute(java.lang.String attributeName,
java.lang.String prefix,
java.lang.String value)
Sets the given attribute in this
SBase . |
void |
setUnits(java.lang.String unitsID)
Deprecated.
This is a requirement for Level 1 Version 1 and Version 2,
but can only be used in conjunction with
Parameter s.
In this case this AssignmentRule represents the SBML
element ParameterRule. |
void |
setUnits(Unit.Kind unitKind)
Deprecated.
|
void |
setUnits(Unit unit)
Deprecated.
|
void |
setUnits(UnitDefinition units)
Deprecated.
This is a requirement for Level 1 Version 1 and Version 2,
but can only be used in conjunction with
Parameter s.
In this case this AssignmentRule represents the SBML
element ParameterRule. |
void |
setVariable(java.lang.String variable)
Sets the variableID of this
Assignment to the given value. |
void |
setVariable(Variable variable)
Sets the variableID of this
Assignment to the id of the
Variable 'variable'.Listeners are notified about this change. |
void |
unsetUnits()
Deprecated.
This is a requirement for Level 1 Version 1 and Version 2,
but can only be used in conjunction with
Parameter s.
In this case this ExplicitRule represents the SBML
element ParameterRule. |
void |
unsetVariable()
|
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. |
getParent, isAlgebraic, isAssignment, isRate
containsUndeclaredUnits, getAllowsChildren, getChildAt, getChildCount, getDerivedUnitDefinition, getDerivedUnits, getFormula, getMath, getMathMLString, isSetMath, setFormula, setMath, toString, unsetFormula, unsetMath
addCVTerm, addDeclaredNamespace, addExtension, addPlugin, appendNotes, appendNotes, checkLevelAndVersionCompatibility, createHistory, createPlugin, disablePackage, enablePackage, enablePackage, filterCVTerms, filterCVTerms, filterCVTerms, filterCVTerms, fireNodeRemovedEvent, firePropertyChange, getAnnotation, getAnnotationString, getCVTerm, getCVTermCount, getCVTerms, getDeclaredNamespaces, getElementName, getExtension, getExtensionCount, getExtensionPackages, getHistory, getIdManager, getLevel, getLevelAndVersion, getMetaId, getModel, getNamespace, getNotes, getNotesString, getNumCVTerms, getNumPlugins, getParentSBMLObject, getPlugin, getSBMLDocument, getSBOTerm, getSBOTermID, getVersion, hasValidAnnotation, hasValidLevelVersionNamespaceCombination, isExtendedByOtherPackages, isPackageEnabled, isPackageURIEnabled, isPkgEnabled, isPkgURIEnabled, isSetAnnotation, isSetHistory, isSetLevel, isSetLevelAndVersion, isSetMetaId, isSetNotes, isSetParentSBMLObject, isSetPlugin, isSetSBOTerm, isSetVersion, isValidLevelAndVersionCombination, isValidMetaId, notifyChildChange, registerChild, removeCVTerm, removeCVTerm, setAnnotation, setHistory, setLevel, setLevelAndVersion, setMetaId, setNamespace, setNotes, setNotes, setParentSBML, setParentSBMLObject, setSBOTerm, setSBOTerm, setThisAsParentSBMLObject, setVersion, unregisterChild, unsetAnnotation, unsetCVTerms, unsetExtension, unsetHistory, unsetMetaId, unsetNamespace, unsetNotes, unsetPlugin, unsetSBOTerm
addAllChangeListeners, addAllChangeListeners, addTreeNodeChangeListener, addTreeNodeChangeListener, children, clearUserObjects, containsUserObjectKey, filter, filter, filter, fireNodeAddedEvent, getIndex, getListOfTreeNodeChangeListeners, getNumChildren, getRoot, getTreeNodeChangeListenerCount, getUserObject, indexOf, isLeaf, isRoot, isSetParent, isSetUserObjects, putUserObject, removeAllTreeNodeChangeListeners, removeAllTreeNodeChangeListeners, removeFromParent, removeTreeNodeChangeListener, removeTreeNodeChangeListener, removeUserObject, setParent, userObjectKeySet
finalize, getClass, notify, notifyAll, wait, wait, wait
getFormula, getMath, getMathMLString, isSetMath, setFormula, setMath, unsetFormula, unsetMath
containsUndeclaredUnits, getDerivedUnitDefinition, getDerivedUnits
addCVTerm, addDeclaredNamespace, addExtension, addPlugin, appendNotes, appendNotes, createPlugin, disablePackage, enablePackage, enablePackage, filterCVTerms, filterCVTerms, filterCVTerms, filterCVTerms, getAnnotation, getAnnotationString, getCVTerm, getCVTermCount, getCVTerms, getDeclaredNamespaces, getElementName, getExtension, getExtensionCount, getExtensionPackages, getHistory, getLevel, getLevelAndVersion, getMetaId, getModel, getNamespace, getNotes, getNotesString, getNumCVTerms, getNumPlugins, getParentSBMLObject, getPlugin, getSBMLDocument, getSBOTerm, getSBOTermID, getVersion, hasValidAnnotation, hasValidLevelVersionNamespaceCombination, isExtendedByOtherPackages, isPackageEnabled, isPackageURIEnabled, isPkgEnabled, isPkgURIEnabled, isSetAnnotation, isSetHistory, isSetLevel, isSetLevelAndVersion, isSetMetaId, isSetNotes, isSetParentSBMLObject, isSetPlugin, isSetSBOTerm, isSetVersion, registerChild, removeCVTerm, removeCVTerm, removeTreeNodeChangeListener, setAnnotation, setHistory, setLevel, setMetaId, setNotes, setNotes, 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
@Deprecated protected java.lang.String unitsID
Parameter
s.
In this case this AssignmentRule
represents the SBML
element ParameterRule.java.lang.String variableID
Variable
. Matches the variable XML
attribute of an assignmentRule or rateRule element.public ExplicitRule()
ExplicitRule
.public ExplicitRule(ASTNode math, int level, int version)
ExplicitRule
math
- level
- version
- public ExplicitRule(ASTNode math, Variable variable)
ExplicitRule
with the given ASTNode
element
for the assignment to the given Variable
or the derivative of the
Variable
.math
- An assignmentvariable
- Either the variable itself or its derivative is to be modified
with the given.public ExplicitRule(ExplicitRule rule)
ExplicitRule
rule
- public ExplicitRule(int level, int version)
ExplicitRule
level
- version
- public ExplicitRule(Parameter parameter)
ExplicitRule
parameter
- public ExplicitRule(Parameter parameter, ASTNode math)
ExplicitRule
parameter
- math
- public ExplicitRule(Variable variable)
ExplicitRule
instance from a given Variable
.
Takes level and version from the variable.variable
- public ExplicitRule(Variable variable, ASTNode math)
ExplicitRule
variable
- math
- public abstract ExplicitRule clone()
SBase
SBase
with the same properties
like this one.public boolean equals(java.lang.Object object)
SBase
@Deprecated public java.lang.String getUnits()
Parameter
s.
In this case this AssignmentRule
represents the SBML
element ParameterRule.getUnits
in interface SBaseWithUnit
@Deprecated public UnitDefinition getUnitsInstance()
Parameter
s.
In this case this AssignmentRule
represents the SBML
element ParameterRule.getUnitsInstance
in interface SBaseWithUnit
public java.lang.String getVariable()
Assignment
Assignment
. Returns an empty
String
if it is not set.getVariable
in interface Assignment
Assignment
. Returns an empty
String
if it is not set.public Variable getVariableInstance()
Assignment
Variable
instance which has the variableID of this
Assignment
as id. Return null if it doesn't exist.getVariableInstance
in interface Assignment
Variable
instance which has the variableID of this
Assignment
as id. Return null if it doesn't exist.public int hashCode()
SBase
SBase
instance.hashCode
in interface SBase
hashCode
in class AbstractSBase
SBase
instance.Object.hashCode()
public void initDefaults()
public boolean isCompartmentVolume()
Rule
isCompartmentVolume
in class Rule
true
if this Rule is a CompartmentVolumeRule, false
otherwise.public boolean isParameter()
Rule
isParameter
in class Rule
true
if this Rule is a ParameterRule, false
otherwise.public abstract boolean isScalar()
true
if this Rule is an AssignmentRule (Level 2) or has type
'scalar' (Level 1), false
otherwise.@Deprecated public boolean isSetUnits()
Parameter
s.
In this case this AssignmentRule
represents the SBML
element ParameterRule.isSetUnits
in interface SBaseWithUnit
true
if the unitsID of this object is not null
.@Deprecated public boolean isSetUnitsInstance()
Parameter
s.
In this case this AssignmentRule
represents the SBML
element ParameterRule.SBaseWithUnit
unitsID
attribute of this SBaseWithUnit
is either an existing base
Unit
, i.e., a simple Unit
that can directly be addressed
via its Unit.Kind
element, or the identifier of an existing
UnitDefinition
in the Model
to which this
SBaseWithUnit
belongs.isSetUnitsInstance
in interface SBaseWithUnit
true
if the UnitsID of this object matches a no null
UniDefinition of the model instance.public boolean isSetVariable()
Assignment
isSetVariable
in interface Assignment
true
if the variableID of this Assignment
is not null
.public boolean isSetVariableInstance()
Assignment
true
if the Variable
instance which has the variableID of
this Assignment
as id is not null
.isSetVariableInstance
in interface Assignment
true
if the Variable
instance which has the variableID of
this Assignment
as id is not null
.public boolean isSpeciesConcentration()
Rule
true
or false
depending on
whether this Rule
is an SpeciesConcentrationRule.isSpeciesConcentration
in class Rule
true
if this Rule is a SpeciesConcentrationRule, false
otherwise.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 AbstractMathContainer
attributeName
- localName of the XML attributeprefix
- prefix of the XML attributevalue
- value of the XML attributetrue
if the attribute has been successfully read.@Deprecated public void setUnits(Unit.Kind unitKind)
SBaseWithUnit
SBaseWithUnit
.
A new unit will be created base on this kind.setUnits
in interface SBaseWithUnit
@Deprecated public void setUnits(java.lang.String unitsID)
Parameter
s.
In this case this AssignmentRule
represents the SBML
element ParameterRule.setUnits
in interface SBaseWithUnit
unitsID
- A valid identifier of a UnitDefinition
in the
Model
or the name of one of the Unit.Kind
base
types.PropertyNotAvailableException
- if Level is not 1.@Deprecated public void setUnits(Unit unit)
SBaseWithUnit
Unit
of this SBaseWithUnit
.setUnits
in interface SBaseWithUnit
@Deprecated public void setUnits(UnitDefinition units)
Parameter
s.
In this case this AssignmentRule
represents the SBML
element ParameterRule.setUnits
in interface SBaseWithUnit
units
- the unit of this rule.public void setVariable(java.lang.String variable)
Assignment
Assignment
to the given value. Listeners
are notified about this change.setVariable
in interface Assignment
variable
- the variable to setpublic void setVariable(Variable variable)
Assignment
Assignment
to the id of the
Variable
'variable'.Listeners are notified about this change.setVariable
in interface Assignment
variable
- the variable to set@Deprecated public void unsetUnits()
Parameter
s.
In this case this ExplicitRule
represents the SBML
element ParameterRule.ExplicitRule
.unsetUnits
in interface SBaseWithUnit
public void unsetVariable()
Assignment
Variable
if there was any, i.e., the Variable
is set to null
. Listeners
are notified about this change.unsetVariable
in interface Assignment
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 AbstractMathContainer
Map
containing the XML attributes of this object.