Class VerboseCSVMeasureOutputReader

java.lang.Object
dataAnalysis.measureOutputs.VerboseCSVMeasureOutputReader
All Implemented Interfaces:
AutoCloseable

public class VerboseCSVMeasureOutputReader extends Object implements AutoCloseable
Reads a Verbose CSV measure output file, providing all the samples and weights.
Author:
Bertoli Marco 2014-09-14
  • Constructor Details

    • VerboseCSVMeasureOutputReader

      public VerboseCSVMeasureOutputReader(File measureCsvFile, String logDecimalSeparator, String logCsvDelimiter)
      Builds a new CSV measure reader
      Parameters:
      measureCsvFile - the measure csv file. Muse be a valid file
      logDecimalSeparator - the decimal separator
      logCsvDelimiter - the CSV delimiter
  • Method Details

    • openFile

      public void openFile(int initialLine) throws IOException
      Opens the measure file
      Parameters:
      initialLine - the initial line to read.
      Throws:
      IOException
    • hasMoreLines

      public boolean hasMoreLines() throws IOException
      Tells if there are more lines in this file.
      Returns:
      true if there are more lines, false otherwise
      Throws:
      IOException
    • readLine

      public boolean readLine() throws IOException, ParseException
      Reads a line from the verbose CSV
      Returns:
      true if more lines are available, false otherwise
      Throws:
      IOException - when a data access error happens
      ParseException - when data is not well formed
    • getLineNumber

      public int getLineNumber()
      Returns the line number.
      Returns:
      the last line number read
    • getParsedSample

      public double getParsedSample()
      Returns the parsed sample.
      Returns:
      the parsed sample
    • getParsedWeight

      public double getParsedWeight()
      Returns the parsed weight.
      Returns:
      the parsed weight
    • getParsedSimulationTime

      public double getParsedSimulationTime()
      Returns the parsed simulation time.
      Returns:
      the parsed simulation time
    • getParsedPercentage

      public double getParsedPercentage() throws IOException
      Returns the percentage of file parsed
      Returns:
      the percentage of file parsed
      Throws:
      IOException
    • close

      public void close() throws IOException
      Specified by:
      close in interface AutoCloseable
      Throws:
      IOException