Class RowImpl

java.lang.Object
org.csveed.row.RowImpl
All Implemented Interfaces:
Iterable<String>, Row

public class RowImpl extends Object implements Row
The Class RowImpl.
  • Constructor Details

    • RowImpl

      public RowImpl(Line line, Header header)
      Instantiates a new row impl.
      Parameters:
      line - the line
      header - the header
  • Method Details

    • getHeader

      public Header getHeader()
      Description copied from interface: Row
      Returns the Headers and throws an exception if it does not exist. Use hasHeader() if you want to prevent the throwing of an exception when a Header can lack
      Specified by:
      getHeader in interface Row
      Returns:
      the Header for the Row
    • reportOnEndOfLine

      public RowReport reportOnEndOfLine()
      Description copied from interface: Row
      Generates a report on the Row with focus on the end of the row. This is internally used when there is a syntax error in the line. It could also be used when there is an error that can not be traced back to a single cell.
      Specified by:
      reportOnEndOfLine in interface Row
      Returns:
      report on the row with focus on the end of the row
    • reportOnColumn

      public RowReport reportOnColumn(int columnIndex)
      Description copied from interface: Row
      Generates a report on the Row with focus on a particular cell. The report can return lines for web consumption (assisting highlighting) or monospaced font printing with dual lines, the first holding the value of the line, the second showing where the error occurred.
      Specified by:
      reportOnColumn in interface Row
      Parameters:
      columnIndex - the index of the column to focus the report on
      Returns:
      report on the row with focus on a particular cell
    • get

      public String get(String columnName)
      Description copied from interface: Row
      Gets the content of the cell in the column named columnName. This method depends on the availability of a Header, or will otherwise throw an exception
      Specified by:
      get in interface Row
      Parameters:
      columnName - the cell of the Row in the same column as the header with name columnName
      Returns:
      the content of the cell
    • getColumnName

      public String getColumnName(int columnIndex)
      Description copied from interface: Row
      Gets the column name belonging to the cell. This method depends on the availability of a Header, or will otherwise throw an exception
      Specified by:
      getColumnName in interface Row
      Parameters:
      columnIndex - the position of the header cell within the Header line
      Returns:
      the name of the column
    • hasHeader

      public boolean hasHeader()
      Description copied from interface: Row
      Returns true if a Header has been set for this Row.
      Specified by:
      hasHeader in interface Row
      Returns:
      true if Header has been found
    • size

      public int size()
      Description copied from interface: Row
      The number of columns in the Row.
      Specified by:
      size in interface Row
      Returns:
      number of columns
    • get

      public String get(int columnIndex)
      Description copied from interface: Row
      Gets the content of the cell on the basis of its cell position within the Row. Counting is 0-based.
      Specified by:
      get in interface Row
      Parameters:
      columnIndex - the position of the cell within the Row
      Returns:
      the content of the cell
    • iterator

      public Iterator<String> iterator()
      Returns an iterator over the individual cells of a Row
      Specified by:
      iterator in interface Iterable<String>
      Returns:
      iterator over the cells in String format