diff --git a/src/main/java/com/unitime/feature/InputHandler.java b/src/main/java/com/unitime/feature/InputHandler.java index 83bf541..842bc42 100644 --- a/src/main/java/com/unitime/feature/InputHandler.java +++ b/src/main/java/com/unitime/feature/InputHandler.java @@ -6,16 +6,16 @@ public class InputHandler { - private static List mandatoryList = new ArrayList<>(); - private static List optionalList = new ArrayList<>(); - private static int maxCredit = 0; - public static void main(String[] args) { + private List mandatoryList = new ArrayList<>(); + private List 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 { @@ -68,7 +68,7 @@ public static void main(String[] args) { } // Get user input - private static void inputLoop(Scanner sc, List targetList) { + private void inputLoop(Scanner sc, List targetList) { System.out.println("------------------------------------------------------------------"); System.out.println("Format: Name / Credit / Time"); System.out.println("Example: Data Structure / 3 / Mon 12:30 14:00"); @@ -143,7 +143,7 @@ private static void inputLoop(Scanner sc, List 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) { @@ -162,16 +162,16 @@ private static int parseMin(String t) throws Exception { } } - //Getters - public static List getMandatoryList() { - return mandatoryList; + // Getters + public List getMandatoryList() { + return mandatoryList; } - public static List getOptionalList() { + public List getOptionalList() { return optionalList; } - public static int getMaxCredit() { + public int getMaxCredit() { return maxCredit; } } \ No newline at end of file