poi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ye...@apache.org
Subject svn commit: r1133821 - /poi/trunk/src/documentation/content/xdocs/spreadsheet/how-to.xml
Date Thu, 09 Jun 2011 12:22:40 GMT
Author: yegor
Date: Thu Jun  9 12:22:39 2011
New Revision: 1133821

URL: http://svn.apache.org/viewvc?rev=1133821&view=rev
Log:
fixed a typo

Modified:
    poi/trunk/src/documentation/content/xdocs/spreadsheet/how-to.xml

Modified: poi/trunk/src/documentation/content/xdocs/spreadsheet/how-to.xml
URL: http://svn.apache.org/viewvc/poi/trunk/src/documentation/content/xdocs/spreadsheet/how-to.xml?rev=1133821&r1=1133820&r2=1133821&view=diff
==============================================================================
--- poi/trunk/src/documentation/content/xdocs/spreadsheet/how-to.xml (original)
+++ poi/trunk/src/documentation/content/xdocs/spreadsheet/how-to.xml Thu Jun  9 12:22:39 2011
@@ -658,6 +658,7 @@ public class ExampleEventUserModel {
 
 <source><![CDATA[
 
+import junit.framework.Assert;
 import org.apache.poi.ss.usermodel.Cell;
 import org.apache.poi.ss.usermodel.Row;
 import org.apache.poi.ss.usermodel.Sheet;
@@ -676,14 +677,18 @@ import org.apache.poi.xssf.streaming.SXS
                 cell.setCellValue(address);
             }
 
+        }
 
-            for(Row rowInMemory : sh) {
-                // the row iterator iterates over rows in memory, i.e. over the last 100
rows
-                System.out.println("Row in memory: " + rowInMemory.getRowNum());
-            }
-
+        // Rows with rownum < 900 are flushed and not accessible
+        for(int rownum = 0; rownum < 900; rownum++){
+          Assert.assertNull(sh.getRow(rownum));
         }
 
+        // ther last 100 rows are still in memory
+        for(int rownum = 900; rownum < 1000; rownum++){
+            Assert.assertNotNull(sh.getRow(rownum));
+        }
+        
         FileOutputStream out = new FileOutputStream("/temp/sxssf.xlsx");
         wb.write(out);
         out.close();
@@ -691,7 +696,7 @@ import org.apache.poi.xssf.streaming.SXS
 
 
 ]]></source>
-<p>The next example turns off auto-flashing (windowSize=-1) and the code manually controls
how portions of data are written to disk</p>
+<p>The next example turns off auto-flushing (windowSize=-1) and the code manually controls
how portions of data are written to disk</p>
 <source><![CDATA[
 
 import org.apache.poi.ss.usermodel.Cell;
@@ -702,7 +707,7 @@ import org.apache.poi.ss.util.CellRefere
 import org.apache.poi.xssf.streaming.SXSSFWorkbook;
 
     public static void main(String[] args) throws Throwable {
-        Workbook wb = new SXSSFWorkbook(-1); // turn off auto-flashing and accumulate all
rows in memory
+        Workbook wb = new SXSSFWorkbook(-1); // turn off auto-flushing and accumulate all
rows in memory
         Sheet sh = wb.createSheet();
         for(int rownum = 0; rownum < 1000; rownum++){
             Row row = sh.createRow(rownum);



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


Mime
View raw message