aboutsummaryrefslogtreecommitdiff
path: root/dk/abcdefghijklmnopqrstuvxyzæøå/bachelorizer/model/Combi.java
blob: cf2fe915afa6e54d81b1fe18c661f69efeab6920 (plain)
  1. // SPDX-FileCopyrightText: 2025 Jonas Smedegaard <dr@jones.dk>
  2. // SPDX-License-Identifier: GPL-3.0-or-later
  3. package dk.abcdefghijklmnopqrstuvxyzæøå.bachelorizer.model;
  4. import com.example.portfolio3.AdjListGraph;
  5. import com.example.portfolio3.Graph;
  6. import com.example.portfolio3.GraphAlgorithms;
  7. /// Combi - static sample dataset of course combinations
  8. ///
  9. /// Slurps and parses data from upstream-provided comma-separated file.
  10. ///
  11. /// @version 0.0.1
  12. /// @see <https://moodle.ruc.dk/mod/assign/view.php?id=523186>
  13. public final class Combi {
  14. /// data about combinations as a Graph
  15. private Graph g;
  16. /// Default constructor
  17. ///
  18. /// @param path path to data file
  19. private Combi(final String path) {
  20. g = new AdjListGraph();
  21. GraphAlgorithms.readGraph(g, path);
  22. GraphAlgorithms.printGraph(g);
  23. }
  24. /// JVM entry point
  25. ///
  26. /// @param args command-line arguments
  27. public static void main(final String[] args) {
  28. // first argument, if provided, is the data file path;
  29. // else use upstream named file in current directory.
  30. String path = (args.length > 0)
  31. ? args[0]
  32. : "combi.txt";
  33. Combi combi = new Combi(path);
  34. }
  35. }