Class ExcelRow
java.lang.Object
io.github.mbenincasa.javaexcelutils.model.excel.ExcelRow
ExcelRow
is the Row
wrapper class of the Apache POI library- Since:
- 0.3.0
- Author:
- Mirko Benincasa
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncountAllColumns
(Boolean alsoEmpty) Counts how many Cells are compiledcreateCell
(Integer index) Create a new Cell in the RowRetrieve a cell by indexgetCells()
The list of Cells related to the RowRetrieves the index of the last CellgetOrCreateCell
(Integer index) Retrieve or create a cell by indexgetSheet()
Returns the Sheet to which it belongsstatic ExcelRow
of
(org.apache.poi.ss.usermodel.Row row) Get to an ExcelRow instance from Apache POI RowList<?>
Reads the values of all cells in the rowList<?>
readValues
(List<Class<?>> classes) Reads the values of all cells in the rowReads the values of all cells in the row as a Stringvoid
remove()
Remove the selected Rowvoid
removeCell
(Integer index) Removes a cell by indexvoid
writeValues
(List<?> values) Write the values in the cells of the row
-
Constructor Details
-
ExcelRow
public ExcelRow()
-
-
Method Details
-
of
Get to an ExcelRow instance from Apache POI Row- Parameters:
row
- The Row instance to wrap- Returns:
- The ExcelRow instance
- Since:
- 0.5.0
-
remove
Remove the selected Row- Throws:
RowNotFoundException
- If the row is not present or has not been created- Since:
- 0.4.1
-
getCells
The list of Cells related to the Row- Returns:
- A list of Cells
-
getCell
Retrieve a cell by index- Parameters:
index
- The index of the cell requested- Returns:
- A ExcelCell
- Throws:
CellNotFoundException
- If the cell is not present or has not been created- Since:
- 0.4.1
-
getOrCreateCell
Retrieve or create a cell by index- Parameters:
index
- The index of the cell requested- Returns:
- A ExcelCell
- Since:
- 0.4.1
-
removeCell
Removes a cell by index- Parameters:
index
- The index of the row to remove- Throws:
CellNotFoundException
- If the cell is not present or has not been created- Since:
- 0.4.1
-
writeValues
Write the values in the cells of the row- Parameters:
values
- The values to write in the cells of the row- Since:
- 0.4.1
-
readValues
Reads the values of all cells in the row- Returns:
- The list of values written in the cells
- Throws:
ReadValueException
- If an error occurs while reading- Since:
- 0.4.1
-
readValues
Reads the values of all cells in the row- Parameters:
classes
- A list of Classes that is used to cast the results read- Returns:
- The list of values written in the cells
- Throws:
ReadValueException
- If an error occurs while reading- Since:
- 0.4.1
-
readValuesAsString
Reads the values of all cells in the row as a String- Returns:
- The list of values, such as String, written in the cells
- Since:
- 0.4.1
-
getSheet
Returns the Sheet to which it belongs- Returns:
- A ExcelSheet
-
createCell
Create a new Cell in the Row- Parameters:
index
- The index in the Row- Returns:
- A Cell
-
getLastColumnIndex
Retrieves the index of the last Cell- Returns:
- The index of the last Cell
-
countAllColumns
Counts how many Cells are compiled- Parameters:
alsoEmpty
-true
if you want to count Cells empty- Returns:
- The number of Cells compiled
-