Package com.singularsys.jep.parser
Class ASTOpNode
- java.lang.Object
-
- com.singularsys.jep.parser.SimpleNode
-
- com.singularsys.jep.parser.ASTFunNode
-
- com.singularsys.jep.parser.ASTOpNode
-
- All Implemented Interfaces:
Node
public class ASTOpNode extends ASTFunNode
Function Node
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.singularsys.jep.parser.Node
Node.HookKey
-
-
Field Summary
-
Fields inherited from class com.singularsys.jep.parser.ASTFunNode
pfmc
-
-
Constructor Summary
Constructors Constructor Description ASTOpNode(int id)
Creates a new ASTFunNode
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getName()
Returns the name of the node (operator symbol or function name).Operator
getOperator()
Returns the id number of the operator if the node is an operator.java.lang.Object
jjtAccept(ParserVisitor visitor, java.lang.Object data)
Accept the visitor.void
setOperator(Operator op)
Sets the opID, name and pfmc for this node by looking up the values in the Operators classjava.lang.String
toString()
Returns a string containing the function name.-
Methods inherited from class com.singularsys.jep.parser.ASTFunNode
getPFMC, getValue, getVar, setFunction
-
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
-
-
-
-
Method Detail
-
jjtAccept
public java.lang.Object jjtAccept(ParserVisitor visitor, java.lang.Object data) throws JepException
Accept the visitor.- Specified by:
jjtAccept
in interfaceNode
- Overrides:
jjtAccept
in classASTFunNode
- Throws:
ParseException
JepException
-
setOperator
public void setOperator(Operator op)
Sets the opID, name and pfmc for this node by looking up the values in the Operators class
-
toString
public java.lang.String toString()
Returns a string containing the function name.- Overrides:
toString
in classASTFunNode
-
getName
public java.lang.String getName()
Returns the name of the node (operator symbol or function name).- Specified by:
getName
in interfaceNode
- Overrides:
getName
in classASTFunNode
- Returns:
- the name if an ASTVarNode, ASTFunNode, ASTOpNode, null otherwise
-
getOperator
public Operator getOperator()
Returns the id number of the operator if the node is an operator.- Specified by:
getOperator
in interfaceNode
- Overrides:
getOperator
in classASTFunNode
- Returns:
- The Operator for ASTOpNodes, null otherwise
-
-