// SPDX-FileCopyrightText: 2025 Jonas Smedegaard // SPDX-License-Identifier: GPL-3.0-or-later package dk.abcdefghijklmnopqrstuvxyzæøå.bachelorizer.model; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; import java.io.IOException; import java.util.List; /// Combi - static sample dataset of course combinations /// /// Slurps and parses data from upstream-provided comma-separated file. /// /// @version 0.0.1 /// @see public final class Combi { /// Default constructor /// /// @param path path to data file private Combi(final Path path) { try { // slurp all content at once List lines = Files.readAllLines(path); for (String line : lines) { String[] values = line.split(","); for (String value : values) { System.out.print(value + "\t"); } System.out.println(); } } catch (IOException e) { e.printStackTrace(); } } /// JVM entry point /// /// @param args command-line arguments public static void main(final String[] args) { // first argument, if provided, is the data file path; // else use upstream named file in current directory. Path path = (args.length > 0) ? Paths.get(args[0]) : Paths.get("combi.txt"); new Combi(path); } }