1 package at.ac.tuwien.lsdc.util;
3 import java.io.FileWriter;
4 import java.io.IOException;
7 import at.ac.tuwien.lsdc.types.ScenarioData;
8 import au.com.bytecode.opencsv.CSVWriter;
10 public class CSVScenariosLogger {
12 private final String filename;
14 public CSVScenariosLogger(String filename) {
15 this.filename = filename;
18 public void appendScenarioData( ScenarioData data ) {
19 //check if filename exists
20 //if not create file with header
21 //append line data.toString()
24 public void writeFile(List data) throws IOException {
25 CSVWriter writer = new CSVWriter(new FileWriter(filename), '\t');
26 writer.writeAll(data);
30 public void writeLine(String[] data) throws IOException {
31 CSVWriter writer = new CSVWriter(new FileWriter(filename), '\t');
32 writer.writeNext(data);