Class NumericValueExpr

    • Constructor Detail

      • NumericValueExpr

        public NumericValueExpr​(Number value)
        Creates a new ValueExpr.
        Parameters:
        value - the value
      • NumericValueExpr

        public NumericValueExpr​(String value)
        Creates a new ValueExpr.
        Parameters:
        value - the value
    • Method Detail

      • getValue

        public Number getValue()
        Gets the value.
        Returns:
        the value
      • isNumericValue

        public boolean isNumericValue()
        Description copied from interface: Expr
        Check if this expression is a number expression.
        Specified by:
        isNumericValue in interface Expr
        Returns:
        if it is a value
      • asNumericValue

        public Optional<NumericValueExpr> asNumericValue()
        Description copied from interface: Expr
        Get this expression as a value expression
        Specified by:
        asNumericValue in interface Expr
        Returns:
        the expression or Optional.empty() if the type does not match
      • accept

        public <T,​X extends Throwable> T accept​(ExprVisitor<T,​X> visitor)
                                               throws X extends Throwable
        Description copied from interface: Expr
        Accepts visitor for this expression.
        Specified by:
        accept in interface Expr
        Type Parameters:
        T - the visitor's return type
        X - the exception type the visitor may throw
        Parameters:
        visitor - the visitor
        Returns:
        the result of the visit
        Throws:
        X - if the visitor fails to visit this expression
        X extends Throwable
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object