Package com.singularsys.jep.parser
Class ASTFunNode
java.lang.Object
com.singularsys.jep.parser.SimpleNode
com.singularsys.jep.parser.ASTFunNode
- All Implemented Interfaces:
Node
- Direct Known Subclasses:
ASTOpNode
Function Node
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.singularsys.jep.parser.Node
Node.HookKey
-
Field Summary
Modifier and TypeFieldDescriptionprotected PostfixMathCommandI
The function class used to evaluate the node -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiongetName()
Returns the name of the node (operator symbol or function name).Return the operator associated with a Node (if any)getPFMC()
Returns the math command class associated with this node.getValue()
Return the value associated with the node (if any).getVar()
Return the variable associated with a Node (if any)jjtAccept
(ParserVisitor visitor, Object data) Accept the visitor.void
setFunction
(String name_in, PostfixMathCommandI pfmc_in) Sets the function for a node.toString()
Returns a string containing the function name.Methods inherited from class com.singularsys.jep.parser.SimpleNode
childIterator, children, childrenAccept, dump, getHook, getId, hookKeys, jjtAddChild, jjtClose, jjtGetChild, jjtGetNumChildren, jjtGetParent, jjtOpen, jjtSetParent, removeHook, setHook, toString
-
Field Details
-
pfmc
The function class used to evaluate the node
-
-
Constructor Details
-
ASTFunNode
public ASTFunNode(int id) Creates a new ASTFunNode
-
-
Method Details
-
jjtAccept
Accept the visitor.- Specified by:
jjtAccept
in interfaceNode
- Overrides:
jjtAccept
in classSimpleNode
- Throws:
ParseException
JepException
-
setFunction
Sets the function for a node. A name and function class must be specified. -
toString
Returns a string containing the function name. -
getPFMC
Returns the math command class associated with this node.- Returns:
- the PostfixMathCommand for ASTFunNode and ASTOpNode, null otherwise
-
getName
Returns the name of the node (operator symbol or function name).- Returns:
- the name if an ASTVarNode, ASTFunNode, ASTOpNode, null otherwise
-
getOperator
Description copied from interface:Node
Return the operator associated with a Node (if any)- Returns:
- The Operator for ASTOpNodes, null otherwise
-
getValue
Description copied from interface:Node
Return the value associated with the node (if any).- Returns:
- the value if an ASTConstant, ASTVarNode, null otherwise
-
getVar
Description copied from interface:Node
Return the variable associated with a Node (if any)- Returns:
- The Variable for ASTVarNodes, null otherwise
-