Apache POI : Difference between row.getLastCellNum

2019-08-27 07:49发布

问题:

What is the difference between row.getLastCellNum() and row.getNoOfPhysicalCell() in POI HSSFRow ? Or are they same ?

回答1:

getLastCellNum()

Gets the index of the last cell contained in this row PLUS ONE

getPhysicalNumberOfCells()

gets the number of defined cells (NOT number of cells in the actual row!). That is to say if only columns 0,4,5 have values then there would be 3.