Package io.keikai.range.formula
Class ErrorEval
java.lang.Object
io.keikai.range.formula.ErrorEval
- All Implemented Interfaces:
ValueEval
Error value in the formula evaluator (e.g.
#VALUE!,
#DIV/0!, #N/A, …).
Returned by Function.evaluate(io.keikai.range.formula.ValueEval[], int, int) to propagate Excel error
codes back to the caller. Use the named constants
(VALUE_INVALID, NA, …) — ErrorEval
instances are flyweight singletons.
Replaces org.apache.poi.ss.formula.eval.ErrorEval. Error
codes match Excel / ECMA-376 §18.17.3 (errorTypeValues).
- Since:
- 7.0.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final ErrorEval#DIV/0!— division by zero.static final ErrorEval#N/A— value not available to the function.static final ErrorEval#NAME?— unrecognised name in formula.static final ErrorEval#NULL!— intersection of two ranges does not intersect.static final ErrorEval#NUM!— numeric value out of legal range.static final ErrorEval#REF!— invalid cell reference (often after delete).static final ErrorEval#VALUE!— wrong type of argument. -
Method Summary
-
Field Details
-
NULL_INTERSECTION
#NULL!— intersection of two ranges does not intersect. -
DIV_ZERO
#DIV/0!— division by zero. -
VALUE_INVALID
#VALUE!— wrong type of argument. -
REF_INVALID
#REF!— invalid cell reference (often after delete). -
NAME_INVALID
#NAME?— unrecognised name in formula. -
NUM_ERROR
#NUM!— numeric value out of legal range. -
NA
#N/A— value not available to the function.
-
-
Method Details
-
getErrorCode
public int getErrorCode()- Returns:
- the Excel error code (0, 7, 15, 23, 29, 36, 42).
-
getErrorString
- Returns:
- the Excel-style error string (e.g.
"#VALUE!").
-
valueOf
Look up anErrorEvalby its Excel error code.- Parameters:
code- Excel error code (0, 7, 15, 23, 29, 36, 42)- Returns:
- the matching singleton
- Throws:
IllegalArgumentException- for an unknown code
-
toString
-