You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@poi.apache.org by jo...@apache.org on 2009/12/08 22:48:54 UTC

svn commit: r888582 - in /poi/trunk/src: java/org/apache/poi/hssf/record/formula/eval/ java/org/apache/poi/ss/formula/ testcases/org/apache/poi/hssf/record/formula/eval/

Author: josh
Date: Tue Dec  8 21:48:54 2009
New Revision: 888582

URL: http://svn.apache.org/viewvc?rev=888582&view=rev
Log:
Renamed AreaEval method from getValueAt() to getAbsoluteValue()

Modified:
    poi/trunk/src/java/org/apache/poi/hssf/record/formula/eval/AreaEval.java
    poi/trunk/src/java/org/apache/poi/hssf/record/formula/eval/AreaEvalBase.java
    poi/trunk/src/java/org/apache/poi/hssf/record/formula/eval/OperandResolver.java
    poi/trunk/src/java/org/apache/poi/ss/formula/WorkbookEvaluator.java
    poi/trunk/src/testcases/org/apache/poi/hssf/record/formula/eval/TestAreaEval.java

Modified: poi/trunk/src/java/org/apache/poi/hssf/record/formula/eval/AreaEval.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/hssf/record/formula/eval/AreaEval.java?rev=888582&r1=888581&r2=888582&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/hssf/record/formula/eval/AreaEval.java (original)
+++ poi/trunk/src/java/org/apache/poi/hssf/record/formula/eval/AreaEval.java Tue Dec  8 21:48:54 2009
@@ -62,11 +62,11 @@
     boolean isColumn();
 
     /**
-     * @return the ValueEval from within this area at the specified row and col index. Never 
-     * <code>null</code> (possibly {@link BlankEval}).  The specified indexes should be absolute 
-     * indexes in the sheet and not relative indexes within the area.  
+     * @return the ValueEval from within this area at the specified row and col index. Never
+     * <code>null</code> (possibly {@link BlankEval}).  The specified indexes should be absolute
+     * indexes in the sheet and not relative indexes within the area.
      */
-    ValueEval getValueAt(int row, int col);
+    ValueEval getAbsoluteValue(int row, int col);
 
     /**
      * returns true if the cell at row and col specified
@@ -92,9 +92,9 @@
     int getWidth();
     int getHeight();
     /**
-     * @return the ValueEval from within this area at the specified relativeRowIndex and 
+     * @return the ValueEval from within this area at the specified relativeRowIndex and
      * relativeColumnIndex. Never <code>null</code> (possibly {@link BlankEval}). The
-     * specified indexes should relative to the top left corner of this area.  
+     * specified indexes should relative to the top left corner of this area.
      */
     ValueEval getRelativeValue(int relativeRowIndex, int relativeColumnIndex);
 

Modified: poi/trunk/src/java/org/apache/poi/hssf/record/formula/eval/AreaEvalBase.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/hssf/record/formula/eval/AreaEvalBase.java?rev=888582&r1=888581&r2=888582&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/hssf/record/formula/eval/AreaEvalBase.java (original)
+++ poi/trunk/src/java/org/apache/poi/hssf/record/formula/eval/AreaEvalBase.java Tue Dec  8 21:48:54 2009
@@ -67,7 +67,7 @@
 		return _lastRow;
 	}
 
-	public final ValueEval getValueAt(int row, int col) {
+	public final ValueEval getAbsoluteValue(int row, int col) {
 		int rowOffsetIx = row - _firstRow;
 		int colOffsetIx = col - _firstColumn;
 

Modified: poi/trunk/src/java/org/apache/poi/hssf/record/formula/eval/OperandResolver.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/hssf/record/formula/eval/OperandResolver.java?rev=888582&r1=888581&r2=888582&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/hssf/record/formula/eval/OperandResolver.java (original)
+++ poi/trunk/src/java/org/apache/poi/hssf/record/formula/eval/OperandResolver.java Tue Dec  8 21:48:54 2009
@@ -151,19 +151,19 @@
 			if(!ae.containsRow(srcCellRow)) {
 				throw EvaluationException.invalidValue();
 			}
-			return ae.getValueAt(srcCellRow, ae.getFirstColumn());
+			return ae.getAbsoluteValue(srcCellRow, ae.getFirstColumn());
 		}
 		if(!ae.isRow()) {
 			// multi-column, multi-row area
 			if(ae.containsRow(srcCellRow) && ae.containsColumn(srcCellCol)) {
-				return ae.getValueAt(ae.getFirstRow(), ae.getFirstColumn());
+				return ae.getAbsoluteValue(ae.getFirstRow(), ae.getFirstColumn());
 			}
 			throw EvaluationException.invalidValue();
 		}
 		if(!ae.containsColumn(srcCellCol)) {
 			throw EvaluationException.invalidValue();
 		}
-		return ae.getValueAt(ae.getFirstRow(), srcCellCol);
+		return ae.getAbsoluteValue(ae.getFirstRow(), srcCellCol);
 	}
 
 	/**

Modified: poi/trunk/src/java/org/apache/poi/ss/formula/WorkbookEvaluator.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/ss/formula/WorkbookEvaluator.java?rev=888582&r1=888581&r2=888582&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/ss/formula/WorkbookEvaluator.java (original)
+++ poi/trunk/src/java/org/apache/poi/ss/formula/WorkbookEvaluator.java Tue Dec  8 21:48:54 2009
@@ -497,10 +497,10 @@
 				if(ae.isColumn()) {
 					return ae.getRelativeValue(0, 0);
 				}
-				return ae.getValueAt(ae.getFirstRow(), srcColNum);
+				return ae.getAbsoluteValue(ae.getFirstRow(), srcColNum);
 			}
 			if (ae.isColumn()) {
-				return ae.getValueAt(srcRowNum, ae.getFirstColumn());
+				return ae.getAbsoluteValue(srcRowNum, ae.getFirstColumn());
 			}
 			return ErrorEval.VALUE_INVALID;
 		}

Modified: poi/trunk/src/testcases/org/apache/poi/hssf/record/formula/eval/TestAreaEval.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/testcases/org/apache/poi/hssf/record/formula/eval/TestAreaEval.java?rev=888582&r1=888581&r2=888582&view=diff
==============================================================================
--- poi/trunk/src/testcases/org/apache/poi/hssf/record/formula/eval/TestAreaEval.java (original)
+++ poi/trunk/src/testcases/org/apache/poi/hssf/record/formula/eval/TestAreaEval.java Tue Dec  8 21:48:54 2009
@@ -25,7 +25,7 @@
 
 /**
  * Tests for <tt>AreaEval</tt>
- *  
+ *
  * @author Josh Micich
  */
 public final class TestAreaEval extends TestCase {
@@ -35,15 +35,15 @@
 		AreaPtg ptg = new AreaPtg("B2:D3");
 		NumberEval one = new NumberEval(1);
 		ValueEval[] values = {
-				one,	
-				new NumberEval(2),	
-				new NumberEval(3),	
-				new NumberEval(4),	
-				new NumberEval(5),	
-				new NumberEval(6),	
+				one,
+				new NumberEval(2),
+				new NumberEval(3),
+				new NumberEval(4),
+				new NumberEval(5),
+				new NumberEval(6),
 		};
 		AreaEval ae = EvalFactory.createAreaEval(ptg, values);
-		if (one == ae.getValueAt(1, 2)) {
+		if (one == ae.getAbsoluteValue(1, 2)) {
 			throw new AssertionFailedError("Identified bug 44950 a");
 		}
 		confirm(1, ae, 1, 1);
@@ -52,12 +52,11 @@
 		confirm(4, ae, 2, 1);
 		confirm(5, ae, 2, 2);
 		confirm(6, ae, 2, 3);
-		
+
 	}
 
 	private static void confirm(int expectedValue, AreaEval ae, int row, int col) {
-		NumberEval v = (NumberEval) ae.getValueAt(row, col);
+		NumberEval v = (NumberEval) ae.getAbsoluteValue(row, col);
 		assertEquals(expectedValue, v.getNumberValue(), 0.0);
 	}
-
 }



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