java.io.Serializable
, java.lang.Cloneable
, javax.swing.tree.TreeNode
, ASTNode2
, TreeNodeWithChangeSupport
ASTHyperbolicNode
, ASTTrigonometricNode
public class ASTUnaryFunctionNode extends ASTFunction
Constructor | Description |
---|---|
ASTUnaryFunctionNode() |
Creates a new
ASTUnaryFunctionNode . |
ASTUnaryFunctionNode(ASTNode.Type type) |
Creates a new
ASTUnaryFunctionNode of type ASTNode.Type |
ASTUnaryFunctionNode(ASTUnaryFunctionNode node) |
Copy constructor; Creates a deep copy of the given
ASTUnaryFunctionNode . |
Modifier and Type | Method | Description |
---|---|---|
void |
addChild(ASTNode2 child) |
Adds a child to this node.
|
ASTUnaryFunctionNode |
clone() |
Clone ASTNode2
|
ASTNode2Value<?> |
compile(ASTNode2Compiler compiler) |
Compiles this
ASTNode2 and returns the result. |
ASTNode2 |
getChild() |
Get the child of this node
|
ASTNode2 |
getChildAt(int childIndex) |
|
void |
insertChild(int n,
ASTNode2 newChild) |
|
boolean |
isAllowableType(ASTNode.Type type) |
Returns
true iff type is allowed in this ASTNode2 |
boolean |
isSetChild() |
Returns true iff the child of this node 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 . |
void |
setChild(ASTNode2 child) |
Set the child of this node
|
void |
swapChildren(ASTFunction that) |
Swaps the children of this
ASTFunction with the children of that
ASTFunction . |
java.lang.String |
toFormula() |
Converts this
ASTNode2 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.
|
getId, getMathMLClass, getParentSBMLObject, getStyle, getType, isSetId, isSetMathMLClass, isSetParentSBMLObject, isSetStyle, isSetType, isStrict, setId, setMathMLClass, setParent, setStrictness, setStyle, setType, setType, 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
equals, findReferencedCallableSBases, getAllowsChildren, getChildCount, getChildren, getListOfNodes, getListOfNodes, getName, hashCode, hasUnits, isSetName, replaceChild, setName, setParentSBMLObject
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 ASTUnaryFunctionNode()
ASTUnaryFunctionNode
.public ASTUnaryFunctionNode(ASTUnaryFunctionNode node)
ASTUnaryFunctionNode
.node
- the ASTUnaryFunctionNode
to be copied.public ASTUnaryFunctionNode(ASTNode.Type type)
ASTUnaryFunctionNode
of type ASTNode.Type
type
- public void addChild(ASTNode2 child)
ASTFunction
addChild
in class ASTFunction
child
- the node to add as child.public ASTUnaryFunctionNode clone()
ASTNode2
clone
in interface ASTNode2
clone
in class ASTFunction
public ASTNode2Value<?> compile(ASTNode2Compiler compiler)
ASTNode2
ASTNode2
and returns the result.compile
in interface ASTNode2
compile
in class ASTFunction
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 ASTNode2 getChildAt(int childIndex)
getChildAt
in interface javax.swing.tree.TreeNode
getChildAt
in class ASTFunction
public void insertChild(int n, ASTNode2 newChild)
ASTFunction
ASTNode2
at point n in the list of children of this
ASTNode2
. Inserting a child within an ASTNode2
may result in an inaccurate
representation.insertChild
in class ASTFunction
n
- long the index of the ASTNode2
being addednewChild
- ASTNode2
to insert as the nth childpublic boolean isAllowableType(ASTNode.Type type)
ASTNode2
true
iff type is allowed in this ASTNode2
isAllowableType
in interface ASTNode2
isAllowableType
in class ASTFunction
public boolean isSetChild()
public void prependChild(ASTNode2 child)
ASTFunction
ASTFunction
. This method adds child
nodes from right to left.prependChild
in class ASTFunction
child
- an ASTNode2
public boolean removeChild(int n)
ASTFunction
ASTFunction
. Removing a child from an
ASTFunction
may result in an inaccurate representation.removeChild
in class ASTFunction
n
- the index of the child to removepublic void setChild(ASTNode2 child)
child
- public void swapChildren(ASTFunction that)
ASTFunction
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.
swapChildren
in class ASTFunction
that
- the other node whose children should be used to replace this
node's childrenpublic java.lang.String toFormula() throws SBMLException
ASTNode2
Converts this ASTNode2
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
toFormula
in class AbstractASTNode
null
is
returned if the given argument is null
.SBMLException
public java.lang.String toLaTeX() throws SBMLException
ASTNode2
toLaTeX
in interface ASTNode2
toLaTeX
in class AbstractASTNode
SBMLException
public java.lang.String toMathML()
ASTNode2
toMathML
in interface ASTNode2
toMathML
in class AbstractASTNode