Skip to content

Commit

Permalink
Merge pull request #41 from bvp/master
Browse files Browse the repository at this point in the history
getLastCellNum implementation
  • Loading branch information
monitorjbl committed May 27, 2016
2 parents 17750e5 + 053834b commit fd67b6d
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions src/main/java/com/monitorjbl/xlsx/impl/StreamingRow.java
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,17 @@ public Cell getCell(int cellnum) {
return cellMap.get(cellnum);
}

/**
* Gets the index of the last cell contained in this row <b>PLUS ONE</b>.
*
* @return short representing the last logical cell in the row <b>PLUS ONE</b>,
* or -1 if the row does not contain any cells.
*/
@Override
public short getLastCellNum() {
return (short) (cellMap.size() == 0 ? -1 : cellMap.size() + 1);
}

/* Not supported */

/**
Expand Down Expand Up @@ -116,14 +127,6 @@ public short getFirstCellNum() {
throw new NotSupportedException();
}

/**
* Not supported
*/
@Override
public short getLastCellNum() {
throw new NotSupportedException();
}

/**
* Not supported
*/
Expand Down Expand Up @@ -220,4 +223,4 @@ public int getOutlineLevel() {
throw new NotSupportedException();
}

}
}

0 comments on commit fd67b6d

Please sign in to comment.