diff --git a/src/main/java/seedu/duke/controllers/MainController.java b/src/main/java/seedu/duke/controllers/MainController.java index 26c9488a58..2b5b565b96 100644 --- a/src/main/java/seedu/duke/controllers/MainController.java +++ b/src/main/java/seedu/duke/controllers/MainController.java @@ -65,13 +65,12 @@ public void start() throws IOException { saveStudentData(storage,student); displayGoodbye(); } - + //@@author SebasFok /** * Initializes the user by attempting to load data from save files. If successful, sets the user details, * schedule, and timetable. If loading fails or save files are missing, creates new save files, prompts for * user details, and resets the schedule and timetable. * - * @author SebasFok * @throws IOException If an IO error occurs during file operations. */ public void initialiseUser() throws IOException { @@ -175,10 +174,10 @@ public void resetStorageData() throws IOException { saveTimetable(student); } + //@@author SebasFok /** * Sets the student details based on the provided list of information, such as name, major, and year. * - * @author SebasFok * @param studentDetails The list of student information containing name, major, and year in this order. * @throws CorruptedFileException If the provided student information is null, has an incorrect number of elements, * or if any of the information is invalid. diff --git a/src/main/java/seedu/duke/controllers/ModuleMethodsController.java b/src/main/java/seedu/duke/controllers/ModuleMethodsController.java index d0873df62c..489a1bfef4 100644 --- a/src/main/java/seedu/duke/controllers/ModuleMethodsController.java +++ b/src/main/java/seedu/duke/controllers/ModuleMethodsController.java @@ -100,7 +100,7 @@ public static void showModulesLeft(ArrayList moduleCodesLeft) { printModuleStringArray(moduleCodesLeft); } - + //@@author SebasFok /** * Executes the command to add a module to the target semester of the student's schedule and saves the updated * schedule. This method adds the specified module to the target semester of the student's schedule and prints @@ -108,7 +108,6 @@ public static void showModulesLeft(ArrayList moduleCodesLeft) { * Exceptions related to module deletion, missing modules, mandatory prerequisites, and * storage I/O errors are caught and appropriate error messages are displayed. * - * @author SebasFok * @param module The module code of the module to be added. * @param targetSem The target semester for adding the module. * @param student The student object to which the module will be added. @@ -189,6 +188,7 @@ public static void executeDeleteModuleCommand(String module, Student student) { } } + //@@author SebasFok /** * Executes the command to shift a module within a student's schedule to a different semester. * This method shifts the specified module to the target semester of the student's schedule and prints @@ -196,7 +196,6 @@ public static void executeDeleteModuleCommand(String module, Student student) { * Exceptions related to module deletion, missing modules, mandatory prerequisites, and * storage I/O errors are caught and appropriate error messages are displayed. * - * @author SebasFok * @param module The module code of the module to be shifted. * @param targetSem The target semester for shifting the module. * @param student The student object whose schedule will be updated. @@ -224,6 +223,7 @@ public static void executeShiftModuleCommand(String module, int targetSem, Stude } } + //@@author SebasFok /** * Executes the command to clear the student's schedule. This method clears the entire schedule of the student as * well as the completion status of all modules. Additionally, it attempts to save the updated schedule to storage. @@ -231,7 +231,6 @@ public static void executeShiftModuleCommand(String module, int targetSem, Stude * Exceptions related to module deletion, missing modules, mandatory prerequisites, and * storage I/O errors are caught and appropriate error messages are displayed. * - * @author SebasFok * @param student The student object whose schedule will be cleared. */ public static void executeClearScheduleCommand(Student student){ diff --git a/src/main/java/seedu/duke/controllers/ModuleServiceController.java b/src/main/java/seedu/duke/controllers/ModuleServiceController.java index c66cad6f7b..12000a2413 100644 --- a/src/main/java/seedu/duke/controllers/ModuleServiceController.java +++ b/src/main/java/seedu/duke/controllers/ModuleServiceController.java @@ -106,11 +106,11 @@ public static void getRequiredModules(String major) throws NullPointerException printRequiredModules(major); } + //@@author SebasFok /** * Asks the user for confirmation to clear their schedule and returns the user's choice. * Displays a message warning that clearing your schedule cannot be undone. * - * @author SebasFok * @return true if the user confirms by entering 'Y', false if 'N'. */ public static boolean isConfirmedToClearSchedule() { diff --git a/src/main/java/seedu/duke/models/logic/Prerequisite.java b/src/main/java/seedu/duke/models/logic/Prerequisite.java index 25494d587b..3eb722cd62 100644 --- a/src/main/java/seedu/duke/models/logic/Prerequisite.java +++ b/src/main/java/seedu/duke/models/logic/Prerequisite.java @@ -15,10 +15,11 @@ import static seedu.duke.models.schema.Storage.getRequirements; public class Prerequisite { + + //@@author SebasFok /** * Recursively checks if each branch of the prereq tree is satisfied by the student. * - * @author SebasFok * @param modulePrereqArray The array of prerequisite modules or conditions to be checked. * @param currRequisite The type of prerequisite condition ("or" or "and"). * @param completedModules The list of completed modules by the student. @@ -42,11 +43,11 @@ private static boolean isPrereqSatisfied( } + //@@author SebasFok /** * Checks if the AND branch of a module's prerequisites is satisfied based on completed modules. * Recursively checks the branch if there are nested prerequisite structures in the AND branch * - * @author SebasFok * @param modulePrereqArray The array representing the AND branch of prerequisites. * @param completedModules The list of modules that have been completed. * @return true if the AND branch is satisfied, false otherwise. @@ -91,11 +92,11 @@ private static boolean isAndBranchSatisfied(ArrayList modulePrereqArray return true; } + //@@author SebasFok /** * Checks if the OR branch of a module's prerequisites is satisfied based on completed modules. * Recursively checks the branch if there are nested prerequisite structures in the OR branch * - * @author SebasFok * @param modulePrereqArray The array representing the OR branch of prerequisites. * @param completedModules The list of modules that have been completed. * @return true if the OR branch is satisfied, false otherwise. @@ -331,10 +332,10 @@ static ArrayList getExemptedPrerequisite(String moduleCode) { return map.get(moduleCode); } + //@@author SebasFok /** * Checks if a student satisfies all prerequisites for a given module. * - * @author SebasFok * @param moduleCode The code of the module for which prerequisites need to be checked. * @param completedModules The list of completed modules by the student. * @return `true` if the student satisfies all prerequisites for the module, `false` otherwise. diff --git a/src/main/java/seedu/duke/models/schema/Major.java b/src/main/java/seedu/duke/models/schema/Major.java index 603eda10a6..ab00f884e1 100644 --- a/src/main/java/seedu/duke/models/schema/Major.java +++ b/src/main/java/seedu/duke/models/schema/Major.java @@ -1,9 +1,9 @@ package seedu.duke.models.schema; +//@@author SebasFok /** * The `Major` enum represents different majors that can be selected by our application. * - * @author SebasFok */ public enum Major { CEG, CS diff --git a/src/main/java/seedu/duke/models/schema/Schedule.java b/src/main/java/seedu/duke/models/schema/Schedule.java index 1e6ffe5f9d..9ac5cd0102 100644 --- a/src/main/java/seedu/duke/models/schema/Schedule.java +++ b/src/main/java/seedu/duke/models/schema/Schedule.java @@ -147,10 +147,10 @@ public void addReccToSchedule(ArrayList scheduleToAdd) { } } + //@@author SebasFok /** * Adds a module to the schedule for a specified semester. * - * @author SebasFok * @param moduleCode The module code to be added. * @param targetSem The target semester (an integer from 1 to 8) in which to add the module. * @throws IllegalArgumentException If the provided semester is out of the valid range (1 to 8), @@ -253,10 +253,10 @@ public void deleteModule(String module) throws MandatoryPrereqException, Missing } + //@@author SebasFok /** * Shifts a module within the student's planned schedule to a different semester. * - * @author SebasFok * @param module The module code to be shifted. * @param targetSem The target semester to which the module will be shifted. * @throws IllegalArgumentException If the target semester is not within the valid range (1 to 8). @@ -310,10 +310,10 @@ public void shiftModule(String module, int targetSem) throws IllegalArgumentExce shiftModuleLater(module, targetSem, indexToAdd, originalSem); } + //@@author SebasFok /** * Shifts a module later within the student's planned schedule to a different semester. * - * @author SebasFok * @param module The module code to be shifted later. * @param targetSem The target semester to which the module will be shifted. * @param indexToAdd The index at which the module will be added in the schedule. @@ -364,10 +364,10 @@ private void shiftModuleLater(String module, int targetSem, int indexToAdd, int modulesPerSem[targetSem - 1] += 1; } + //@@author SebasFok /** * Shifts a module earlier within the student's planned schedule to a different semester. * - * @author SebasFok * @param module The module code to be shifted earlier. * @param targetSem The target semester to which the module will be shifted. * @param indexToAdd The index at which the module will be added in the schedule. diff --git a/src/main/java/seedu/duke/models/schema/Storage.java b/src/main/java/seedu/duke/models/schema/Storage.java index d67c30018d..aab55584d6 100644 --- a/src/main/java/seedu/duke/models/schema/Storage.java +++ b/src/main/java/seedu/duke/models/schema/Storage.java @@ -77,10 +77,10 @@ private static String[] determineRequirements(String major) { return courseArray; } + //@@author SebasFok /** * Creates a "schedule.txt" file in the data directory. * - * @author SebasFok */ public void createUserStorageFile() { String dataDirectory = userDirectory + "/data"; @@ -167,10 +167,10 @@ public Schedule loadSchedule() throws MissingFileException, CorruptedFileExcepti } + //@@author SebasFok /** * Loads the student's details (name, major, and year) from the "studentDetails.txt" file. * - * @author SebasFok * @return An ArrayList containing the loaded student details in the order [Name, Major, Year]. * @throws MissingFileException If the "studentDetails.txt" file is missing. * @throws CorruptedFileException If the file is corrupted or has unexpected content. @@ -355,10 +355,10 @@ public void saveStudentDetails (Student student) throws IOException { } } + //@@author SebasFok /** * Saves the student's details (name, major, and year) to the "studentDetails.txt" file. * - * @author SebasFok * @param student The Student object containing the details to be saved. * @throws IOException If an I/O error occurs while writing to the file. */ @@ -420,10 +420,10 @@ public static void saveTimetable(Student student) throws IOException { // Below this comment are standard file methods + //@@author SebasFok /** * Takes in the location of the file in question and returns whether the file exist * - * @author SebasFok * @param filePath * @return return true if the file exist,return false otherwise */ @@ -432,11 +432,11 @@ public static boolean isFileExist(String filePath) { return Files.exists(path); } + //@@author SebasFok /** * This method takes in a path and creates a directory at that location. Should the * directory already exist, no new directory will be created. * - * @author SebasFok * @param folderPath the location of where the directory should be created */ public static void createDirectory(String folderPath) { @@ -449,11 +449,11 @@ public static void createDirectory(String folderPath) { } } + //@@author SebasFok /** * This method takes in the path of a directory and creates a file 'fileName' in * the directory. Should the file already exist, no new file will be created. * - * @author SebasFok * @param directoryPath the location of the directory where the file should be created * @param fileName the name of the file to be created */ @@ -476,11 +476,11 @@ public static void createFileInDirectory(String directoryPath, String fileName) } } + //@@author SebasFok /** * This method takes in the path of a txt file and adds 'textToAdd' to the last line * of the file * - * @author SebasFok * @param filePath location of the file to be edited * @param textToAdd String to be added to the end of the txt file */ diff --git a/src/main/java/seedu/duke/models/schema/Student.java b/src/main/java/seedu/duke/models/schema/Student.java index 92afea2c87..87ed97d1b9 100644 --- a/src/main/java/seedu/duke/models/schema/Student.java +++ b/src/main/java/seedu/duke/models/schema/Student.java @@ -145,10 +145,10 @@ public void setFirstMajor(String userInput) { } } + //@@author SebasFok /** * Adds a module to the student's schedule for a specified semester. * - * @author SebasFok * @param moduleCode The code of the module to be added. * @param targetSem The semester in which the module will be added. * @throws IllegalArgumentException If the target semester is not valid. @@ -214,10 +214,10 @@ public void deleteModuleFromSchedule(String moduleCode) throws } } + //@@author SebasFok /** * Shifts a module within the student's schedule to a different semester. * - * @author SebasFok * @param moduleCode The code of the module to be shifted. * @param targetSem The target semester to which the module will be shifted. * @throws IllegalArgumentException If the target semester is not valid. @@ -231,11 +231,11 @@ public void shiftModuleInSchedule(String moduleCode, int targetSem) throws Illeg this.schedule.shiftModule(moduleCode, targetSem); } + //@@author SebasFok /** * Clears all modules from the student's schedule, resetting it to an empty schedule. * Also resets the completed module credits to zero. * - * @author SebasFok */ public void clearAllModulesFromSchedule() { //Replaces current schedule with new schedule diff --git a/src/main/java/seedu/duke/utils/exceptions/CorruptedFileException.java b/src/main/java/seedu/duke/utils/exceptions/CorruptedFileException.java index 268a8f4a13..a017ba1db9 100644 --- a/src/main/java/seedu/duke/utils/exceptions/CorruptedFileException.java +++ b/src/main/java/seedu/duke/utils/exceptions/CorruptedFileException.java @@ -1,11 +1,11 @@ package seedu.duke.utils.exceptions; +//@@author SebasFok /** * Custom exception to indicate that a file is corrupted or has unexpected content. * This exception should be thrown when an attempt to read or process a file reveals * that the file's structure or content is not as expected. * - * @author SebasFok */ public class CorruptedFileException extends Exception{ } diff --git a/src/main/java/seedu/duke/utils/exceptions/FailPrereqException.java b/src/main/java/seedu/duke/utils/exceptions/FailPrereqException.java index 086cd6663b..156494647c 100644 --- a/src/main/java/seedu/duke/utils/exceptions/FailPrereqException.java +++ b/src/main/java/seedu/duke/utils/exceptions/FailPrereqException.java @@ -1,11 +1,11 @@ package seedu.duke.utils.exceptions; +//@@author SebasFok /** * Custom exception to indicate that a prerequisite for a certain module is not satisfied. * This exception should be thrown when a required prerequisite for a module is not met, * preventing the successful completion of an operation. * - * @author SebasFok */ public class FailPrereqException extends Exception{ public FailPrereqException(String message) { diff --git a/src/main/java/seedu/duke/utils/exceptions/MandatoryPrereqException.java b/src/main/java/seedu/duke/utils/exceptions/MandatoryPrereqException.java index ec92884167..ec8e57ccd0 100644 --- a/src/main/java/seedu/duke/utils/exceptions/MandatoryPrereqException.java +++ b/src/main/java/seedu/duke/utils/exceptions/MandatoryPrereqException.java @@ -1,11 +1,11 @@ package seedu.duke.utils.exceptions; +//@@author SebasFok /** * Custom exception to indicate that a module, X, is a mandatory prerequisite for another module, Y. * This exception should be thrown when attempting an action that causes the module X to move to the same * semester or after module Y. * - * @author SebasFok */ public class MandatoryPrereqException extends Exception{ public MandatoryPrereqException(String message) { diff --git a/src/main/java/seedu/duke/utils/exceptions/MissingFileException.java b/src/main/java/seedu/duke/utils/exceptions/MissingFileException.java index 49e3a842c7..091808e30a 100644 --- a/src/main/java/seedu/duke/utils/exceptions/MissingFileException.java +++ b/src/main/java/seedu/duke/utils/exceptions/MissingFileException.java @@ -1,11 +1,11 @@ package seedu.duke.utils.exceptions; +//@@author SebasFok /** * Custom exception to indicate that a required file is missing. * This exception should be thrown when an operation expects a certain file to be present, * but the file cannot be found or is missing. * - * @author SebasFok */ public class MissingFileException extends Exception{