Package org.outerj.expression

Examples of org.outerj.expression.Expression.evaluate()


    public Object evaluate(ExpressionContext context) throws ExpressionException {
        BigDecimal result = new BigDecimal("0");
        for(int i = 0; i < arguments.size(); i++) {
            Expression function = (Expression)arguments.get(i);
            Object ret = function.evaluate(context);
            if (ret instanceof Collection) {
                ret = ((Collection)ret).iterator();
            }
            if (ret instanceof Iterator) {
               Iterator iter = (Iterator)ret;
View Full Code Here


                       throw new IllegalArgumentException("Cannot sum an argument of type " + p.getClass().getName());
                   }
                   result = result.add(db);
               }
            } else {
                result = result.add((BigDecimal)function.evaluate(context));
            }
        }
        return result;       
    }
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.