Class CsvExporter
java.lang.Object
com.e1c.langtool.internal.stat.export.CsvExporter
- All Implemented Interfaces:
IStatisticsExporter
Implements the
IStatisticsExporter interface to export statistics to a CSV file. This class handles the conversion of
statistical data provided by a StatisticsProvider into a comma-separated values (CSV) format, suitable for
analysis and reporting. It supports exporting data for multiple languages and metrics, organizing the output into
columns for each metric and rows for each language. Errors encountered during the export process are logged for
troubleshooting.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidexport(Path path, StatisticsProvider provider, Collection<TranslateLanguage> languages, Collection<Metric> metrics) Exports provided statistics data to a CSV file.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.e1c.langtool.stat.IStatisticsExporter
sortStatisticsByPath
-
Constructor Details
-
CsvExporter
public CsvExporter()
-
-
Method Details
-
export
public void export(Path path, StatisticsProvider provider, Collection<TranslateLanguage> languages, Collection<Metric> metrics) throws IOException Exports provided statistics data to a CSV file. This method formats the statistics according to the given languages and metrics, then writes them to the specified path. Each row in the CSV represents a language, and each column represents a metric. If an error occurs during the export process, it is thrown to the caller.- Specified by:
exportin interfaceIStatisticsExporter- Parameters:
path- ThePathwhere the exported data should be saved. This path must be accessible and writable by the implementation. Must not benull.provider- TheStatisticsProviderthat supplies the statistical data to be exported. Must not benull.languages- ACollectionofTranslateLanguageobjects specifying the languages for which statistics should be exported. If empty, the implementation may decide to export statistics for all available languages. Must not benull.metrics- ACollectionofMetricobjects defining the specific statistical measurements to be included in the export. If empty, the implementation may decide to include all available metrics. Must not benull.- Throws:
IOException- if an I/O error occurs during the export process. Implementations should ensure to handle such exceptions appropriately.
-