Class ASTVarNode

  • All Implemented Interfaces:
    Node

    public class ASTVarNode
    extends SimpleNode
    Variable Node
    • Constructor Detail

      • ASTVarNode

        public ASTVarNode​(int id)
    • Method Detail

      • setVar

        public void setVar​(Variable variable)
      • 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
      • getName

        public java.lang.String getName()
        Returns the name of the variable.
        Returns:
        the name if an ASTVarNode, ASTFunNode, ASTOpNode, null otherwise
      • getValue

        public java.lang.Object getValue()
        Return the value represented by the variable
        Returns:
        the value or null if no variable is defined.
      • toString

        public java.lang.String toString()
        Creates a string containing the variable's name and value
        Overrides:
        toString in class java.lang.Object
      • 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