Class ConstantExpressionNode

    • Constructor Detail

      • ConstantExpressionNode

        public ConstantExpressionNode​(double value)
        Construct with the fixed value.
        Parameters:
        value - the value of the constant
      • ConstantExpressionNode

        public ConstantExpressionNode​(String value)
        Convenience constructor that takes a string and converts it to a double before storing the value.
        Parameters:
        value - the string representation of the value
    • Method Detail

      • getValue

        public double getValue()
        Returns the value of the constant
        Specified by:
        getValue in interface ExpressionNode
        Returns:
        value of expression
      • getType

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

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