Skip to content

Instantly share code, notes, and snippets.

@Denyol
Created April 13, 2021 11:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Denyol/ee60e32265e005954fd1a53729622e4f to your computer and use it in GitHub Desktop.
Save Denyol/ee60e32265e005954fd1a53729622e4f to your computer and use it in GitHub Desktop.
package me.denyol.model.spreadsheet;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.Row;
class SheetCell {
private final Cell cell;
private final Row row;
SheetCell(Cell cell, Row row) {
this.cell = cell;
this.row = row;
}
Cell getCell() {
return cell;
}
Row getRow() {
return row;
}
public int getRowIndex() {
return row.getRowNum();
}
public double toDouble() throws IllegalStateException {
return cell.getNumericCellValue();
}
public boolean toBoolean() throws IllegalStateException {
return cell.getBooleanCellValue();
}
@Override
public String toString() {
return CellUtil.toString(cell);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment