Search in sources :

Example 1 with SignedExpression

use of net.sf.jsqlparser.expression.SignedExpression in project spanner-jdbc by olavloite.

the class AbstractSpannerExpressionVisitorAdapter method visit.

@Override
public void visit(SignedExpression value) {
    Expression underlyingValue = value.getExpression();
    if (underlyingValue instanceof DoubleValue) {
        DoubleValue doubleValue = (DoubleValue) underlyingValue;
        doubleValue.setValue(value.getSign() == '-' ? -doubleValue.getValue() : doubleValue.getValue());
        visit(doubleValue);
    } else if (underlyingValue instanceof LongValue) {
        LongValue longValue = (LongValue) underlyingValue;
        longValue.setValue(value.getSign() == '-' ? -longValue.getValue() : longValue.getValue());
        visit(longValue);
    } else {
        super.visit(value);
    }
}
Also used : SignedExpression(net.sf.jsqlparser.expression.SignedExpression) Expression(net.sf.jsqlparser.expression.Expression) DoubleValue(net.sf.jsqlparser.expression.DoubleValue) LongValue(net.sf.jsqlparser.expression.LongValue)

Aggregations

DoubleValue (net.sf.jsqlparser.expression.DoubleValue)1 Expression (net.sf.jsqlparser.expression.Expression)1 LongValue (net.sf.jsqlparser.expression.LongValue)1 SignedExpression (net.sf.jsqlparser.expression.SignedExpression)1