Package edu.wpi.grip.core.metrics
Class CsvExporter
- java.lang.Object
-
- edu.wpi.grip.core.metrics.CsvExporter
-
public class CsvExporter extends java.lang.Object
Class for exporting data to CSV.
-
-
Constructor Summary
Constructors Constructor Description CsvExporter(int numCols, java.lang.String... headers)
Creates a new CSV exporter with the given number of data columns and column header.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addRow(java.lang.Object... data)
Appends a data row to the bottom of the table.void
addRow(java.util.List<?> data)
Appends a data row to the bottom of the table.void
clear()
Clears the stored data in the exporter.java.lang.String
export()
Exports a CSV table.
-
-
-
Method Detail
-
addRow
public void addRow(java.util.List<?> data)
Appends a data row to the bottom of the table.- Parameters:
data
- the row to append- Throws:
java.lang.NullPointerException
- ifdata
is null, or if it contains null elementsjava.lang.IllegalArgumentException
- if the number of elements indata
is not exactly equal to the number of columns specified in the constructor- See Also:
addRow(Object...)
-
addRow
public void addRow(java.lang.Object... data)
Appends a data row to the bottom of the table.- Parameters:
data
- the row to append- Throws:
java.lang.NullPointerException
- ifdata
is null, or if it contains null elementsjava.lang.IllegalArgumentException
- if the number of elements indata
is not exactly equal to the number of columns specified in the constructor
-
clear
public void clear()
Clears the stored data in the exporter. The headers are unaffected.
-
export
public java.lang.String export()
Exports a CSV table.- Returns:
- the CSV representation of the data given to this exporter
-
-