Yes, after a quick look it seems that a TreeMap would work here and would also not be too hard to implement as most accesses are either via colNum or via iteration.
Dominik. On Sun, Nov 29, 2015 at 2:49 PM, Javen O'Neal <[email protected]> wrote: > Is there any particular reason why SXSSFRow is using an array of > SXSSFCells to store the cells in a row? For a sparse spreadsheet, this > would mean having a large array of pointers, most of which are null. > > Most of the operations that operate on the rows are also expensive, > such as getFirstCellNum, getPhysicalNumberOfCells, and requires more > lines of code to get the same functionality, such as > FilledCellIterator and getCellIndex. > > XSSFRow uses a TreeMap to store its rows, which is memory-optimized > for a sparse spreadsheet, and cuts down on lines of code, and > maintains internal variables that would mean we'd get getFirstCellNum, > getPhysicalNumberOfCells, FilledCellIterator, and getCellIndex for > free. > > Right now I want to add a equals method to SXSSFRow, but there aren't > any internal variables I can tie it to. I'd like SXSSFCells[] _cells > to be final, but that isn't possible because the array is manually > resized when creating a cell in a column beyond the capacity of the > array. At the very least this should be a List, which would give us > indexOf, eliminating getCellIndex's custom code--but it seems a > SortedMap/TreeMap is better for memory consumption and sometimes > speed. > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] > --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
