Interface ExpressionNode

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void accept​(ExpressionNodeVisitor visitor)
      Method needed for the visitor design pattern
      int getType()
      Returns the type of the node.ExpressionNode Each class derived from ExpressionNode representing a specific role in the expression should return the type according to that role.
      double getValue()
      Calculates and returns the value of the sub-expression represented by the node.
    • Field Detail

      • VARIABLE_NODE

        static final int VARIABLE_NODE
        Node id for variable nodes
        See Also:
        Constant Field Values
      • CONSTANT_NODE

        static final int CONSTANT_NODE
        Node id for constant nodes
        See Also:
        Constant Field Values
      • ADDITION_NODE

        static final int ADDITION_NODE
        Node id for addition nodes
        See Also:
        Constant Field Values
      • MULTIPLICATION_NODE

        static final int MULTIPLICATION_NODE
        Node id for multiplication nodes
        See Also:
        Constant Field Values
      • EXPONENTIATION_NODE

        static final int EXPONENTIATION_NODE
        Node id for exponentiation nodes
        See Also:
        Constant Field Values
      • FUNCTION_NODE

        static final int FUNCTION_NODE
        Node id for function nodes
        See Also:
        Constant Field Values
    • Method Detail

      • getType

        int getType()
        Returns the type of the node.ExpressionNode Each class derived from ExpressionNode representing a specific role in the expression should return the type according to that role.
        Returns:
        type of the node
      • getValue

        double getValue()
        Calculates and returns the value of the sub-expression represented by the node.
        Returns:
        value of expression
      • accept

        void accept​(ExpressionNodeVisitor visitor)
        Method needed for the visitor design pattern
        Parameters:
        visitor - the visitor