Class BooleanFunction
- java.lang.Object
-
- org.apache.poi.ss.formula.functions.BooleanFunction
-
- All Implemented Interfaces:
ArrayFunction
,Function
public abstract class BooleanFunction extends Object implements Function, ArrayFunction
Here are the general rules concerning Boolean functions:- Blanks are ignored (not either true or false)
- Strings are ignored if part of an area ref or cell ref, otherwise they must be 'true' or 'false'
- Numbers: 0 is false. Any other number is TRUE
- Areas: *all* cells in area are evaluated according to the above rules
-
-
Constructor Summary
Constructors Constructor Description BooleanFunction()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description ValueEval
evaluate(ValueEval[] args, int srcRow, int srcCol)
ValueEval
evaluateArray(ValueEval[] args, int srcRowIndex, int srcColumnIndex)
protected abstract boolean
getInitialResultValue()
protected abstract boolean
partialEvaluate(boolean cumulativeResult, boolean currentValue)
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.poi.ss.formula.functions.ArrayFunction
evaluateOneArrayArg, evaluateTwoArrayArgs
-
-
-
-
Method Detail
-
evaluate
public final ValueEval evaluate(ValueEval[] args, int srcRow, int srcCol)
- Specified by:
evaluate
in interfaceFunction
- Parameters:
args
- the evaluated function arguments. Empty values are represented withBlankEval
orMissingArgEval
, nevernull
.srcRow
- row index of the cell containing the formula under evaluationsrcCol
- column index of the cell containing the formula under evaluation- Returns:
- The evaluated result, possibly an
ErrorEval
, nevernull
. Note - Excel uses the error code #NUM! instead of IEEE NaN, so when numeric functions evaluate toDouble.NaN
be sure to translate the result toErrorEval.NUM_ERROR
.
-
getInitialResultValue
protected abstract boolean getInitialResultValue()
-
partialEvaluate
protected abstract boolean partialEvaluate(boolean cumulativeResult, boolean currentValue)
-
evaluateArray
public ValueEval evaluateArray(ValueEval[] args, int srcRowIndex, int srcColumnIndex)
- Specified by:
evaluateArray
in interfaceArrayFunction
- Parameters:
args
- the evaluated function arguments. Empty values are represented withBlankEval
orMissingArgEval
, nevernull
.srcRowIndex
- row index of the cell containing the formula under evaluationsrcColumnIndex
- column index of the cell containing the formula under evaluation- Returns:
- The evaluated result, possibly an
ErrorEval
, nevernull
. Note - Excel uses the error code #NUM! instead of IEEE NaN, so when numeric functions evaluate toDouble.NaN
be sure to translate the result toErrorEval.NUM_ERROR
.
-
-