Package io.keikai.range.formula
Class TextFunction
java.lang.Object
io.keikai.range.formula.TextFunction
- All Implemented Interfaces:
Function
Base class for custom functions that take string-shaped arguments
and want a checked-exception escape hatch. Subclasses override
evaluateFunc(io.keikai.range.formula.ValueEval[], int, int) and may throw EvaluationException to
propagate an Excel error code without dirtying the
Function.evaluate(io.keikai.range.formula.ValueEval[], int, int) signature.
Replaces org.apache.poi.ss.formula.functions.TextFunction.
Note that the legacy POI base class also bundled a number of
argument-coercion helpers; those have been deferred to subsequent
commits so this PR can land as a self-contained API surface.
Custom functions that previously called evaluateStringArg(...)
will need to migrate to manual instanceof StringEval checks
(see migration guide).
- Since:
- 7.0.0
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal ValueEvalEvaluate this function with the supplied (already-evaluated) argument values.protected abstract ValueEvalevaluateFunc(ValueEval[] args, int srcCellRow, int srcCellCol) Concrete evaluation logic.
-
Constructor Details
-
TextFunction
public TextFunction()
-
-
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
-
evaluateFunc
protected abstract ValueEval evaluateFunc(ValueEval[] args, int srcCellRow, int srcCellCol) throws EvaluationException Concrete evaluation logic. ThrowEvaluationException(typically viaEvaluationException.invalidValue()) to short-circuit with an Excel error code.- Throws:
EvaluationException
-