org.sbml.jsbml
public abstract class AbstractMathContainer extends AbstractSBase implements MathContainer
Modifier and Type | Field and Description |
---|---|
private static org.apache.log4j.Logger |
logger
A logger for user-messages.
|
private ASTNode |
math
The math formula as an abstract syntax tree.
|
private static long |
serialVersionUID
Generated serial version identifier.
|
lv
listOfListeners, parent
Constructor and Description |
---|
AbstractMathContainer()
Creates a MathContainer instance.
|
AbstractMathContainer(AbstractMathContainer sb)
Creates a MathContainer instance from a given MathContainer.
|
AbstractMathContainer(ASTNode math,
int level,
int version)
Creates a MathContainer instance from an ASTNode, level and version.
|
AbstractMathContainer(int level,
int version)
Creates a MathContainer instance from a level and version.
|
Modifier and Type | Method and Description |
---|---|
abstract AbstractMathContainer |
clone()
Creates a copy of this object, i.e., e new
SBase with the same properties
like this one and returns a pointer to it. |
boolean |
containsUndeclaredUnits()
Returns
true or false depending on whether this
SBaseWithDerivedUnit refers to elements such as parameters or
numbers with undeclared units. |
boolean |
getAllowsChildren() |
javax.swing.tree.TreeNode |
getChildAt(int index) |
int |
getChildCount() |
UnitDefinition |
getDerivedUnitDefinition()
This method derives the unit of this quantity and tries to identify an
equivalent
UnitDefinition within the corresponding Model . |
java.lang.String |
getDerivedUnits()
This method derives the unit of this quantity.
|
java.lang.String |
getFormula()
Deprecated.
|
ASTNode |
getMath()
If
MathContainer.isSetMath() returns true, this method returns the
ASTNode belonging to this MathContainer . |
java.lang.String |
getMathMLString()
If
MathContainer.isSetMath() returns true, this method returns the
corresponding MathML String , otherwise an empty String
will be returned. |
boolean |
isSetMath()
Checks if an
ASTNode has been set for this MathContainer . |
boolean |
readAttribute(java.lang.String attributeName,
java.lang.String prefix,
java.lang.String value)
If the attribute is an id or name attribute, it will set the id or name
of this object with the value of the XML attribute ('value').
|
void |
setFormula(java.lang.String formula)
Deprecated.
|
void |
setMath(ASTNode math)
Sets the math
ASTNode of this MathContainer to the given
value. |
java.lang.String |
toString() |
void |
unsetFormula()
Deprecated.
|
void |
unsetMath() |
java.util.Map<java.lang.String,java.lang.String> |
writeXMLAttributes() |
addCVTerm, addDeclaredNamespace, addNamespace, appendNotes, appendNotes, checkLevelAndVersionCompatibility, equals, filterCVTerms, filterCVTerms, fireNodeRemovedEvent, getAnnotation, getAnnotationString, getCVTerm, getCVTerms, getDeclaredNamespaces, getElementName, getHistory, getLevel, getLevelAndVersion, getMetaId, getModel, getNamespaces, getNotes, getNotesString, getNumCVTerms, getParent, getParentSBMLObject, getSBMLDocument, getSBOTerm, getSBOTermID, getVersion, hashCode, hasValidAnnotation, hasValidLevelVersionNamespaceCombination, isSetAnnotation, isSetHistory, isSetLevel, isSetLevelAndVersion, isSetMetaId, isSetNotes, isSetParentSBMLObject, isSetSBOTerm, isSetVersion, isValidLevelAndVersionCombination, notifyChildChange, registerChild, removeNamespace, setAnnotation, setHistory, setLevel, setLevelAndVersion, setMetaId, setNotes, setNotes, setParentSBML, setParentSBMLObject, setSBOTerm, setSBOTerm, setThisAsParentSBMLObject, setVersion, unregister, unsetAnnotation, unsetCVTerms, unsetHistory, unsetMetaId, unsetNotes, unsetSBOTerm
addAllChangeListeners, addTreeNodeChangeListener, addTreeNodeChangeListener, children, fireNodeAddedEvent, firePropertyChange, getIndex, getListOfTreeNodeChangeListeners, getNumChildren, getTreeNodeChangeListenerCount, indexOf, isLeaf, isRoot, isSetParent, removeAllTreeNodeChangeListeners, removeTreeNodeChangeListener, removeTreeNodeChangeListener, setParent
finalize, getClass, notify, notifyAll, wait, wait, wait
addCVTerm, addDeclaredNamespace, addNamespace, appendNotes, appendNotes, equals, filterCVTerms, filterCVTerms, getAnnotation, getAnnotationString, getCVTerm, getCVTerms, getDeclaredNamespaces, getElementName, getHistory, getLevel, getLevelAndVersion, getMetaId, getModel, getNamespaces, getNotes, getNotesString, getNumCVTerms, getParentSBMLObject, getSBMLDocument, getSBOTerm, getSBOTermID, getVersion, hashCode, hasValidAnnotation, hasValidLevelVersionNamespaceCombination, isSetAnnotation, isSetHistory, isSetLevel, isSetLevelAndVersion, isSetMetaId, isSetNotes, isSetParentSBMLObject, isSetSBOTerm, isSetVersion, registerChild, removeTreeNodeChangeListener, setAnnotation, setHistory, setLevel, setMetaId, setNotes, setNotes, setSBOTerm, setSBOTerm, setThisAsParentSBMLObject, setVersion, unregister, unsetAnnotation, unsetCVTerms, unsetHistory, unsetMetaId, unsetNotes, unsetSBOTerm
addAllChangeListeners, addTreeNodeChangeListener, addTreeNodeChangeListener, fireNodeAddedEvent, fireNodeRemovedEvent, firePropertyChange, getListOfTreeNodeChangeListeners, getTreeNodeChangeListenerCount, isRoot, isSetParent, removeAllTreeNodeChangeListeners, removeTreeNodeChangeListener
private static final long serialVersionUID
private static final org.apache.log4j.Logger logger
private ASTNode math
public AbstractMathContainer()
public AbstractMathContainer(AbstractMathContainer sb)
sb
- an AbstractMathContainer
object to clonepublic AbstractMathContainer(ASTNode math, int level, int version)
math
- the ASTNode representing the math.level
- the SBML levelversion
- the SBML versionpublic AbstractMathContainer(int level, int version)
level
- the SBML levelversion
- the SBML versionpublic abstract AbstractMathContainer clone()
SBase
SBase
with the same properties
like this one and returns a pointer to it.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 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 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
public java.lang.String getDerivedUnits()
SBaseWithDerivedUnit
Unit.Kind
this
method will return the String
representation of this
Unit.Kind
.getDerivedUnits
in interface SBaseWithDerivedUnit
@Deprecated public java.lang.String getFormula()
MathContainer
MathContainer
's internal ASTNode
to a
C-like String
according to the SBML Level 1 specifications and
returns it.getFormula
in interface MathContainer
ASTNode
of this object as a String. It returns
the empty String if the math ASTNode
is not set.MathContainer.getMath()
public ASTNode getMath()
MathContainer
MathContainer.isSetMath()
returns true, this method returns the
ASTNode
belonging to this MathContainer
.getMath
in interface MathContainer
ASTNode
of this object. It return null if the
math ASTNode
is not set.public java.lang.String getMathMLString()
MathContainer
MathContainer.isSetMath()
returns true, this method returns the
corresponding MathML String
, otherwise an empty String
will be returned.getMathMLString
in interface MathContainer
MathContainer
's math
element.public boolean isSetMath()
MathContainer
ASTNode
has been set for this MathContainer
.isSetMath
in interface MathContainer
ASTNode
of this object is not null.public boolean readAttribute(java.lang.String attributeName, java.lang.String prefix, java.lang.String value)
SBase
readAttribute
in interface SBase
readAttribute
in class AbstractSBase
attributeName
- : localName of the XML attributeprefix
- : prefix of the XML attributevalue
- : value of the XML attribute@Deprecated public void setFormula(java.lang.String formula) throws ParseException
MathContainer
MathContainer
instance
to the given formula. This method parses the given String
and
stores the result in an ASTNode
object.setFormula
in interface MathContainer
formula
- a C-like String
according to the definition in the
SBML Level 1 specifications.ParseException
- If the given formula is invalid or cannot be parsed properly.public void setMath(ASTNode math)
MathContainer
ASTNode
of this MathContainer
to the given
value.setMath
in interface MathContainer
math
- an abstract syntax tree.public java.lang.String toString()
toString
in class AbstractSBase
@Deprecated public void unsetFormula()
unsetFormula
in interface MathContainer
public void unsetMath()
unsetMath
in interface MathContainer
public java.util.Map<java.lang.String,java.lang.String> writeXMLAttributes()
writeXMLAttributes
in interface SBase
writeXMLAttributes
in class AbstractSBase
Map
containing the XML attributes of this object.