Package io.keikai.range.formula
Class MultiOperandNumericFunction
java.lang.Object
io.keikai.range.formula.MultiOperandNumericFunction
- All Implemented Interfaces:
Function
Base class for custom numeric functions whose arguments are
accumulated into a flat
double[] array.
Subclasses override evaluate(double[]). The base class
walks each argument:
- An
AreaEvalorTwoDEvalis iterated cell-by-cell. - A
RefEvalresolves to its single inner value. - A
NumberEvalcontributes its numeric value. - A
BoolEvalcontributes1.0/0.0only whencountBoolean=true(controlled by the constructor). - A
BlankEvalcontributes0.0only whencountBlank=true. - A
StringEvalis skipped unlessstrict=true, in which case it short-circuits to#VALUE!. - An
ErrorEvalshort-circuits the entire result to that error.
Replaces org.apache.poi.ss.formula.functions.MultiOperandNumericFunction.
- Since:
- 7.0.0
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedMultiOperandNumericFunction(boolean countBoolean, boolean countBlank, boolean strict) -
Method Summary
-
Constructor Details
-
MultiOperandNumericFunction
protected MultiOperandNumericFunction(boolean countBoolean, boolean countBlank, boolean strict) - Parameters:
countBoolean- whentrue,BoolEvalarguments contribute1.0/0.0; whenfalse, they are skipped.countBlank- whentrue,BlankEvalarguments contribute0.0; whenfalse, they are skipped.strict- whentrue, a non-numeric scalar (StringEval, etc.) short-circuits the call to#VALUE!.
-
-
Method Details
-
evaluate
Description copied from interface:FunctionEvaluate this function with the supplied (already-evaluated) argument values.- Specified by:
evaluatein interfaceFunction- Parameters:
args- evaluated function arguments; nevernulland never containsnullentriessrcCellRow- 0-based row index of the cell containing the formulasrcCellCol- 0-based column index of the cell containing the formula- Returns:
- the result as a
ValueEval; return anErrorEvalfor error cases
-
evaluate
Concrete evaluation over the flattened double array. ThrowEvaluationException(e.g.EvaluationException.numberError()) to return an Excel error code.- Throws:
EvaluationException
-