Skip to content

Commit fd67b6d

Browse files
committed
Merge pull request #41 from bvp/master
getLastCellNum implementation
2 parents 17750e5 + 053834b commit fd67b6d

1 file changed

Lines changed: 12 additions & 9 deletions

File tree

src/main/java/com/monitorjbl/xlsx/impl/StreamingRow.java

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,17 @@ public Cell getCell(int cellnum) {
6666
return cellMap.get(cellnum);
6767
}
6868

69+
/**
70+
* Gets the index of the last cell contained in this row <b>PLUS ONE</b>.
71+
*
72+
* @return short representing the last logical cell in the row <b>PLUS ONE</b>,
73+
* or -1 if the row does not contain any cells.
74+
*/
75+
@Override
76+
public short getLastCellNum() {
77+
return (short) (cellMap.size() == 0 ? -1 : cellMap.size() + 1);
78+
}
79+
6980
/* Not supported */
7081

7182
/**
@@ -116,14 +127,6 @@ public short getFirstCellNum() {
116127
throw new NotSupportedException();
117128
}
118129

119-
/**
120-
* Not supported
121-
*/
122-
@Override
123-
public short getLastCellNum() {
124-
throw new NotSupportedException();
125-
}
126-
127130
/**
128131
* Not supported
129132
*/
@@ -220,4 +223,4 @@ public int getOutlineLevel() {
220223
throw new NotSupportedException();
221224
}
222225

223-
}
226+
}

0 commit comments

Comments
 (0)