Package org.boris.expr

Examples of org.boris.expr.ExprException


public class CHOOSE extends AbstractFunction
{
    public Expr evaluate(Expr[] args) throws ExprException {
        if (args.length < 2)
            throw new ExprException("Too few arguments for CHOOSE");

        Expr index = args[0];
        if (index instanceof ExprEvaluatable)
            index = ((ExprEvaluatable) index).evaluate();

        if (!(index instanceof ExprNumber)) {
            throw new ExprException(
                    "First argument must be a number for CHOOSE");
        }

        int idx = ((ExprNumber) index).intValue();
        if (idx < 1 || idx >= args.length)
            throw new ExprException("Invalid index for CHOOSE");

        return args[idx];
    }
View Full Code Here


public class IF extends AbstractFunction
{
    public Expr evaluate(Expr[] args) throws ExprException {
        if (args.length < 2)
            throw new ExprException("Too few arguments entered for function IF");
        if (args.length > 3)
            throw new ExprException(
                    "Too many arguments entered for function IF");

        Expr cond = evalArg(args[0]);
        Expr yRes = args[1];
        Expr nRes = null;
View Full Code Here

        assertMinArgCount(args, 3);
        assertMaxArgCount(args, 5);

        Expr r = args[0];
        if (!(r instanceof ExprVariable)) {
            throw new ExprException("First argument to OFFSET not a reference");
        }

        ExprVariable ref = (ExprVariable) r;
        Range range = (Range) ref.getAnnotation();
        if (range == null) {
            range = Range.valueOf(ref.getName());
        }
        if (range == null) {
            throw new ExprException("First argument to OFFSET not a reference");
        }
        GridReference gf = range.getDimension1();
        int x = gf.getColumn();
        int y = gf.getRow();
        int rows = asInteger(args[1], true);
View Full Code Here

TOP

Related Classes of org.boris.expr.ExprException

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.