diff options
| author | sowgro <tpoke.ferrari@gmail.com> | 2025-10-09 08:06:56 -0400 |
|---|---|---|
| committer | sowgro <tpoke.ferrari@gmail.com> | 2025-10-09 08:06:56 -0400 |
| commit | ddcfcf82baf737e183ec7b00edeee26894516c58 (patch) | |
| tree | bb2199639272496e79e79e221513b5346f553084 /src/main/java/design/model/course_search/CourseList.java | |
| parent | 7623a5c02f6da679016bf8f8671d4fb29c5fdfbb (diff) | |
| download | designproject-design-6-ddcfcf82baf737e183ec7b00edeee26894516c58.tar.gz designproject-design-6-ddcfcf82baf737e183ec7b00edeee26894516c58.tar.bz2 designproject-design-6-ddcfcf82baf737e183ec7b00edeee26894516c58.zip | |
fix formatting
Diffstat (limited to 'src/main/java/design/model/course_search/CourseList.java')
| -rw-r--r-- | src/main/java/design/model/course_search/CourseList.java | 66 |
1 files changed, 35 insertions, 31 deletions
diff --git a/src/main/java/design/model/course_search/CourseList.java b/src/main/java/design/model/course_search/CourseList.java index 360dc9b..c2411f7 100644 --- a/src/main/java/design/model/course_search/CourseList.java +++ b/src/main/java/design/model/course_search/CourseList.java @@ -1,10 +1,10 @@ package design.model.course_search; +import design.model.Hole; + import java.util.ArrayList; import java.util.List; -import design.model.*; - /* * Defines a list of courses that can be sorted, added to or removed from. * Willem Dalton @@ -13,83 +13,87 @@ public class CourseList implements ICourse { private CourseSorter sorter; private List<ICourse> courses; - public CourseList() - { + public CourseList() { courses = new ArrayList<>(); } /* * Grab the list of courses */ - public List<ICourse> getCourses() - { + public List<ICourse> getCourses() { return courses; } /* * Set the list of courses equal to an existing list */ - public void setCourses(List<ICourse> courses) - { + public void setCourses(List<ICourse> courses) { this.courses = courses; } /* - * set the chosen sorting algorithm for the given list. - */ - public void setSorter(CourseSorter courseSorter) - { + * set the chosen sorting algorithm for the given list. + */ + public void setSorter(CourseSorter courseSorter) { sorter = courseSorter; } /* * Add a new course to the list. */ - public void add(ICourse course) - { + public void add(ICourse course) { courses.add(course); } /* - * Remove a course from the list. + * Remove a course from the list. */ - public void remove(ICourse course) - { + public void remove(ICourse course) { courses.remove(course); } /* * Sort the list. */ - public void sort() - { + public void sort() { sorter.sortCourses(courses); } - + /* * All overrides of the ICourse class. This is a drawback of the composite pattern, but it's pretty negligible here. return some dummy values. */ @Override - public String getName() { return "Course List"; } - + public String getName() { + return "Course List"; + } + @Override - public float getDifficultyRating() { return 0; } + public float getDifficultyRating() { + return 0; + } @Override - public String getLocation() { return ""; } - + public String getLocation() { + return ""; + } + @Override - public int getTotalPar() { return 0; } + public int getTotalPar() { + return 0; + } @Override - public int getHoleCount() { return 0; } + public int getHoleCount() { + return 0; + } @Override - public List<Hole> getHoles() { return null; } + public List<Hole> getHoles() { + return null; + } - @Override - public String toString() - { + @Override + public String toString() { return "Course List"; } } |
