From cdfe6d3ddb62c2df07e3e4c60256ad36d0412946 Mon Sep 17 00:00:00 2001 From: fdai7921 Date: Wed, 7 Feb 2024 15:38:04 +0100 Subject: [PATCH] Finalizing documentation in Administration class --- src/main/java/org/example/Administration.java | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/main/java/org/example/Administration.java b/src/main/java/org/example/Administration.java index 2be4f6a..f760a50 100644 --- a/src/main/java/org/example/Administration.java +++ b/src/main/java/org/example/Administration.java @@ -26,10 +26,21 @@ public class Administration { } + /** + * Adds a course to the list of courses. + * + * @param course The course to be added. + */ public void addCourse(Course course){ courses.add(course); } + /** + * Deletes a course from the list of courses based on its course ID. + * + * @param courseID The course ID of the course to be deleted. + * @return true if the course is successfully deleted, false otherwise. + */ public boolean deleteCourse(String courseID){ for(Course course : courses){ if(course.getCourseCode().equals(courseID)){ @@ -40,6 +51,12 @@ public class Administration { return false; } + /** + * Finds a course in the list of courses based on its course ID. + * + * @param courseID The course ID of the course to be found. + * @return The course with the specified course ID, or null if not found. + */ public Course findCourseByID(String courseID){ for(Course course : courses){ if(course.getCourseCode().equals(courseID)){