Examples of todouble()


Examples of org.msgpack.value.holder.FloatHolder.toDouble()

                    }
                    break;
                case FLOAT:
                    FloatHolder fh = v.getFloatHolder();
                    float f = fh.toFloat();   // read as float
                    double d = fh.toDouble(); // read as double
                    System.out.println("read float: " + d);
                    break;
                case STRING:
                    String s = v.get().asString().toString();
                    System.out.println("read string: " + s);
View Full Code Here

Examples of plan_runner.conversion.DoubleConversion.toDouble()

        final Long lvalue = (Long) value;
        value = (long) (lc.toDouble(lvalue) * scallingFactor);
      } else if (tc instanceof DoubleConversion) {
        final DoubleConversion dbc = (DoubleConversion) tc;
        final Double dvalue = (Double) value;
        value = (double) (dbc.toDouble(dvalue) * scallingFactor);
      } else {
        if (true)
          throw new RuntimeException("Only Long and Double can be scalled out!");
      }
      break;
View Full Code Here

Examples of plan_runner.conversion.IntegerConversion.toDouble()

      return new ColumnReference<Double>(numConv, ((ColumnReference) other).getColumnIndex());
    else if (other instanceof ValueSpecification) {
      IntegerConversion change;
      if (other.getType() instanceof IntegerConversion) {
        change = (IntegerConversion) other.getType();
        final double temp = change.toDouble(other.eval(null));
        final ValueSpecification tempVS = new ValueSpecification<Double>(numConv, temp);
        return tempVS;
      } else
        return other;
    } else if (other instanceof Addition) {
View Full Code Here

Examples of plan_runner.conversion.LongConversion.toDouble()

      jj_consume_token(SCALLED);
      final TypeConversion tc = ci.getType();
      if (tc instanceof LongConversion) {
        final LongConversion lc = (LongConversion) tc;
        final Long lvalue = (Long) value;
        value = (long) (lc.toDouble(lvalue) * scallingFactor);
      } else if (tc instanceof DoubleConversion) {
        final DoubleConversion dbc = (DoubleConversion) tc;
        final Double dvalue = (Double) value;
        value = (double) (dbc.toDouble(dvalue) * scallingFactor);
      } else {
View Full Code Here

Examples of plan_runner.conversion.NumericConversion.toDouble()

      final SumCount sc = (SumCount) _ve.eval(tuple);
      sumDelta = sc.getSum();
      countDelta = sc.getCount();
    } else {
      final NumericConversion nc = (NumericConversion) veType;
      sumDelta = nc.toDouble(_ve.eval(tuple));
      countDelta = 1L;
    }

    final Double sumNew = sumDelta + value.getSum();
    final Long countNew = countDelta + value.getCount();
View Full Code Here

Examples of plan_runner.conversion.NumericConversion.toDouble()

  public T eval(List<String> tuple) {
    double result = 0;
    for (final ValueExpression factor : _veList) {
      final Object currentVal = factor.eval(tuple);
      final NumericConversion currentType = (NumericConversion) (factor.getType());
      result += currentType.toDouble(currentVal);
    }
    return _wrapper.fromDouble(result);
  }

  @Override
View Full Code Here

Examples of plan_runner.conversion.NumericConversion.toDouble()

  @Override
  public T eval(List<String> tuple) {
    final ValueExpression firstVE = _veList.get(0);
    final Object firstObj = firstVE.eval(tuple);
    final NumericConversion firstType = (NumericConversion) firstVE.getType();
    double result = firstType.toDouble(firstObj);

    for (int i = 1; i < _veList.size(); i++) {
      final ValueExpression currentVE = _veList.get(i);
      final Object currentObj = currentVE.eval(tuple);
      final NumericConversion currentType = (NumericConversion) currentVE.getType();
View Full Code Here

Examples of plan_runner.conversion.NumericConversion.toDouble()

    for (int i = 1; i < _veList.size(); i++) {
      final ValueExpression currentVE = _veList.get(i);
      final Object currentObj = currentVE.eval(tuple);
      final NumericConversion currentType = (NumericConversion) currentVE.getType();
      result -= currentType.toDouble(currentObj);
    }
    return _wrapper.fromDouble(result);

  }
View Full Code Here

Examples of plan_runner.conversion.NumericConversion.toDouble()

  @Override
  public Double eval(List<String> tuple) {
    final ValueExpression firstVE = _veList.get(0);
    final Object firstObj = firstVE.eval(tuple);
    final NumericConversion firstType = (NumericConversion) firstVE.getType();
    double result = firstType.toDouble(firstObj);

    for (int i = 1; i < _veList.size(); i++) {
      final ValueExpression currentVE = _veList.get(i);
      final Object currentObj = currentVE.eval(tuple);
      final NumericConversion currentType = (NumericConversion) currentVE.getType();
View Full Code Here

Examples of plan_runner.conversion.NumericConversion.toDouble()

    for (int i = 1; i < _veList.size(); i++) {
      final ValueExpression currentVE = _veList.get(i);
      final Object currentObj = currentVE.eval(tuple);
      final NumericConversion currentType = (NumericConversion) currentVE.getType();
      result /= currentType.toDouble(currentObj);
    }
    return _wrapper.fromDouble(result);
  }

  @Override
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.