- java.lang.Object
-
- model.camp.Camp
-
public class Camp extends java.lang.ObjectRepresents a camp declared within the system Each camp has various attributes such as a unique identifier, name, closing date, available schools, location, time slots, camp committee slots, camp description, staff in charge, list of attendees and committee members, and withdrawn participants. This class provides methods to interact with and edit camp related data.
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.List<Schools>availablelist of available schoolsprivate java.util.List<java.lang.String>campCommitteeList of camp committeeprivate intcampCommitteeSlotsnumber of camp committee slotsprivate intcampIDcamp's campIDprivate java.time.LocalDateclosingclosing date of campprivate java.util.List<java.time.LocalDate>dateslist of the dates the camp is heldprivate java.lang.Stringdescriptioncamp descriptionprivate java.lang.Stringlocationlocation of campprivate java.lang.Stringnamename of campprivate java.lang.StringstaffICstaff in-charge of the campprivate java.util.List<java.lang.String>studentslist of students participating in the campprivate inttotalSlotstotal number of slots for camoprivate booleanvisibilitythe visibility of the campprivate java.util.List<java.lang.String>withdrawnlist of withdrawn student from the camp
-
Constructor Summary
Constructors Constructor Description Camp(int campID, java.lang.String name, java.util.List<java.time.LocalDate> dates, java.time.LocalDate closing, java.util.List<Schools> available, java.lang.String location, int totalSlots, java.lang.String description, java.lang.String staffIC, boolean visibility)Constructor of classCampCamp(int campID, java.lang.String name, java.util.List<java.time.LocalDate> dates, java.time.LocalDate closing, java.util.List<Schools> available, java.lang.String location, int totalSlots, java.lang.String description, java.lang.String staffIC, boolean visibility, java.util.List<java.lang.String> students, int campCommitteeSlots, java.util.List<java.lang.String> campCommittee, java.util.List<java.lang.String> withdrawn)Constructor of classCamp
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanaddAttendee(java.lang.String newAttendeeID)Adds an attendee to the camp and decreases the total available slots.booleanaddCommittee(java.lang.String newCommittee)Adds a committee member to the camp and decreases both total available slots and camp committee slots.java.util.List<Schools>getAvailable()Gets the list of available schools for the camp.java.util.List<java.lang.String>getCampCommittee()Gets the list of camp committee members.intgetCampCommitteeSlots()Gets the number of camp committee slots available for the camp.intgetCampID()Gets the unique identifier of the camp.java.time.LocalDategetClosing()Gets the closing date of the camp.java.util.List<java.time.LocalDate>getDates()Gets the list of dates associated with the camp.java.lang.StringgetDescription()Gets the description of the camp.java.lang.StringgetLocation()Gets the location of the camp.java.lang.StringgetName()Gets the name of the camp.java.lang.StringgetStaffIC()Gets the staff in charge of the camp.java.util.List<java.lang.String>getStudents()Gets the list of students (attendees) registered for the camp.intgetTotalSlots()Gets the total number of slots available for the camp.booleangetVisibility()Gets the visibility status of the camp.java.util.List<java.lang.String>getWithdrawn()Gets the list of withdrawn participants from the camp.booleanremoveAttendee(java.lang.String attendeeID)Removes an attendee from the camp, increases the total available slots and add the attendee into the withdraw listvoidsetAvailable(java.util.List<Schools> school)Sets the list of available schools for the camp.voidsetCampCommittee(java.util.List<java.lang.String> campCommittee)Sets the list of camp committee members.voidsetCampCommitteeSlots(int campCommitteeSlots)Sets the number of camp committee slots available for the camp.voidsetCampID(int campID)Sets the unique identifier of the camp.voidsetClosing(java.time.LocalDate closing)Sets the closing date of the camp.voidsetDates(java.util.List<java.time.LocalDate> dates)Sets the list of dates for the camp.voidsetDescription(java.lang.String description)Sets the description of the camp.voidsetLocation(java.lang.String location)Sets the location of the camp.voidsetName(java.lang.String name)Sets the name of the camp.voidsetStaffIC(java.lang.String staffIC)Sets Unique identifier of the staff.voidsetStudents(java.util.List<java.lang.String> students)Sets the list of students (attendees) for the camp.voidsetTotalSlots(int totalSlots)Sets the total number of slots available for the camp.voidsetVisibility(boolean visibility)Sets the visibility status of the camp.voidsetWithdrawn(java.util.List<java.lang.String> withdrawn)Sets the list of withdrawn participants for the camp.
-
-
-
Field Detail
-
campID
private int campID
camp's campID
-
name
private java.lang.String name
name of camp
-
dates
private java.util.List<java.time.LocalDate> dates
list of the dates the camp is held
-
closing
private java.time.LocalDate closing
closing date of camp
-
available
private java.util.List<Schools> available
list of available schools
-
location
private java.lang.String location
location of camp
-
totalSlots
private int totalSlots
total number of slots for camo
-
students
private java.util.List<java.lang.String> students
list of students participating in the camp
-
campCommitteeSlots
private int campCommitteeSlots
number of camp committee slots
-
campCommittee
private java.util.List<java.lang.String> campCommittee
List of camp committee
-
description
private java.lang.String description
camp description
-
staffIC
private java.lang.String staffIC
staff in-charge of the camp
-
visibility
private boolean visibility
the visibility of the camp
-
withdrawn
private java.util.List<java.lang.String> withdrawn
list of withdrawn student from the camp
-
-
Constructor Detail
-
Camp
public Camp(int campID, java.lang.String name, java.util.List<java.time.LocalDate> dates, java.time.LocalDate closing, java.util.List<Schools> available, java.lang.String location, int totalSlots, java.lang.String description, java.lang.String staffIC, boolean visibility)Constructor of classCamp- Parameters:
campID- ID of the campname- Name of the campdates- A list of dates for the campclosing- Closing date for registrationavailable- A list of schools that can register for the camplocation- Location of the camptotalSlots- Number of slots for registrationdescription- Description of the campstaffIC- IC of staff in chargevisibility- visibility of the camp to students
-
Camp
public Camp(int campID, java.lang.String name, java.util.List<java.time.LocalDate> dates, java.time.LocalDate closing, java.util.List<Schools> available, java.lang.String location, int totalSlots, java.lang.String description, java.lang.String staffIC, boolean visibility, java.util.List<java.lang.String> students, int campCommitteeSlots, java.util.List<java.lang.String> campCommittee, java.util.List<java.lang.String> withdrawn)Constructor of classCamp- Parameters:
campID- ID of the campname- Name of the campdates- A list of dates for the campclosing- Closing date for registrationavailable- A list of schools that can register for the camplocation- Location of the camptotalSlots- Number of slots for registrationdescription- Description of the campstaffIC- IC of staff in chargevisibility- visibility of the camp to studentsstudents- A list of students that registered for the campcampCommitteeSlots- Number of slots for camp committee memberscampCommittee- A list of committee that attached to the campwithdrawn- A list of students that withdraw from the camp
-
-
Method Detail
-
getCampID
public int getCampID()
Gets the unique identifier of the camp.- Returns:
- The unique identifier of the camp.
-
setCampID
public void setCampID(int campID)
Sets the unique identifier of the camp.- Parameters:
campID- The unique identifier to set for the camp.
-
getName
public java.lang.String getName()
Gets the name of the camp.- Returns:
- The name of the camp.
-
getStaffIC
public java.lang.String getStaffIC()
Gets the staff in charge of the camp.- Returns:
- The staff in charge of the camp.
-
setName
public void setName(java.lang.String name)
Sets the name of the camp.- Parameters:
name- The name to set for the camp.
-
getDates
public java.util.List<java.time.LocalDate> getDates()
Gets the list of dates associated with the camp.- Returns:
- The list of dates for the camp.
-
setDates
public void setDates(java.util.List<java.time.LocalDate> dates)
Sets the list of dates for the camp.- Parameters:
dates- The list of dates to set for the camp.
-
getClosing
public java.time.LocalDate getClosing()
Gets the closing date of the camp.- Returns:
- The closing date of the camp.
-
setClosing
public void setClosing(java.time.LocalDate closing)
Sets the closing date of the camp.- Parameters:
closing- The closing date to set for the camp.
-
getAvailable
public java.util.List<Schools> getAvailable()
Gets the list of available schools for the camp.- Returns:
- The list of available schools for the camp.
-
setAvailable
public void setAvailable(java.util.List<Schools> school)
Sets the list of available schools for the camp.- Parameters:
school- The list of available schools to set for the camp.
-
getLocation
public java.lang.String getLocation()
Gets the location of the camp.- Returns:
- The location of the camp.
-
setLocation
public void setLocation(java.lang.String location)
Sets the location of the camp.- Parameters:
location- The location to set for the camp.
-
getTotalSlots
public int getTotalSlots()
Gets the total number of slots available for the camp.- Returns:
- The total number of slots available for the camp.
-
setTotalSlots
public void setTotalSlots(int totalSlots)
Sets the total number of slots available for the camp.- Parameters:
totalSlots- The total number of slots to set for the camp.
-
getStudents
public java.util.List<java.lang.String> getStudents()
Gets the list of students (attendees) registered for the camp.- Returns:
- The list of students registered for the camp.
-
setStudents
public void setStudents(java.util.List<java.lang.String> students)
Sets the list of students (attendees) for the camp.- Parameters:
students- The list of students to set for the camp.
-
addAttendee
public boolean addAttendee(java.lang.String newAttendeeID)
Adds an attendee to the camp and decreases the total available slots.- Parameters:
newAttendeeID- The unique identifier of the new attendee.- Returns:
- True if the attendee is successfully added, false otherwise.
-
removeAttendee
public boolean removeAttendee(java.lang.String attendeeID)
Removes an attendee from the camp, increases the total available slots and add the attendee into the withdraw list- Parameters:
attendeeID- The unique identifier of the attendee to remove.- Returns:
- True if the attendee is successfully removed, false otherwise.
-
getCampCommitteeSlots
public int getCampCommitteeSlots()
Gets the number of camp committee slots available for the camp.- Returns:
- The number of camp committee slots available for the camp.
-
setCampCommitteeSlots
public void setCampCommitteeSlots(int campCommitteeSlots)
Sets the number of camp committee slots available for the camp.- Parameters:
campCommitteeSlots- The number of camp committee slots to set for the camp.
-
getCampCommittee
public java.util.List<java.lang.String> getCampCommittee()
Gets the list of camp committee members.- Returns:
- The list of camp committee members.
-
setCampCommittee
public void setCampCommittee(java.util.List<java.lang.String> campCommittee)
Sets the list of camp committee members.- Parameters:
campCommittee- The list of camp committee members to set.
-
addCommittee
public boolean addCommittee(java.lang.String newCommittee)
Adds a committee member to the camp and decreases both total available slots and camp committee slots.- Parameters:
newCommittee- The unique identifier of the new committee member.- Returns:
- True if the committee member is successfully added, false otherwise.
-
setStaffIC
public void setStaffIC(java.lang.String staffIC)
Sets Unique identifier of the staff.- Parameters:
staffIC- The unique identifier of staff
-
getDescription
public java.lang.String getDescription()
Gets the description of the camp.- Returns:
- The description of the camp.
-
setDescription
public void setDescription(java.lang.String description)
Sets the description of the camp.- Parameters:
description- The description to set for the camp.
-
getVisibility
public boolean getVisibility()
Gets the visibility status of the camp.- Returns:
- True if the camp is visible, false otherwise.
-
setVisibility
public void setVisibility(boolean visibility)
Sets the visibility status of the camp.- Parameters:
visibility- True to set the camp as visible, false to set it as invisible.
-
getWithdrawn
public java.util.List<java.lang.String> getWithdrawn()
Gets the list of withdrawn participants from the camp.- Returns:
- The list of withdrawn students from the camp.
-
setWithdrawn
public void setWithdrawn(java.util.List<java.lang.String> withdrawn)
Sets the list of withdrawn participants for the camp.- Parameters:
withdrawn- The list of withdrawn participants to set for the camp.
-
-