poi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From n...@apache.org
Subject svn commit: r618680 - in /poi/trunk/src/java/org/apache/poi/hssf/usermodel: HSSFRow.java HSSFSheet.java
Date Tue, 05 Feb 2008 15:51:39 GMT
Author: nick
Date: Tue Feb  5 07:51:29 2008
New Revision: 618680

URL: http://svn.apache.org/viewvc?rev=618680&view=rev
Log:
Add java.lang.Iterable style methods for iterating over rows and cells, but don't actually
implement that, as it wasn't in jdk 1.3 or jdk 1.4, with is rather tedious

Modified:
    poi/trunk/src/java/org/apache/poi/hssf/usermodel/HSSFRow.java
    poi/trunk/src/java/org/apache/poi/hssf/usermodel/HSSFSheet.java

Modified: poi/trunk/src/java/org/apache/poi/hssf/usermodel/HSSFRow.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/hssf/usermodel/HSSFRow.java?rev=618680&r1=618679&r2=618680&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/hssf/usermodel/HSSFRow.java (original)
+++ poi/trunk/src/java/org/apache/poi/hssf/usermodel/HSSFRow.java Tue Feb  5 07:51:29 2008
@@ -466,10 +466,16 @@
      * @return cell iterator of the physically defined cells.  Note element 4 may
      * actually be row cell depending on how many are defined!
      */
-
     public Iterator cellIterator()
     {
       return new CellIterator();
+    }
+    /**
+     * Alias for {@link CellIterator} to allow
+     *  foreach loops
+     */
+    public Iterator iterator() { 
+       return cellIterator();
     }
     
     private class CellIterator implements Iterator

Modified: poi/trunk/src/java/org/apache/poi/hssf/usermodel/HSSFSheet.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/hssf/usermodel/HSSFSheet.java?rev=618680&r1=618679&r2=618680&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/hssf/usermodel/HSSFSheet.java (original)
+++ poi/trunk/src/java/org/apache/poi/hssf/usermodel/HSSFSheet.java Tue Feb  5 07:51:29 2008
@@ -701,11 +701,18 @@
      * @return an iterator of the PHYSICAL rows.  Meaning the 3rd element may not
      * be the third row if say for instance the second row is undefined.
      */
-
     public Iterator rowIterator()
     {
         return rows.values().iterator();
     }
+    /**
+     * Alias for {@link #rowIterator()} to allow 
+     *  foreach loops
+     */
+    public Iterator iterator() {
+        return rowIterator();
+    }
+    
 
     /**
      * used internally in the API to get the low level Sheet record represented by this



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


Mime
View raw message