Examples of ExprDouble


Examples of org.boris.expr.ExprDouble

    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:
View Full Code Here

Examples of org.boris.expr.ExprDouble

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)));
    }
View Full Code Here

Examples of org.boris.expr.ExprDouble

        counter.value += value;
        counter.count++;
    }

    protected Expr evaluate(Counter counter) throws ExprException {
        return new ExprDouble(counter.value2 /
                (counter.count - (allPopulation ? 0 : 1)));
    }
View Full Code Here

Examples of org.boris.expr.ExprDouble

        Expr a = evalArg(args[0]);
        if (a instanceof ExprError)
            return a;
        if (!isNumber(a))
            return ExprError.VALUE;
        return new ExprDouble(evaluate(((ExprNumber) a).doubleValue()));
    }
View Full Code Here

Examples of org.boris.expr.ExprDouble

    public void setValue(String name, String value) {
        setValue(name, new ExprString(value));
    }

    public void setValue(String name, double value) {
        setValue(name, new ExprDouble(value));
    }
View Full Code Here

Examples of org.boris.expr.ExprDouble

        counter.count++;
        counter.value *= value;
    }

    protected Expr evaluate(Counter counter) throws ExprException {
        return new ExprDouble(Math.pow(counter.value, 1. / counter.count));
    }
View Full Code Here

Examples of org.boris.expr.ExprDouble

            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);
    }
View Full Code Here

Examples of org.boris.expr.ExprDouble

{
    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));
    }
View Full Code Here

Examples of org.boris.expr.ExprDouble

        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;
View Full Code Here

Examples of org.boris.expr.ExprDouble

    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)
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.