Package app.entity.camp
Class CampList
- All Implemented Interfaces:
IFilterableByAttendee<Camp>,IFilterableByCampCommittee<Camp>,IFilterableByDateRange<Camp>,IFilterableByID<Camp>,IFilterableBySchool<Camp>,IFilterableByStudent<Camp>,IFilterableByVisibility<Camp>,ISerializable,ISortableByEndDate<Camp>,ISortableByID<Camp>,ISortableByLocation<Camp>,ISortableByName<Camp>,ISortableByRegistrationCloseDate<Camp>,ISortableByStartingDate<Camp>,Iterable<Camp>
- Direct Known Subclasses:
CampDetails
public class CampList
extends RepositoryList<Camp>
implements IFilterableByID<Camp>, IFilterableByDateRange<Camp>, IFilterableBySchool<Camp>, IFilterableByVisibility<Camp>, ISortableByEndDate<Camp>, ISortableByID<Camp>, ISortableByLocation<Camp>, ISortableByName<Camp>, ISortableByRegistrationCloseDate<Camp>, ISortableByStartingDate<Camp>, IFilterableByAttendee<Camp>, IFilterableByCampCommittee<Camp>, IFilterableByStudent<Camp>
Represents a list of camps, providing functionality for filtering and sorting
camps based on various criteria.
This class extends RepositoryList and implements several interfaces for
filtering and sorting.
-
Field Summary
Fields inherited from class app.entity.RepositoryList
all -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfilterByAttendee(Student attendee) Filters items based on the specified attendee (e.g., student).filterByCampCommittee(Student student) Filters items based on the specified camp committee member (e.g., student).filterByDateRange(Date startDate, Date endDate) Filters the list of camps within a specific date range.filterByID(String id) Filters the list of camps by the specified ID.filterByRegistrationDate(Date currentDate) Filters the list of camps by registration date.filterBySchool(String school) Filters the list of camps by the specified school.filterByStaff(Staff staff) Filters the list of camps by a specific staff member in charge.filterByStudent(Student student) Filters the list of camps by a specific student attendee.filterByVisibility(boolean visible) Filters the list of camps by their visibility status.getAll()Returns all camps in the list.Serializes the object into a list of lists of strings.Sorts the list of camps by their end dates.sortByID()Sorts the list of camps by their IDs.Sorts the list of camps by their locations.Sorts the list of camps by their names.Sorts the list of camps by their registration close dates.Sorts the list of camps by their starting dates.Camp[]toArray()Converts the CampList to an array of Camp objects.Methods inherited from class app.entity.RepositoryList
add, clear, get, iterator, remove, size, update, updateMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
CampList
Constructs a new CampList with the specified list of camps.- Parameters:
all- A list of Camp objects to be managed.
-
CampList
public CampList()Constructs an empty CampList.
-
-
Method Details
-
filterByID
Filters the list of camps by the specified ID.- Specified by:
filterByIDin interfaceIFilterableByID<Camp>- Parameters:
id- The ID to filter by.- Returns:
- A new CampList containing camps that match the given ID.
-
filterBySchool
Filters the list of camps by the specified school.- Specified by:
filterBySchoolin interfaceIFilterableBySchool<Camp>- Parameters:
school- The school to filter by.- Returns:
- A new CampList containing camps associated with the given school.
-
filterByVisibility
Filters the list of camps by their visibility status.- Specified by:
filterByVisibilityin interfaceIFilterableByVisibility<Camp>- Parameters:
visible- The visibility status to filter by.- Returns:
- A new CampList containing camps with the specified visibility status.
-
filterByDateRange
Filters the list of camps within a specific date range.- Specified by:
filterByDateRangein interfaceIFilterableByDateRange<Camp>- Parameters:
startDate- The start date of the range.endDate- The end date of the range.- Returns:
- A new CampList containing camps within the specified date range.
-
filterByRegistrationDate
Filters the list of camps by registration date.- Parameters:
currentDate- The date to compare registration dates against.- Returns:
- A new CampList containing camps whose registration date is on or after the specified date.
-
filterByStudent
Filters the list of camps by a specific student attendee.- Specified by:
filterByStudentin interfaceIFilterableByStudent<Camp>- Parameters:
student- The student to filter by.- Returns:
- A new CampList containing camps that the given student is attending.
-
filterByStaff
Filters the list of camps by a specific staff member in charge.- Parameters:
staff- The staff member to filter by.ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffsssssssssssssssssssssssssssssssssssssssssssss- Returns:
- A new CampList containing camps managed by the given staff member.
-
filterByCampCommittee
Description copied from interface:IFilterableByCampCommitteeFilters items based on the specified camp committee member (e.g., student).- Specified by:
filterByCampCommitteein interfaceIFilterableByCampCommittee<Camp>- Parameters:
student- The student representing a camp committee member whose membership is used as a filter criterion.- Returns:
- A
RepositoryListcontaining items filtered by the specified camp committee member.
-
filterByAttendee
Description copied from interface:IFilterableByAttendeeFilters items based on the specified attendee (e.g., student).- Specified by:
filterByAttendeein interfaceIFilterableByAttendee<Camp>- Parameters:
attendee- The student whose attendance is used as a filter criterion.- Returns:
- A
RepositoryListcontaining items filtered by the specified attendee.
-
sortByName
Sorts the list of camps by their names.- Specified by:
sortByNamein interfaceISortableByName<Camp>- Returns:
- A new CampList sorted by camp names.
-
sortByRegistrationCloseDate
Sorts the list of camps by their registration close dates.- Specified by:
sortByRegistrationCloseDatein interfaceISortableByRegistrationCloseDate<Camp>- Returns:
- A new CampList sorted by camp registration close dates.
-
sortByStartingDate
Sorts the list of camps by their starting dates.- Specified by:
sortByStartingDatein interfaceISortableByStartingDate<Camp>- Returns:
- A new CampList sorted by camp starting dates.
-
sortByEndDate
Sorts the list of camps by their end dates.- Specified by:
sortByEndDatein interfaceISortableByEndDate<Camp>- Returns:
- A new CampList sorted by camp end dates.
-
sortByLocation
Sorts the list of camps by their locations.- Specified by:
sortByLocationin interfaceISortableByLocation<Camp>- Returns:
- A new CampList sorted by camp locations.
-
sortByID
Sorts the list of camps by their IDs.- Specified by:
sortByIDin interfaceISortableByID<Camp>- Returns:
- A new CampList sorted by camp IDs.
-
getAll
Returns all camps in the list.- Returns:
- This CampList.
-
toArray
Converts the CampList to an array of Camp objects.- Overrides:
toArrayin classRepositoryList<Camp>- Returns:
- An array of Camp objects.
-
serialize
Description copied from interface:ISerializableSerializes the object into a list of lists of strings.- Specified by:
serializein interfaceISerializable- Returns:
- An
ArrayListcontaining lists of strings representing the serialized data.
-