Package org.boris.expr.util

Examples of org.boris.expr.util.Condition


{
    public Expr evaluate(Expr[] args) throws ExprException {
        assertArgCount(args, 2);
        // TODO assert first argument as reference
        ExprArray array = asArray(args[0], true);
        Condition cond = Condition.valueOf(args[1]);
        if (cond == null)
            return ExprError.VALUE;
        Expr[] a = array.getArgs();
        int count = 0;
        for (int i = 0; i < a.length; i++) {
            if (cond.eval(a[i]))
                count++;
        }
        return new ExprDouble(count);
    }
View Full Code Here


                    "Third argument to SUMIF must be a reference");
        }*/

        Expr range = evalArg(args[0]);
        int len = getLength(range);
        Condition cond = Condition.valueOf(evalArg(args[1]));
        Expr sumrange = args.length == 3 ? evalArg(args[2]) : range;

        double sum = 0;
        for (int i = 0; i < len; i++) {
            sum += eval(get(range, i), cond, get(sumrange, i));
View Full Code Here

TOP

Related Classes of org.boris.expr.util.Condition

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.