Package com.singularsys.jep.parser
Class ASTVarNode
java.lang.Object
com.singularsys.jep.parser.SimpleNode
com.singularsys.jep.parser.ASTVarNode
- All Implemented Interfaces:
Node
Variable Node
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.singularsys.jep.parser.Node
Node.HookKey
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiongetName()
Returns the name of the variable.Return the operator associated with a Node (if any)getPFMC()
Return the pfmc of a node (if any)getValue()
Return the value represented by the variablegetVar()
Return the variable associated with a Node (if any)jjtAccept
(ParserVisitor visitor, Object data) Accept the visitor.void
toString()
Creates a string containing the variable's name and valueMethods 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
-
Constructor Details
-
ASTVarNode
public ASTVarNode(int id)
-
-
Method Details
-
jjtAccept
Accept the visitor.- Specified by:
jjtAccept
in interfaceNode
- Overrides:
jjtAccept
in classSimpleNode
- Throws:
JepException
-
setVar
-
getVar
Description copied from interface:Node
Return the variable associated with a Node (if any)- Returns:
- The Variable for ASTVarNodes, null otherwise
-
getName
Returns the name of the variable.- Returns:
- the name if an ASTVarNode, ASTFunNode, ASTOpNode, null otherwise
-
getValue
Return the value represented by the variable- Returns:
- the value or null if no variable is defined.
-
toString
Creates a string containing the variable's name and value -
getOperator
Description copied from interface:Node
Return the operator associated with a Node (if any)- Returns:
- The Operator for ASTOpNodes, null otherwise
-
getPFMC
Description copied from interface:Node
Return the pfmc of a node (if any)- Returns:
- the PostfixMathCommand for ASTFunNode and ASTOpNode, null otherwise
-