209210211212213214215216217218219
private void parseValue(ExprToken e, IEvaluationCallback callback) throws ExprException { Expr value = null; switch (e.type) { case Decimal: value = new ExprDouble(e.doubleValue); break; case Integer: value = new ExprInteger(e.integerValue); break; case String:
15161718192021
public abstract class DoubleInOutFunction extends AbstractFunction { public final Expr evaluate(Expr[] args) throws ExprException { assertArgCount(args, 1); return new ExprDouble(evaluate(asDouble(args[0], true))); }
4748495051525354
counter.value += value; counter.count++; } protected Expr evaluate(Counter counter) throws ExprException { return new ExprDouble(counter.value2 / (counter.count - (allPopulation ? 0 : 1))); }
22232425262728
Expr a = evalArg(args[0]); if (a instanceof ExprError) return a; if (!isNumber(a)) return ExprError.VALUE; return new ExprDouble(evaluate(((ExprNumber) a).doubleValue())); }
66676869707172
public void setValue(String name, String value) { setValue(name, new ExprString(value)); } public void setValue(String name, double value) { setValue(name, new ExprDouble(value)); }
16171819202122
counter.count++; counter.value *= value; } protected Expr evaluate(Counter counter) throws ExprException { return new ExprDouble(Math.pow(counter.value, 1. / counter.count)); }
25262728293031
return ExprError.VALUE; double s = ((ExprNumber) eS).doubleValue(); double r = ExcelDate.time(h, m, s); if (r < 0) return ExprError.NUM; return new ExprDouble(r); }
9101112131415
{ public Expr evaluate(Expr[] args) throws ExprException { assertArgCount(args, 2); double x = asDouble(args[0], true); double y = asDouble(args[1], true); return new ExprDouble(Math.atan2(y, x)); }
3233343536373839404142
Expr result; try { result = new ExprInteger(Integer.parseInt(expression)); } catch (Exception e) { try { result = new ExprDouble(Double.parseDouble(expression)); } catch (Exception ex) { result = new ExprString(expression); } } return result;
7980818283848586878889
public static Expr convertObject(Object o) { if (o == null) return null; if (o instanceof Double) return new ExprDouble(((Double) o).doubleValue()); if (o instanceof Integer) return new ExprInteger(((Integer) o).intValue()); if (o instanceof Boolean)