poi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j...@apache.org
Subject svn commit: r885043 - in /poi/trunk/src/java/org/apache/poi/hssf/record/formula: eval/FunctionEval.java function/FunctionMetadataRegistry.java
Date Fri, 27 Nov 2009 22:53:42 GMT
Author: josh
Date: Fri Nov 27 22:53:42 2009
New Revision: 885043

URL: http://svn.apache.org/viewvc?rev=885043&view=rev
Log:
Added constants for IF() and CHOOSE() function indexes

Modified:
    poi/trunk/src/java/org/apache/poi/hssf/record/formula/eval/FunctionEval.java
    poi/trunk/src/java/org/apache/poi/hssf/record/formula/function/FunctionMetadataRegistry.java

Modified: poi/trunk/src/java/org/apache/poi/hssf/record/formula/eval/FunctionEval.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/hssf/record/formula/eval/FunctionEval.java?rev=885043&r1=885042&r2=885043&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/hssf/record/formula/eval/FunctionEval.java (original)
+++ poi/trunk/src/java/org/apache/poi/hssf/record/formula/eval/FunctionEval.java Fri Nov 27
22:53:42 2009
@@ -30,10 +30,14 @@
 	 * 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 @@
 		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 @@
 		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();
 

Modified: poi/trunk/src/java/org/apache/poi/hssf/record/formula/function/FunctionMetadataRegistry.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/hssf/record/formula/function/FunctionMetadataRegistry.java?rev=885043&r1=885042&r2=885043&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/hssf/record/formula/function/FunctionMetadataRegistry.java
(original)
+++ poi/trunk/src/java/org/apache/poi/hssf/record/formula/function/FunctionMetadataRegistry.java
Fri Nov 27 22:53:42 2009
@@ -30,9 +30,12 @@
 	 */
 	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;



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@poi.apache.org
For additional commands, e-mail: commits-help@poi.apache.org


Mime
View raw message