blob: 238afb69a91cf8af62b662a84f527033f3c37512 (
plain)
- // SPDX-FileCopyrightText: 2025 Jonas Smedegaard <dr@jones.dk>
- // SPDX-License-Identifier: GPL-3.0-or-later
- package dk.abcdefghijklmnopqrstuvxyzæøå.bachelorizer.model;
- import java.util.List;
- import com.example.portfolio3.GraphAlgorithms;
- /// Combi - static sample dataset of course combinations
- ///
- /// Slurps and parses data from upstream-provided comma-separated file.
- ///
- /// @version 0.0.1
- /// @see <https://moodle.ruc.dk/mod/assign/view.php?id=523186>
- public final class Combi {
- /// Default constructor
- ///
- /// @param path path to data file
- private Combi(final String path) {
- // slurp all content at once
- List<String> lines = GraphAlgorithms.loadStrings(path);
- for (String line : lines) {
- String[] values = line.split(",");
- for (String value : values) {
- System.out.print(value + "\t");
- }
- System.out.println();
- }
- }
- /// 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.
- String path = (args.length > 0)
- ? args[0]
- : "combi.txt";
- Combi combi = new Combi(path);
- }
- }
|