Class BufferedCsvWriter

java.lang.Object
java.io.Writer
java.io.BufferedWriter
edu.ie3.datamodel.io.csv.BufferedCsvWriter
All Implemented Interfaces:
Closeable, Flushable, Appendable, AutoCloseable

public class BufferedCsvWriter extends BufferedWriter
This class extends the BufferedWriter and adds information about the file shape of the csv file
  • Constructor Details

    • BufferedCsvWriter

      public BufferedCsvWriter(String filePath, String[] headLineElements, String csvSep, boolean append) throws IOException
      Build a new CsvBufferedWriter. The order of headline elements given in this constructor defines the order of columns in file
      Parameters:
      filePath - String representation of the full path to the target file
      headLineElements - Elements of the csv headline
      csvSep - csv separator char
      append - true to append to an existing file, false to overwrite an existing file (if any), if no file exists, a new one will be created in both cases
      Throws:
      IOException - If the FileOutputStream cannot be established.
    • BufferedCsvWriter

      public BufferedCsvWriter(String baseFolder, CsvFileDefinition fileDefinition, boolean append) throws IOException
      Build a new CsvBufferedWriter. This is a "convenience" Constructor. The absolute file path is assembled by concatenation of baseFolder and fileDefinition's file path information. The order of headline elements in fileDefinition defines the order of columns in file
      Parameters:
      baseFolder - Base folder, from where the file hierarchy should start
      fileDefinition - The foreseen shape of the file
      append - true to append to an existing file, false to overwrite an existing file (if any), if no file exists, a new one will be created in both cases
      Throws:
      IOException - If the FileOutputStream cannot be established.
  • Method Details