Class MapAsciiReader


public class MapAsciiReader extends AbstractAsciiReader
Reads a fixed-width ASCII file into a map: key rowHead_columnName, value the string of the column. The row head is the value of the head column, or the line number.
  • Constructor Details

    • MapAsciiReader

      public MapAsciiReader(File aSourceFile, org.jdom2.Element aConfigData, String aTabLen, String aSeperator, String aDefaultDateFormat, FWObservable aObservable)
      Parameters:
      aSourceFile - the ASCII file
      aConfigData - the configuration element with one child per column
      aTabLen - tab length as string, or null to keep tabs
      aSeperator - column separator
      aDefaultDateFormat - default date format
      aObservable - provides the parameters for the configuration values
  • Method Details

    • readMap

      public Map<String,Object> readMap() throws Exception
      Reads the file.
      Returns:
      the values by rowHead_columnName
      Throws:
      Exception - if the file cannot be read
    • processLineOfFile

      protected void processLineOfFile(String aOrientation, String aLine, int aRowIdx) throws Exception
      Puts the values of one line into the result map.
      Specified by:
      processLineOfFile in class AbstractAsciiReader
      Parameters:
      aOrientation - not used
      aLine - the line
      aRowIdx - line number (1-based)
      Throws:
      Exception - if the line cannot be processed