Package com.singularsys.jep.parser
Class ASTConstant
- java.lang.Object
-
- com.singularsys.jep.parser.SimpleNode
-
- com.singularsys.jep.parser.ASTConstant
-
- All Implemented Interfaces:
Node
public class ASTConstant extends SimpleNode
A Constant Node. Has an associated value.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.singularsys.jep.parser.Node
Node.HookKey
-
-
Constructor Summary
Constructors Constructor Description ASTConstant(int id)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getName()
Return the name associated with the node (if any).Operator
getOperator()
Return the operator associated with a Node (if any)PostfixMathCommandI
getPFMC()
Return the pfmc of a node (if any)java.lang.Object
getValue()
Return the value associated with the node (if any).Variable
getVar()
Return the variable associated with a Node (if any)java.lang.Object
jjtAccept(ParserVisitor visitor, java.lang.Object data)
Accept the visitor.void
setValue(java.lang.Object val)
java.lang.String
toString()
-
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
-
setValue
public void setValue(java.lang.Object val)
-
getValue
public java.lang.Object getValue()
Description copied from interface:Node
Return the value associated with the node (if any).- Returns:
- the value if an ASTConstant, ASTVarNode, null otherwise
-
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 classSimpleNode
- Throws:
JepException
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
getName
public java.lang.String getName()
Description copied from interface:Node
Return the name associated with the node (if any).- Returns:
- the name if an ASTVarNode, ASTFunNode, ASTOpNode, null otherwise
-
getOperator
public Operator getOperator()
Description copied from interface:Node
Return the operator associated with a Node (if any)- Returns:
- The Operator for ASTOpNodes, null otherwise
-
getPFMC
public PostfixMathCommandI getPFMC()
Description copied from interface:Node
Return the pfmc of a node (if any)- Returns:
- the PostfixMathCommand for ASTFunNode and ASTOpNode, null otherwise
-
-