Java Code Examples for net.sf.jsqlparser.expression.DoubleValue

The following examples show how to use net.sf.jsqlparser.expression.DoubleValue. These examples are extracted from open source projects. 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
@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 Project: foxtrot   Source File: QueryUtils.java    License: 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
@Override
public DoubleValue toJSqlParserExpression(DoubleExpression expression) {
    return new DoubleValue(expression.toString());
}
 
Example 4
@Override
public DoubleExpression fromJSqlParserExpression(DoubleValue expression) {
    return null;
}
 
Example 5
@Override
public Class<DoubleValue> getJSqlParserExpressionClass() {
    return DoubleValue.class;
}
 
Example 6
@Override
public void visit(DoubleValue doubleValue) {
}
 
Example 7
@Override
public void visit(DoubleValue value) {
  setValue(value.getValue(), Types.DOUBLE);
}
 
Example 8
Source Project: spanner-jdbc   Source File: DMLWhereClauseVisitor.java    License: MIT License 4 votes vote down vote up
@Override
public void visit(DoubleValue value) {
  visitExpression(col, value);
}
 
Example 9
Source Project: quetzal   Source File: CTEToNestedQueryConverter.java    License: Eclipse Public License 2.0 4 votes vote down vote up
@Override
public void visit(DoubleValue doubleValue) {
	clear();
	defaultTopLevelProcessing(doubleValue);
}