FileDocCategorySizeDatePackage
If.javaAPI DocApache Poi 3.0.11753Sun Mar 11 12:59:30 GMT 2007org.apache.poi.hssf.record.formula.functions

If

public class If extends Object implements Function
author
Amol S. Deshmukh < amolweb at ya hoo dot com >

Fields Summary
Constructors Summary
Methods Summary
public org.apache.poi.hssf.record.formula.eval.Evalevaluate(org.apache.poi.hssf.record.formula.eval.Eval[] evals, int srcCellRow, short srcCellCol)

        Eval retval = null;
        Eval evalWhenFalse = BoolEval.FALSE;
        switch (evals.length) {
        case 3:
            evalWhenFalse = evals[2];
        case 2:
            BoolEval beval = (BoolEval) evals[0];
            if (beval.getBooleanValue()) {
                retval = evals[1];
            }
            else {
                retval = evalWhenFalse;
            }
            break;
        default:
            retval = ErrorEval.UNKNOWN_ERROR;
        }
        return retval;