use of org.apache.poi.hssf.record.IndexRecord in project poi by apache.
the class TestSheet method getDbCellRecordPos.
/**
* @return the value calculated for the position of the first DBCELL record for this sheet.
* That value is found on the IndexRecord.
*/
private static int getDbCellRecordPos(InternalSheet sheet) {
MyIndexRecordListener myIndexListener = new MyIndexRecordListener();
sheet.visitContainedRecords(myIndexListener, 0);
IndexRecord indexRecord = myIndexListener.getIndexRecord();
int dbCellRecordPos = indexRecord.getDbcellAt(0);
return dbCellRecordPos;
}
use of org.apache.poi.hssf.record.IndexRecord in project poi by apache.
the class TestSheet method testCreateSheet.
@Test
public void testCreateSheet() {
// Check we're adding row and cell aggregates
List<Record> records = new ArrayList<Record>();
records.add(BOFRecord.createSheetBOF());
records.add(new DimensionsRecord());
records.add(createWindow2Record());
records.add(EOFRecord.instance);
InternalSheet sheet = createSheet(records);
Record[] outRecs = getSheetRecords(sheet, 0);
int pos = 0;
assertTrue(outRecs[pos++] instanceof BOFRecord);
assertTrue(outRecs[pos++] instanceof IndexRecord);
assertTrue(outRecs[pos++] instanceof DimensionsRecord);
assertTrue(outRecs[pos++] instanceof WindowTwoRecord);
assertTrue(outRecs[pos++] instanceof EOFRecord);
}
Aggregations