Class HeadedCsvParser


public class HeadedCsvParser extends SimpleCsvParser
Parses lines of a CSV file. Addresses columns by their column headline. It is assumed that the first line in file is the head-line. For any values to be parsed the AbstractLineParser.setValueNames(java.util.Set) has to be called with the names of the columns which should be parsed (the time is stored in an extra field, so you do not have to give it as value name. The time column has to be the first one in the csv file).
  • Constructor Details

    • HeadedCsvParser

      public HeadedCsvParser()
  • Method Details

    • parse

      public ValueSet parse(String line)
      Parse the resource line.
      Overrides:
      parse in class SimpleCsvParser
      Parameters:
      line - line to parse
      Returns:
      parsed ValueSet or null if there is currently nothing to return. This might be in case the line has no value of interest.
    • getName

      protected String getName(int i)
      Returns the name of the i-th column.
      Overrides:
      getName in class SimpleCsvParser
      Parameters:
      i - the column index
      Returns:
      the column's name