Class FunctionExpressionNode

  • All Implemented Interfaces:
    ExpressionNode

    public class FunctionExpressionNode
    extends Object
    implements ExpressionNode
    An ExpressionNode that handles mathematical functions. Some pre-defined functions are handled, others can easily be added.
    • Method Detail

      • getType

        public int getType()
        Returns the type of the node, in this case ExpressionNode.FUNCTION_NODE
        Specified by:
        getType in interface ExpressionNode
        Returns:
        type of the node
      • getValue

        public double getValue()
        Returns the value of the sub-expression that is rooted at this node. The argument is evaluated and then the function is applied to the resulting value.
        Specified by:
        getValue in interface ExpressionNode
        Returns:
        value of expression
      • accept

        public void accept​(ExpressionNodeVisitor visitor)
        Implementation of the visitor design pattern. Calls visit on the visitor and then passes the visitor on to the accept method of the argument.
        Specified by:
        accept in interface ExpressionNode
        Parameters:
        visitor - the visitor