public enum FormulaError extends java.lang.Enum<FormulaError>
Enum Constant and Description |
---|
_NO_ERROR |
CIRCULAR_REF
POI specific code to indicate that there is a circular reference in the formula
|
DIV0
Intended to indicate when any number, including zero, is divided by zero.
|
FUNCTION_NOT_IMPLEMENTED
POI specific code to indicate that the funcition required is not implemented in POI
|
NA
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.
|
Modifier and Type | Method and Description |
---|---|
static FormulaError |
forInt(byte type) |
static FormulaError |
forInt(int type) |
static FormulaError |
forString(java.lang.String code) |
byte |
getCode() |
int |
getLongCode() |
java.lang.String |
getString() |
static boolean |
isValidCode(int errorCode) |
static FormulaError |
valueOf(java.lang.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.
(按照声明的顺序返回包含此枚举类型常量的数组。)
|
@Internal public static final FormulaError _NO_ERROR
public static final FormulaError NULL
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]
(旨在指示何时需要两个区域相交,但不相交。示例:在 SUM(B1 C1) 的情况下,当打算使用逗号时,B1 和 C1 之间的空格被视为二元交集运算符。结束示例])public static final FormulaError DIV0
public static final FormulaError VALUE
Example: In the case of a function argument, text was expected, but a number was provided
(旨在指示何时将不兼容的类型参数传递给函数,或将不兼容的类型操作数与运算符一起使用。示例:在函数参数的情况下,需要文本,但提供了一个数字)public static final FormulaError REF
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.
(旨在指示单元格引用何时无效。示例:如果公式包含对单元格的引用,然后包含该单元格的行或列被删除,#REF!错误结果。如果工作表不支持 20,001 列,则 OFFSET(A1,0,20000) 将产生 #REF!错误。)public static final FormulaError NAME
Example: XYZ/3, where XYZ is not a defined name. Total is & A10, where neither Total nor is is a defined name. Presumably, "Total is " & A10 was intended. SUM(A1C10), where the range A1:C10 was intended.
(旨在指示何时使用看起来像名称的名称,但尚未定义此类名称。示例:XYZ/3,其中 XYZ 不是定义的名称。 Total is & A10,其中 Total 和 is 都不是定义的名称。据推测,“Total is” & A10 是有意的。 SUM(A1C10),其中的范围是 A1:C10。)public static final FormulaError NUM
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.
(旨在指示函数的参数何时具有兼容的类型,但具有在定义该函数的域之外的值。 (这称为域错误。)示例:对 ASIN、ATANH、FACT 和 SQRT 的某些调用可能会导致域错误。旨在表明函数的结果不能以指定类型的值表示,通常是由于极端的幅度。 (这称为范围错误。)示例:FACT(1000) 可能会导致范围错误。)public static final FormulaError NA
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 (用于指示指定值何时不可用。示例:某些函数,例如 SUMX2MY2,对两个数组中的对应元素执行一系列操作。如果这些数组的元素个数不同,那么对于较长数组中的某些元素,较短的数组中没有对应的元素;也就是说,较短数组中的一个或多个值不可用。这个错误值可以通过调用函数 NA 来产生)public static final FormulaError CIRCULAR_REF
public static final FormulaError FUNCTION_NOT_IMPLEMENTED
public static FormulaError[] values()
for (FormulaError c : FormulaError.values()) System.out.println(c);(按照声明的顺序返回包含此枚举类型常量的数组。此方法可用于迭代常量,如下所示: for (FormulaError c : FormulaError.values()) System.out.println(c);)
public static FormulaError valueOf(java.lang.String name)
name
- the name of the enum constant to be returned.
(name - 要返回的枚举常量的名称。)
java.lang.IllegalArgumentException
- if this enum type has no constant with the specified name
(java.lang.IllegalArgumentException - 如果此枚举类型没有具有指定名称的常量)
java.lang.NullPointerException
- if the argument is null
(java.lang.NullPointerException - 如果参数为空)
public byte getCode()
public int getLongCode()
public java.lang.String getString()
public static boolean isValidCode(int errorCode)
public static FormulaError forInt(byte type) throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentException
(java.lang.IllegalArgumentException)
public static FormulaError forInt(int type) throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentException
(java.lang.IllegalArgumentException)
public static FormulaError forString(java.lang.String code) throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentException
(java.lang.IllegalArgumentException)
Copyright 2021 The Apache Software Foundation or its licensors, as applicable.