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 Project: spanner-jdbc   Author: olavloite   File: AbstractSpannerExpressionVisitorAdapter.java    License: 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 Project: foxtrot   Author: Flipkart   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
Source Project: sqlhelper   Author: fangjinuo   File: DoubleExpressionConverter.java    License: 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 Project: sqlhelper   Author: fangjinuo   File: DoubleExpressionConverter.java    License: GNU Lesser General Public License v3.0 4 votes vote down vote up
@Override
public DoubleExpression fromJSqlParserExpression(DoubleValue expression) {
    return null;
}
 
Example #5
Source Project: sqlhelper   Author: fangjinuo   File: DoubleExpressionConverter.java    License: GNU Lesser General Public License v3.0 4 votes vote down vote up
@Override
public Class<DoubleValue> getJSqlParserExpressionClass() {
    return DoubleValue.class;
}
 
Example #6
Source Project: DataPermissionHelper   Author: holyliao   File: ExpressionVisitorImpl.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public void visit(DoubleValue doubleValue) {
}
 
Example #7
Source Project: spanner-jdbc   Author: olavloite   File: AbstractSpannerExpressionVisitorAdapter.java    License: MIT License 4 votes vote down vote up
@Override
public void visit(DoubleValue value) {
  setValue(value.getValue(), Types.DOUBLE);
}
 
Example #8
Source Project: spanner-jdbc   Author: olavloite   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   Author: Quetzal-RDF   File: CTEToNestedQueryConverter.java    License: Eclipse Public License 2.0 4 votes vote down vote up
@Override
public void visit(DoubleValue doubleValue) {
	clear();
	defaultTopLevelProcessing(doubleValue);
}