Class CSVEmitter.CSVReader

  • All Implemented Interfaces:
    Callable<Boolean>
    Enclosing class:
    CSVEmitter

    private static class CSVEmitter.CSVReader
    extends Object
    implements Callable<Boolean>
    This task reads the contents of a csv file and emits each row of the csv file as a Map instance.
    • Field Detail

      • mSource

        private final URL mSource
      • mReverse

        private final boolean mReverse
    • Constructor Detail

      • CSVReader

        private CSVReader​(URL inSource,
                          DataEmitterSupport inSupport,
                          boolean inReverse)
        Creates an instance.
        Parameters:
        inSource - The URL from which the csv file can be read.
        inSupport - the handle to emit data.
        inReverse - if the emitter should reverse the rows, emitting the last row first.
    • Method Detail

      • createMap

        private Map<String,​String> createMap​(String[] inKeys,
                                                   String[] inValues)
        Creates a map instance with the supplied key value arrays.
        Parameters:
        inKeys - The keys to be used in the map.
        inValues - The values to be used in the map.
        Returns:
        A map instance containing key value pairs extracted from the supplied array. The map's size is the same size as the length of the supplied inKeys array.