Class TextFunction

java.lang.Object
io.keikai.range.formula.TextFunction
All Implemented Interfaces:
Function

public abstract class TextFunction extends Object implements 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 Details

    • TextFunction

      public TextFunction()
  • Method Details

    • evaluate

      public final ValueEval evaluate(ValueEval[] args, int srcCellRow, int srcCellCol)
      Description copied from interface: Function
      Evaluate this function with the supplied (already-evaluated) argument values.
      Specified by:
      evaluate in interface Function
      Parameters:
      args - evaluated function arguments; never null and never contains null entries
      srcCellRow - 0-based row index of the cell containing the formula
      srcCellCol - 0-based column index of the cell containing the formula
      Returns:
      the result as a ValueEval; return an ErrorEval for error cases
    • evaluateFunc

      protected abstract ValueEval evaluateFunc(ValueEval[] args, int srcCellRow, int srcCellCol) throws EvaluationException
      Concrete evaluation logic. Throw EvaluationException (typically via EvaluationException.invalidValue()) to short-circuit with an Excel error code.
      Throws:
      EvaluationException