Created
April 13, 2021 11:07
-
-
Save Denyol/ee60e32265e005954fd1a53729622e4f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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