Using java Syntax Highlighting
SheetData sheetData = sheet.getJaxbElement().getSheetData();
Row row = Context.getsmlObjectFactory().createRow();
Cell cell = Context.getsmlObjectFactory().createCell();
cell.setV(value);
cell.setR(colPos+rowPos); // "A1"
row.setR(rowPos); // 1
row.getC().add(cell);
sheetData.getRow().add(row);
Row row = Context.getsmlObjectFactory().createRow();
Cell cell = Context.getsmlObjectFactory().createCell();
cell.setV(value);
cell.setR(colPos+rowPos); // "A1"
row.setR(rowPos); // 1
row.getC().add(cell);
sheetData.getRow().add(row);
Parsed in 0.015 seconds, using GeSHi 1.0.8.4
Short of looping through the List returned by getRow() and checking the value of row.getR(), is there a better way to reuse Rows? Store my own HashMap? getRow().get(index), for example, isn't guaranteed to return the Row with R equal to index.
Or does this even matter? Having multiple Row elements with the same R property doesn't seem to cause problems, but it seems like reuse would be more efficient.