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.
  • Constructor Details

    • ASTConstant

      public ASTConstant(int id)
  • Method Details

    • setValue

      public void setValue(Object val)
    • getValue

      public 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 Object jjtAccept(ParserVisitor visitor, Object data) throws JepException
      Accept the visitor.
      Specified by:
      jjtAccept in interface Node
      Overrides:
      jjtAccept in class SimpleNode
      Throws:
      JepException
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getName

      public 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
    • getVar

      public Variable getVar()
      Description copied from interface: Node
      Return the variable associated with a Node (if any)
      Returns:
      The Variable for ASTVarNodes, null otherwise