public abstract class MultiOperandNumericFunction extends java.lang.Object implements Function
Modifier and Type | Class and Description |
---|---|
static class |
MultiOperandNumericFunction.Policy |
Modifier | Constructor and Description |
---|---|
protected |
MultiOperandNumericFunction(boolean isReferenceBoolCounted,
boolean isBlankCounted) |
Modifier and Type | Method and Description |
---|---|
protected abstract double |
evaluate(double[] values) |
ValueEval |
evaluate(ValueEval[] args,
int srcCellRow,
int srcCellCol) |
protected int |
getMaxNumOperands()
Maximum number of operands accepted by this function.
|
protected double[] |
getNumberArray(ValueEval[] operands)
Returns a double array that contains values for the numeric cells
from among the list of operands.
|
boolean |
isHiddenRowCounted() |
boolean |
isSubtotalCounted()
Whether to count nested subtotals.
|
void |
setBlankEvalPolicy(MultiOperandNumericFunction.Policy policy) |
void |
setMissingArgPolicy(MultiOperandNumericFunction.Policy policy) |
protected MultiOperandNumericFunction(boolean isReferenceBoolCounted, boolean isBlankCounted)
public void setMissingArgPolicy(MultiOperandNumericFunction.Policy policy)
public void setBlankEvalPolicy(MultiOperandNumericFunction.Policy policy)
public final ValueEval evaluate(ValueEval[] args, int srcCellRow, int srcCellCol)
evaluate
in interface Function
args
- the evaluated function arguments. Empty values are represented with
BlankEval
or MissingArgEval
, never null
.srcCellRow
- row index of the cell containing the formula under evaluationsrcCellCol
- column index of the cell containing the formula under evaluationErrorEval
, never null
.
Note - Excel uses the error code #NUM! instead of IEEE NaN, so when
numeric functions evaluate to Double.NaN
be sure to translate the result to ErrorEval.NUM_ERROR
.protected abstract double evaluate(double[] values) throws EvaluationException
EvaluationException
protected int getMaxNumOperands()
protected final double[] getNumberArray(ValueEval[] operands) throws EvaluationException
null
.null
EvaluationException
public boolean isSubtotalCounted()
public boolean isHiddenRowCounted()
Subtotal
Copyright 2020 The Apache Software Foundation or its licensors, as applicable.