Enum FormulaError
- java.lang.Object
-
- java.lang.Enum<FormulaError>
-
- org.apache.poi.ss.usermodel.FormulaError
-
- All Implemented Interfaces:
Serializable
,Comparable<FormulaError>
public enum FormulaError extends Enum<FormulaError>
Enumerates error values in SpreadsheetML formula calculations. See also OOO's excelfileformat.pdf (2.5.6)
-
-
Enum Constant Summary
Enum Constants Enum Constant Description _NO_ERROR
CIRCULAR_REF
POI specific code to indicate that there is a circular reference in the formulaDIV0
Intended to indicate when any number, including zero, is divided by zero.FUNCTION_NOT_IMPLEMENTED
POI specific code to indicate that the function required is not implemented in POINA
Intended to indicate when a designated value is not available.NAME
Intended to indicate when what looks like a name is used, but no such name has been defined.NULL
Intended to indicate when two areas are required to intersect, but do not.NUM
Intended to indicate when an argument to a function has a compatible type, but has a value that is outside the domain over which that function is defined.REF
Intended to indicate when a cell reference is invalid.VALUE
Intended to indicate when an incompatible type argument is passed to a function, or an incompatible type operand is used with an operator.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static FormulaError
forInt(byte type)
static FormulaError
forInt(int type)
static FormulaError
forString(String code)
byte
getCode()
int
getLongCode()
String
getString()
static boolean
isValidCode(int errorCode)
static FormulaError
valueOf(String name)
Returns the enum constant of this type with the specified name.static FormulaError[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
_NO_ERROR
@Internal public static final FormulaError _NO_ERROR
-
NULL
public static final FormulaError NULL
Intended to indicate when two areas are required to intersect, but do not.Example: In the case of SUM(B1 C1), the space between B1 and C1 is treated as the binary intersection operator, when a comma was intended. end example]
-
DIV0
public static final FormulaError DIV0
Intended to indicate when any number, including zero, is divided by zero. Note: However, any error code divided by zero results in that error code.
-
VALUE
public static final FormulaError VALUE
Intended to indicate when an incompatible type argument is passed to a function, or an incompatible type operand is used with an operator.Example: In the case of a function argument, text was expected, but a number was provided
-
REF
public static final FormulaError REF
Intended to indicate when a cell reference is invalid.Example: If a formula contains a reference to a cell, and then the row or column containing that cell is deleted, a #REF! error results. If a worksheet does not support 20,001 columns, OFFSET(A1,0,20000) will result in a #REF! error.
-
NAME
public static final FormulaError NAME
Intended to indicate when what looks like a name is used, but no such name has been defined.Example:
- XYZ/3, where XYZ is not a defined name.
Total is & A10
, where neitherTotal
noris
is a defined name. Presumably,"Total is " & A10
was intended.- SUM(A1C10), where the range A1:C10 was intended.
-
NUM
public static final FormulaError NUM
Intended to indicate when an argument to a function has a compatible type, but has a value that is outside the domain over which that function is defined. (This is known as a domain error.)Example: Certain calls to ASIN, ATANH, FACT, and SQRT might result in domain errors.
Intended to indicate that the result of a function cannot be represented in a value of the specified type, typically due to extreme magnitude. (This is known as a range error.)Example: FACT(1000) might result in a range error.
-
NA
public static final FormulaError NA
Intended to indicate when a designated value is not available.Example: Some functions, such as SUMX2MY2, perform a series of operations on corresponding elements in two arrays. If those arrays do not have the same number of elements, then for some elements in the longer array, there are no corresponding elements in the shorter one; that is, one or more values in the shorter array are not available.
This error value can be produced by calling the function NA
-
CIRCULAR_REF
public static final FormulaError CIRCULAR_REF
POI specific code to indicate that there is a circular reference in the formula
-
FUNCTION_NOT_IMPLEMENTED
public static final FormulaError FUNCTION_NOT_IMPLEMENTED
POI specific code to indicate that the function required is not implemented in POI
-
-
Method Detail
-
values
public static FormulaError[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (FormulaError c : FormulaError.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static FormulaError valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is null
-
getCode
public byte getCode()
- Returns:
- numeric code of the error
-
getLongCode
public int getLongCode()
- Returns:
- long (internal) numeric code of the error
-
getString
public String getString()
- Returns:
- string representation of the error
-
isValidCode
public static boolean isValidCode(int errorCode)
-
forInt
public static FormulaError forInt(byte type) throws IllegalArgumentException
- Throws:
IllegalArgumentException
-
forInt
public static FormulaError forInt(int type) throws IllegalArgumentException
- Throws:
IllegalArgumentException
-
forString
public static FormulaError forString(String code) throws IllegalArgumentException
- Throws:
IllegalArgumentException
-
-