]> source.dussan.org Git - poi.git/commitdiff
superclass for logical functions
authorAmol S. Deshmukh <amol@apache.org>
Sun, 26 Nov 2006 06:15:17 +0000 (06:15 +0000)
committerAmol S. Deshmukh <amol@apache.org>
Sun, 26 Nov 2006 06:15:17 +0000 (06:15 +0000)
git-svn-id: https://svn.apache.org/repos/asf/jakarta/poi/trunk@479294 13f79535-47bb-0310-9956-ffa450edef68

src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/LogicalFunction.java [new file with mode: 0644]

diff --git a/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/LogicalFunction.java b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/LogicalFunction.java
new file mode 100644 (file)
index 0000000..57e1888
--- /dev/null
@@ -0,0 +1,31 @@
+/*\r
+ * Created on Nov 25, 2006\r
+ *\r
+ */\r
+package org.apache.poi.hssf.record.formula.functions;\r
+\r
+import org.apache.poi.hssf.record.formula.eval.RefEval;\r
+import org.apache.poi.hssf.record.formula.eval.ValueEval;\r
+\r
+/**\r
+ * @author Amol S. Deshmukh &lt; amolweb at ya hoo dot com &gt;\r
+ *\r
+ */\r
+public abstract class LogicalFunction implements Function {\r
+\r
+    /**\r
+     * recursively evaluate any RefEvals\r
+     * @param reval\r
+     * @return\r
+     */\r
+    protected ValueEval xlateRefEval(RefEval reval) {\r
+        ValueEval retval = (ValueEval) reval.getInnerValueEval();\r
+        \r
+        if (retval instanceof RefEval) {\r
+            RefEval re = (RefEval) retval;\r
+            retval = xlateRefEval(re);\r
+        }\r
+\r
+        return retval;\r
+    }\r
+}\r