Class CsvContext

  • All Implemented Interfaces:
    java.io.Serializable

    public final class CsvContext
    extends java.lang.Object
    implements java.io.Serializable
    This object represents the current context of a given CSV file being either read or written to. The lineNumber is the actual line number (beginning at 1) of the file being read or written to. The rowNumber (beginning at 1) is the number of the CSV row (which will be identical to lineNumber if no rows span multiple lines) - the last rowNumber will correspond with the number of CSV records. The columnNumber (beginning at 1) is the number of the CSV column.
    See Also:
    Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private int columnNumber
      the CSV column number
      private int lineNumber
      the line number of the file being read/written
      private int rowNumber
      the CSV row number (CSV rows can span multiple lines)
      private java.util.List<java.lang.Object> rowSource
      the row just read in, or to be written
      private static long serialVersionUID  
    • Constructor Summary

      Constructors 
      Constructor Description
      CsvContext​(int lineNumber, int rowNumber, int columnNumber)
      Constructs a new CsvContext.
      CsvContext​(CsvContext c)
      Constructs a new CsvContext that is a copy of the provided CsvContext.
    • Field Detail

      • lineNumber

        private int lineNumber
        the line number of the file being read/written
      • rowNumber

        private int rowNumber
        the CSV row number (CSV rows can span multiple lines)
      • columnNumber

        private int columnNumber
        the CSV column number
      • rowSource

        private java.util.List<java.lang.Object> rowSource
        the row just read in, or to be written
    • Constructor Detail

      • CsvContext

        public CsvContext​(int lineNumber,
                          int rowNumber,
                          int columnNumber)
        Constructs a new CsvContext.
        Parameters:
        lineNumber - the current line number
        rowNumber - the current CSV row number
        columnNumber - the current CSV column number
      • CsvContext

        public CsvContext​(CsvContext c)
        Constructs a new CsvContext that is a copy of the provided CsvContext.
        Parameters:
        c - the context to be copied
    • Method Detail

      • getLineNumber

        public int getLineNumber()
        Returns:
        the lineNumber
      • setLineNumber

        public void setLineNumber​(int lineNumber)
        Parameters:
        lineNumber - the lineNumber to set
      • getRowNumber

        public int getRowNumber()
        Returns:
        the rowNumber
      • setRowNumber

        public void setRowNumber​(int rowNumber)
        Parameters:
        rowNumber - the rowNumber to set
      • getColumnNumber

        public int getColumnNumber()
        Returns:
        the columnNumber
      • setColumnNumber

        public void setColumnNumber​(int columnNumber)
        Parameters:
        columnNumber - the columnNumber to set
      • getRowSource

        public java.util.List<java.lang.Object> getRowSource()
        Returns:
        the rowSource
      • setRowSource

        public void setRowSource​(java.util.List<java.lang.Object> rowSource)
        Parameters:
        rowSource - the rowSource to set
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object