org.sbml.jsbml.math
public abstract class AbstractASTNode extends AbstractTreeNode implements ASTNode2
Modifier and Type | Field and Description |
---|---|
private static org.apache.log4j.Logger |
logger
A
Logger for this class. |
protected MathContainer |
parentSBMLObject
The container that holds this AbstractASTNode.
|
protected boolean |
strict
Specifies strictness.
|
protected ASTNode.Type |
type
The type of this node
|
listOfListeners, parent, UNKNOWN_ATTRIBUTES, UNKNOWN_ELEMENTS
Constructor and Description |
---|
AbstractASTNode()
Creates an empty
AbstractTreeNode |
AbstractASTNode(ASTNode2 ast)
Constructor for cloning
AbstractTreeNode |
Modifier and Type | Method and Description |
---|---|
ASTNodeValue |
compile(AbstractASTNodeCompiler compiler)
Compiles this
ASTNode2 and returns the result. |
abstract ASTNode2 |
getChildAt(int childIndex) |
MathContainer |
getParentSBMLObject()
This method is convenient when holding an object nested inside other
objects in an SBML model.
|
ASTNode.Type |
getType()
Returns the type of this ASTNode2.
|
boolean |
isStrict()
Specifies strictness.
|
void |
setParent(javax.swing.tree.TreeNode parent) |
void |
setParentSBMLObject(MathContainer container)
Sets the parentSBMLObject to container recursively
|
private void |
setStrictness(boolean strict)
Set the strictness of this node
|
void |
setType(ASTNode.Type type)
Set the type of the MathML element represented by this ASTCnNumberNode
|
java.lang.String |
toFormula()
Converts this AbstractASTNode to a text string using a specific syntax for
mathematical formulas.
|
java.lang.String |
toLaTeX()
Converts this node recursively into a LaTeX formatted String.
|
java.lang.String |
toMathML()
Converts this node recursively into a MathML string that corresponds to
the subset of MathML defined in the SBML specification.
|
java.lang.String |
toString() |
void |
unsetParentSBMLObject()
Unsets the parentSBMLObject to null recursively.
|
addAllChangeListeners, addAllChangeListeners, addTreeNodeChangeListener, addTreeNodeChangeListener, children, clearUserObjects, clone, containsUserObjectKey, equals, filter, filter, filter, fireNodeAddedEvent, fireNodeRemovedEvent, firePropertyChange, getIndex, getListOfTreeNodeChangeListeners, getNumChildren, getParent, getRoot, getTreeNodeChangeListenerCount, getUserObject, hashCode, indexOf, isLeaf, isRoot, isSetParent, isSetUserObjects, notifyChildChange, putUserObject, removeAllTreeNodeChangeListeners, removeAllTreeNodeChangeListeners, removeFromParent, removeTreeNodeChangeListener, removeTreeNodeChangeListener, removeUserObject, userObjectKeySet
finalize, getClass, notify, notifyAll, wait, wait, wait
addAllChangeListeners, addAllChangeListeners, addTreeNodeChangeListener, addTreeNodeChangeListener, clearUserObjects, containsUserObjectKey, filter, filter, filter, fireNodeAddedEvent, fireNodeRemovedEvent, firePropertyChange, getListOfTreeNodeChangeListeners, getRoot, getTreeNodeChangeListenerCount, getUserObject, isRoot, isSetParent, isSetUserObjects, putUserObject, removeAllTreeNodeChangeListeners, removeAllTreeNodeChangeListeners, removeFromParent, removeTreeNodeChangeListener, removeTreeNodeChangeListener, removeUserObject, userObjectKeySet
private static final transient org.apache.log4j.Logger logger
Logger
for this class.protected MathContainer parentSBMLObject
protected boolean strict
protected ASTNode.Type type
public AbstractASTNode()
AbstractTreeNode
public AbstractASTNode(ASTNode2 ast)
AbstractTreeNode
ASTFunction
- astFunctionpublic ASTNodeValue compile(AbstractASTNodeCompiler compiler)
ASTNode2
ASTNode2
and returns the result.compile
in interface ASTNode2
compiler
- An instance of an AbstractASTNodeCompiler
that provides
methods to translate this ASTNode2
into something
different.ASTNodeValue
. The content of the
wrapper depends on the AbstractASTNodeCompiler
used to create it.
However, this ASTNode2
will ensure that level and version
are set appropriately according to this node's parent SBML
object.public abstract ASTNode2 getChildAt(int childIndex)
getChildAt
in interface javax.swing.tree.TreeNode
public MathContainer getParentSBMLObject()
MathContainer
; element containing it. From this
MathContainer
even the overall Model
can be accessed.getParentSBMLObject
in interface ASTNode2
public ASTNode.Type getType()
ASTNode2
public boolean isStrict()
ASTNode2
true
, ASTUnaryFunctionNode
and
ASTBinaryFunctionNode
nodes can only contain the specified # of
children. When false, there is a bit of leeway (i.e.,
ASTUnaryFunctionNode
can contain more than one child)
(not recommended).public void setParent(javax.swing.tree.TreeNode parent)
setParent
in interface ASTNode2
setParent
in class AbstractTreeNode
parent
- the parent to setpublic void setParentSBMLObject(MathContainer container)
ASTNode2
setParentSBMLObject
in interface ASTNode2
private void setStrictness(boolean strict)
boolean
- strictpublic void setType(ASTNode.Type type)
Type
- typepublic java.lang.String toFormula() throws SBMLException
ASTNode2
Converts this AbstractASTNode to a text string using a specific syntax for mathematical formulas.
The text-string form of mathematical formulas produced by formulaToString() and read by parseFormula() are simple C-inspired infix notation taken from SBML Level 1. A formula in this text-string form therefore can be handed to a program that understands SBML Level 1 mathematical expressions, or used as part of a formula translation system. The syntax is described in detail in the documentation for ASTNode.
toFormula
in interface ASTNode2
null
is
returned if the given argument is null
.SBMLException
- if there is a problem in the AbstractASTNode tree.public java.lang.String toLaTeX() throws SBMLException
ASTNode2
toLaTeX
in interface ASTNode2
SBMLException
- if there is a problem in the AbstractASTNode tree.public java.lang.String toMathML()
ASTNode2
public java.lang.String toString()
toString
in interface ASTNode2
toString
in class AbstractTreeNode
public void unsetParentSBMLObject()
ASTNode2
unsetParentSBMLObject
in interface ASTNode2