java.lang.Object
io.github.mbenincasa.javaexcelutils.model.excel.ExcelRow

public class ExcelRow extends Object
ExcelRow is the Row wrapper class of the Apache POI library
Since:
0.3.0
Author:
Mirko Benincasa
  • Constructor Details

    • ExcelRow

      public ExcelRow()
  • Method Details

    • of

      public static ExcelRow of(org.apache.poi.ss.usermodel.Row row)
      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

      public void remove() throws RowNotFoundException
      Remove the selected Row
      Throws:
      RowNotFoundException - If the row is not present or has not been created
      Since:
      0.4.1
    • getCells

      public List<ExcelCell> getCells()
      The list of Cells related to the Row
      Returns:
      A list of Cells
    • getCell

      public ExcelCell getCell(Integer index) throws CellNotFoundException
      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

      public ExcelCell getOrCreateCell(Integer index)
      Retrieve or create a cell by index
      Parameters:
      index - The index of the cell requested
      Returns:
      A ExcelCell
      Since:
      0.4.1
    • removeCell

      public void removeCell(Integer index) throws CellNotFoundException
      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

      public void writeValues(List<?> values)
      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

      public List<?> readValues() throws ReadValueException
      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

      public List<?> readValues(List<Class<?>> classes) throws ReadValueException
      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

      public List<String> 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

      public ExcelSheet getSheet()
      Returns the Sheet to which it belongs
      Returns:
      A ExcelSheet
    • createCell

      public ExcelCell createCell(Integer index)
      Create a new Cell in the Row
      Parameters:
      index - The index in the Row
      Returns:
      A Cell
    • getLastColumnIndex

      public Integer getLastColumnIndex()
      Retrieves the index of the last Cell
      Returns:
      The index of the last Cell
    • countAllColumns

      public Integer countAllColumns(Boolean alsoEmpty)
      Counts how many Cells are compiled
      Parameters:
      alsoEmpty - true if you want to count Cells empty
      Returns:
      The number of Cells compiled