Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 13 additions & 13 deletions src/main/java/com/unitime/feature/InputHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,16 @@

public class InputHandler {

private static List<Course> mandatoryList = new ArrayList<>();
private static List<Course> optionalList = new ArrayList<>();
private static int maxCredit = 0;
public static void main(String[] args) {
private List<Course> mandatoryList = new ArrayList<>();
private List<Course> optionalList = new ArrayList<>();
private int maxCredit = 0;

public InputHandler() {
Scanner sc = new Scanner(System.in);


System.out.println("===== UniTime-Solver: Input Courses =====");

// 목표 학점
// Maximum credit
System.out.print("What is your MAXIMUM total credit? (positive number): ");
while (true) {
try {
Expand Down Expand Up @@ -68,7 +68,7 @@ public static void main(String[] args) {
}

// Get user input
private static void inputLoop(Scanner sc, List<Course> targetList) {
private void inputLoop(Scanner sc, List<Course> targetList) {
System.out.println("------------------------------------------------------------------");
System.out.println("Format: Name / Credit / Time");
System.out.println("Example: Data Structure / 3 / Mon 12:30 14:00");
Expand Down Expand Up @@ -143,7 +143,7 @@ private static void inputLoop(Scanner sc, List<Course> targetList) {
}

// Change time into minutes
private static int parseMin(String t) throws Exception {
private int parseMin(String t) throws Exception {
try {
String[] hhmm = t.split(":");
if (hhmm.length != 2) {
Expand All @@ -162,16 +162,16 @@ private static int parseMin(String t) throws Exception {
}
}

//Getters
public static List<Course> getMandatoryList() {
return mandatoryList;
// Getters
public List<Course> getMandatoryList() {
return mandatoryList;
}

public static List<Course> getOptionalList() {
public List<Course> getOptionalList() {
return optionalList;
}

public static int getMaxCredit() {
public int getMaxCredit() {
return maxCredit;
}
}