java.io.Serializable
, java.lang.Cloneable
, javax.swing.tree.TreeNode
, ASTNode2
, TreeNodeWithChangeSupport
ASTArithmeticOperatorNode
, ASTBinaryFunctionNode
, ASTCiFunctionNode
, ASTLambdaFunctionNode
, ASTLogicalOperatorNode
, ASTPiecewiseFunctionNode
, ASTQualifierNode
, ASTRelationalOperatorNode
, ASTUnaryFunctionNode
public class ASTFunction extends AbstractASTNode
Constructor | Description |
---|---|
ASTFunction() |
Creates a new
ASTFunction that lacks a pointer
to its containing MathContainer . |
ASTFunction(ASTFunction other) |
Copy constructor; Creates a deep copy of the given
ASTFunction . |
ASTFunction(MathContainer container) |
Creates a new
ASTFunction with a pointer
to the specified MathContainer . |
Modifier and Type | Method | Description |
---|---|---|
void |
addChild(ASTNode2 child) |
Adds a child to this node.
|
ASTFunction |
clone() |
Clone ASTNode2
|
ASTNode2Value<?> |
compile(ASTNode2Compiler compiler) |
Compiles this
ASTNode2 and returns the result. |
boolean |
equals(java.lang.Object obj) |
|
java.util.List<CallableSBase> |
findReferencedCallableSBases() |
Goes through the formula and identifies all global parameters that are
referenced by this rate rule.
|
boolean |
getAllowsChildren() |
|
ASTNode2 |
getChildAt(int childIndex) |
|
int |
getChildCount() |
|
java.util.List<ASTNode2> |
getChildren() |
Returns the list of children of the current ASTFunction.
|
java.util.List<ASTNode2> |
getListOfNodes() |
Returns the list of children of the current ASTFunction.
|
java.util.List<ASTNode2> |
getListOfNodes(Filter filter) |
Returns the list of children of the current ASTFunction that satisfy the
given filter.
|
java.lang.String |
getName() |
Returns the name of the MathML element represented by
this
ASTFunction |
int |
hashCode() |
|
boolean |
hasUnits() |
Returns
true if any one of the descendants of this
ASTFunction has a unit defined. |
void |
insertChild(int n,
ASTNode2 newChild) |
|
boolean |
isAllowableType(ASTNode.Type type) |
Returns
true iff type is allowed in this ASTNode2 |
boolean |
isSetName() |
Returns True iff name has been set
|
void |
prependChild(ASTNode2 child) |
Adds the given node as a child of this
ASTFunction . |
boolean |
removeChild(int n) |
Removes child n of this
ASTFunction . |
ASTNode2 |
replaceChild(int n,
ASTNode2 newChild) |
Replaces the nth child of this ASTNode2 with the given ASTNode2.
|
void |
setName(java.lang.String name) |
Set the name of the MathML element represented by
this
ASTFunction |
void |
setParentSBMLObject(MathContainer container) |
Sets the parentSBMLObject to container recursively
|
void |
swapChildren(ASTFunction that) |
Swaps the children of this
ASTFunction with the children of that
ASTFunction . |
getId, getMathMLClass, getParentSBMLObject, getStyle, getType, isSetId, isSetMathMLClass, isSetParentSBMLObject, isSetStyle, isSetType, isStrict, setId, setMathMLClass, setParent, setStrictness, setStyle, setType, setType, toFormula, toLaTeX, toMathML, unsetParentSBMLObject
addAllChangeListeners, addAllChangeListeners, addTreeNodeChangeListener, addTreeNodeChangeListener, children, clearUserObjects, containsUserObjectKey, filter, filter, filter, fireNodeAddedEvent, fireNodeRemovedEvent, firePropertyChange, getIndex, getListOfTreeNodeChangeListeners, getNumChildren, getParent, getRoot, getTreeNodeChangeListenerCount, getUserObject, indexOf, isLeaf, isRoot, isSetParent, isSetUserObjects, putUserObject, removeAllTreeNodeChangeListeners, removeAllTreeNodeChangeListeners, removeFromParent, removeTreeNodeChangeListener, removeTreeNodeChangeListener, removeUserObject, toString, userObjectKeySet
getClass, notify, notifyAll, toString, 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
public ASTFunction()
ASTFunction
that lacks a pointer
to its containing MathContainer
.public ASTFunction(ASTFunction other)
ASTFunction
.other
- the ASTFunction
to be copied.public ASTFunction(MathContainer container)
ASTFunction
with a pointer
to the specified MathContainer
.container
- public void addChild(ASTNode2 child)
child
- the node to add as child.java.lang.NullPointerException
- if the child is nullpublic ASTFunction clone()
ASTNode2
clone
in interface ASTNode2
clone
in class AbstractASTNode
public ASTNode2Value<?> compile(ASTNode2Compiler compiler)
ASTNode2
ASTNode2
and returns the result.compiler
- An instance of an ASTNode2Compiler
that provides
methods to translate this ASTNode2
into something
different.ASTNode2Value
. The content of the
wrapper depends on the ASTNode2Compiler
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 boolean equals(java.lang.Object obj)
equals
in class AbstractASTNode
public java.util.List<CallableSBase> findReferencedCallableSBases()
public boolean getAllowsChildren()
public ASTNode2 getChildAt(int childIndex)
getChildAt
in interface javax.swing.tree.TreeNode
getChildAt
in class AbstractASTNode
public int getChildCount()
public java.util.List<ASTNode2> getChildren()
public java.util.List<ASTNode2> getListOfNodes()
public java.util.List<ASTNode2> getListOfNodes(Filter filter)
filter
- public java.lang.String getName()
ASTFunction
public int hashCode()
hashCode
in class AbstractASTNode
public boolean hasUnits()
true
if any one of the descendants of this
ASTFunction
has a unit defined.true
public void insertChild(int n, ASTNode2 newChild)
public boolean isAllowableType(ASTNode.Type type)
ASTNode2
true
iff type is allowed in this ASTNode2
public boolean isSetName()
public void prependChild(ASTNode2 child)
ASTFunction
. This method adds child
nodes from right to left.child
- an ASTNode2
java.lang.NullPointerException
- if the child is nullpublic boolean removeChild(int n)
ASTFunction
. Removing a child from an
ASTFunction
may result in an inaccurate representation.n
- the index of the child to removepublic ASTNode2 replaceChild(int n, ASTNode2 newChild)
n
- long the index of the child to replacenewChild
- ASTNode2
to replace the nth childpublic void setName(java.lang.String name)
ASTFunction
name
- public void setParentSBMLObject(MathContainer container)
ASTNode2
setParentSBMLObject
in interface ASTNode2
setParentSBMLObject
in class AbstractASTNode
public void swapChildren(ASTFunction that)
Swaps the children of this ASTFunction
with the children of that
ASTFunction
.
Unfortunately, when swapping child nodes, we have to recursively traverse the entire subtrees in order to make sure that all pointers to the parent SBML object are correct. However, this must only be done if the parent SBML object of that differs from the one surrounding this node.
In any case, the pointer from each sub-node to its parent must be changed.
In contrast to other SBML elements, ASTFunction
s have sub-nodes as
direct children, i.e., there is no child called 'ListOfNodes'. The
setParent
method is also not recursive.
However, this might cause many calls to listeners.
that
- the other node whose children should be used to replace this
node's children