BooleanFunctionpublic abstract class BooleanFunction extends Object implements Function
Methods Summary |
---|
private org.apache.poi.hssf.record.formula.eval.ValueEval | internalResolve(org.apache.poi.hssf.record.formula.eval.Eval ve, boolean stringsAreBlanks)
ValueEval retval = null;
// blankeval is returned as is
if (ve instanceof BlankEval) {
retval = BlankEval.INSTANCE;
}
// stringeval
else if (ve instanceof StringEval) {
retval = stringsAreBlanks ? (ValueEval) BlankEval.INSTANCE : (StringEval) ve;
}
// bools are bools :)
else if (ve instanceof BoolEval) {
retval = (BoolEval) ve;
}
// convert numbers to bool
else if (ve instanceof NumericValueEval) {
NumericValueEval ne = (NumericValueEval) ve;
double d = ne.getNumberValue();
retval = Double.isNaN(d)
? (ValueEval) ErrorEval.VALUE_INVALID
: (d != 0)
? BoolEval.TRUE
: BoolEval.FALSE;
}
// since refevals
else {
retval = ErrorEval.VALUE_INVALID;
}
return retval;
| protected org.apache.poi.hssf.record.formula.eval.ValueEval | singleOperandEvaluate(org.apache.poi.hssf.record.formula.eval.Eval eval, int srcRow, short srcCol, boolean stringsAreBlanks)
ValueEval retval;
if (eval instanceof RefEval) {
RefEval re = (RefEval) eval;
ValueEval ve = re.getInnerValueEval();
retval = internalResolve(ve, true);
}
else {
retval = internalResolve(eval, stringsAreBlanks);
}
return retval;
|
|