/this.rowData.add(lastContents); / /this.raiwData/ is a variable that holds a reference to an ArrayList while /lastContents/ is a String variable that is used to hold the contents of the cell as it is parsed. Calling the /add()/ method on the ArrayList object stores a reference to a specific String in an element of the ArrayList; it stores the cells contents into the ArrayList.
There is nothing preventing you from using an arry and it would be a trivial task to modify the code to do just this. The problem with using arrays is that you need to specify the size of the array at the time you create it in your code and what if you are wrong? If you do not allow enough space for the contents of the workbook then you risk either taking a huge performance hit while you resize the array or your code will throw exceptions when it tries to write to an element that does not exist. Lists allow you to sidestep this problem because they have the ability to resize themselves but they are not a prefect solution. It may be the case that you wish to store the contents of cell B3 into the third element of row two and the code I wrote using Lists will not do this. But you could. There is a class that can take the cell address and convert it into row and column co-ordinates. These would allow you to store the cells contents into a very specific position in an multi-dimensional array if you wished to do this. -- View this message in context: http://apache-poi.1045710.n5.nabble.com/Apache-POI-works-but-it-uses-too-RAM-is-it-a-limit-of-your-library-tp5712425p5712498.html Sent from the POI - User mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscr...@poi.apache.org For additional commands, e-mail: user-h...@poi.apache.org