Package org.boris.expr

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


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

        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

        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

    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

        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

            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

{
    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

        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

    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

Related Classes of org.boris.expr.ExprDouble

Copyright © 2018 www.massapicom. 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.