Package com.smeup.kokos.sdk.rpgle.util
Class TsvManager
java.lang.Object
com.smeup.kokos.sdk.rpgle.util.TsvManager
- All Implemented Interfaces:
AutoCloseable
- Direct Known Subclasses:
StatisticsFunTsvManager
The
TsvManager class provides functionality for managing and writing
data in a Tab-Separated Values (TSV) format. It allows the initialization
of a new TSV with specified headers and appending new rows of data.
This class is designed for scenarios where data needs to be represented
in a TSV format for easier readability and data manipulation.
The underlying mechanism uses a PrintWriter to output data,
which is not buffered as a file but can be any Writer implementation.- Author:
- Davide Palladino
-
Constructor Summary
ConstructorsConstructorDescriptionTsvManager(Writer writer, ArrayList<String> columns, boolean isNew) Constructs a newTsvManagerinstance. -
Method Summary
-
Constructor Details
-
TsvManager
Constructs a newTsvManagerinstance.- Parameters:
writer- the writer used to output the TSV data, which can be any implementation ofWriter, not limited to file bufferscolumns- a list of column headers for the TSVisNew- a boolean indicating whether to initialize the TSV with headers
-
-
Method Details
-
append
Appends a new row to the TSV.- Parameters:
newRow- a map containing the data for the new row, with column headers as keys
-
close
Closes theTsvManager, releasing any resources associated with it.- Specified by:
closein interfaceAutoCloseable- Throws:
Exception
-