net.sf.jsqlparser.expression.DoubleValue Java Examples

The following examples show how to use net.sf.jsqlparser.expression.DoubleValue. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: AbstractSpannerExpressionVisitorAdapter.java    From spanner-jdbc with MIT License 6 votes vote down vote up
@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);
  }
}
 
Example #2
Source File: QueryUtils.java    From foxtrot with Apache License 2.0 5 votes vote down vote up
public static Number expressionToNumber(Expression expression) {
    if(expression instanceof StringValue) {
        return Long.valueOf(((StringValue)expression).getValue());
    }
    if(expression instanceof LongValue) {
        return ((LongValue)expression).getValue();
    }
    if(expression instanceof DoubleValue) {
        return ((DoubleValue)expression).getValue();
    }
    return null;
}
 
Example #3
Source File: DoubleExpressionConverter.java    From sqlhelper with GNU Lesser General Public License v3.0 4 votes vote down vote up
@Override
public DoubleValue toJSqlParserExpression(DoubleExpression expression) {
    return new DoubleValue(expression.toString());
}
 
Example #4
Source File: DoubleExpressionConverter.java    From sqlhelper with GNU Lesser General Public License v3.0 4 votes vote down vote up
@Override
public DoubleExpression fromJSqlParserExpression(DoubleValue expression) {
    return null;
}
 
Example #5
Source File: DoubleExpressionConverter.java    From sqlhelper with GNU Lesser General Public License v3.0 4 votes vote down vote up
@Override
public Class<DoubleValue> getJSqlParserExpressionClass() {
    return DoubleValue.class;
}
 
Example #6
Source File: ExpressionVisitorImpl.java    From DataPermissionHelper with Apache License 2.0 4 votes vote down vote up
@Override
public void visit(DoubleValue doubleValue) {
}
 
Example #7
Source File: AbstractSpannerExpressionVisitorAdapter.java    From spanner-jdbc with MIT License 4 votes vote down vote up
@Override
public void visit(DoubleValue value) {
  setValue(value.getValue(), Types.DOUBLE);
}
 
Example #8
Source File: DMLWhereClauseVisitor.java    From spanner-jdbc with MIT License 4 votes vote down vote up
@Override
public void visit(DoubleValue value) {
  visitExpression(col, value);
}
 
Example #9
Source File: CTEToNestedQueryConverter.java    From quetzal with Eclipse Public License 2.0 4 votes vote down vote up
@Override
public void visit(DoubleValue doubleValue) {
	clear();
	defaultTopLevelProcessing(doubleValue);
}