Package betsy.common.analytics

Source Code of betsy.common.analytics.Analyzer

package betsy.common.analytics;

import betsy.common.analytics.html.HtmlAnalytics;
import betsy.common.analytics.model.CsvReport;
import betsy.common.tasks.FileTasks;

import java.nio.file.Path;

public class Analyzer {
    private final Path csvFilePath;
    private final Path reportsFolderPath;

    public Analyzer(Path csvFilePath, Path reportsFolderPath) {
        this.csvFilePath = csvFilePath;
        this.reportsFolderPath = reportsFolderPath;

        FileTasks.assertFile(csvFilePath);
        FileTasks.assertDirectory(reportsFolderPath);
    }

    public void createAnalytics(CsvReport csvReport) {
        // load model
        CsvReportLoader loader = new CsvReportLoader(csvFilePath, csvReport);
        CsvReport csvModel = loader.load();

        // analytics
        new HtmlAnalytics(csvModel).toHtmlReport(reportsFolderPath.resolve("results.html"));
    }

}
TOP

Related Classes of betsy.common.analytics.Analyzer

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.