From eff173c05d5e14f67c469c3bfa80f923bcd851be Mon Sep 17 00:00:00 2001 From: "Amol S. Deshmukh" Date: Sun, 26 Nov 2006 06:15:17 +0000 Subject: [PATCH] superclass for logical functions git-svn-id: https://svn.apache.org/repos/asf/jakarta/poi/trunk@479294 13f79535-47bb-0310-9956-ffa450edef68 --- .../formula/functions/LogicalFunction.java | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/LogicalFunction.java 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 index 0000000000..57e18888dd --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/hssf/record/formula/functions/LogicalFunction.java @@ -0,0 +1,31 @@ +/* + * Created on Nov 25, 2006 + * + */ +package org.apache.poi.hssf.record.formula.functions; + +import org.apache.poi.hssf.record.formula.eval.RefEval; +import org.apache.poi.hssf.record.formula.eval.ValueEval; + +/** + * @author Amol S. Deshmukh < amolweb at ya hoo dot com > + * + */ +public abstract class LogicalFunction implements Function { + + /** + * recursively evaluate any RefEvals + * @param reval + * @return + */ + protected ValueEval xlateRefEval(RefEval reval) { + ValueEval retval = (ValueEval) reval.getInnerValueEval(); + + if (retval instanceof RefEval) { + RefEval re = (RefEval) retval; + retval = xlateRefEval(re); + } + + return retval; + } +} -- 2.39.5