aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJosh Micich <josh@apache.org>2009-11-27 22:53:42 +0000
committerJosh Micich <josh@apache.org>2009-11-27 22:53:42 +0000
commitb8b1ec057eb792b11e2afb8e52c0fe5a149cc6a7 (patch)
treedd002d3a300b157ca34225bbb7b04ba128e1d009 /src
parent43b3e52344930dfc61ef222841e8322a4303913c (diff)
downloadpoi-b8b1ec057eb792b11e2afb8e52c0fe5a149cc6a7.tar.gz
poi-b8b1ec057eb792b11e2afb8e52c0fe5a149cc6a7.zip
Added constants for IF() and CHOOSE() function indexes
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@885043 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src')
-rw-r--r--src/java/org/apache/poi/hssf/record/formula/eval/FunctionEval.java8
-rw-r--r--src/java/org/apache/poi/hssf/record/formula/function/FunctionMetadataRegistry.java5
2 files changed, 10 insertions, 3 deletions
diff --git a/src/java/org/apache/poi/hssf/record/formula/eval/FunctionEval.java b/src/java/org/apache/poi/hssf/record/formula/eval/FunctionEval.java
index 1fa5a38614..66855c07b6 100644
--- a/src/java/org/apache/poi/hssf/record/formula/eval/FunctionEval.java
+++ b/src/java/org/apache/poi/hssf/record/formula/eval/FunctionEval.java
@@ -30,10 +30,14 @@ public final class FunctionEval {
* Some function IDs that require special treatment
*/
private static final class FunctionID {
+ /** 1 */
+ public static final int IF = FunctionMetadataRegistry.FUNCTION_INDEX_IF;
/** 4 */
public static final int SUM = FunctionMetadataRegistry.FUNCTION_INDEX_SUM;
/** 78 */
public static final int OFFSET = 78;
+ /** 100 */
+ public static final int CHOOSE = FunctionMetadataRegistry.FUNCTION_INDEX_CHOOSE;
/** 148 */
public static final int INDIRECT = FunctionMetadataRegistry.FUNCTION_INDEX_INDIRECT;
/** 255 */
@@ -51,7 +55,7 @@ public final class FunctionEval {
Function[] retval = new Function[368];
retval[0] = new Count();
- retval[1] = new If();
+ retval[ID.IF] = new If();
retval[2] = LogicalFunction.ISNA;
retval[3] = LogicalFunction.ISERROR;
retval[ID.SUM] = AggregateFunction.SUM;
@@ -115,7 +119,7 @@ public final class FunctionEval {
retval[97] = NumericFunction.ATAN2;
retval[98] = NumericFunction.ASIN;
retval[99] = NumericFunction.ACOS;
- retval[100] = new Choose();
+ retval[ID.CHOOSE] = new Choose();
retval[101] = new Hlookup();
retval[102] = new Vlookup();
diff --git a/src/java/org/apache/poi/hssf/record/formula/function/FunctionMetadataRegistry.java b/src/java/org/apache/poi/hssf/record/formula/function/FunctionMetadataRegistry.java
index e14366f781..97891c1100 100644
--- a/src/java/org/apache/poi/hssf/record/formula/function/FunctionMetadataRegistry.java
+++ b/src/java/org/apache/poi/hssf/record/formula/function/FunctionMetadataRegistry.java
@@ -30,9 +30,12 @@ public final class FunctionMetadataRegistry {
*/
public static final String FUNCTION_NAME_IF = "IF";
- public static final short FUNCTION_INDEX_SUM = 4;
+ public static final int FUNCTION_INDEX_IF = 1;
+ public static final short FUNCTION_INDEX_SUM = 4;
+ public static final int FUNCTION_INDEX_CHOOSE = 100;
public static final short FUNCTION_INDEX_INDIRECT = 148;
public static final short FUNCTION_INDEX_EXTERNAL = 255;
+
private static FunctionMetadataRegistry _instance;
private final FunctionMetadata[] _functionDataByIndex;