Package model.camp

Class Camp


  • public class Camp
    extends java.lang.Object
    Represents 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> available
      list of available schools
      private java.util.List<java.lang.String> campCommittee
      List of camp committee
      private int campCommitteeSlots
      number of camp committee slots
      private int campID
      camp's campID
      private java.time.LocalDate closing
      closing date of camp
      private java.util.List<java.time.LocalDate> dates
      list of the dates the camp is held
      private java.lang.String description
      camp description
      private java.lang.String location
      location of camp
      private java.lang.String name
      name of camp
      private java.lang.String staffIC
      staff in-charge of the camp
      private java.util.List<java.lang.String> students
      list of students participating in the camp
      private int totalSlots
      total number of slots for camo
      private boolean visibility
      the visibility of the camp
      private java.util.List<java.lang.String> withdrawn
      list 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 class Camp
      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 class Camp
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean addAttendee​(java.lang.String newAttendeeID)
      Adds an attendee to the camp and decreases the total available slots.
      boolean addCommittee​(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.
      int getCampCommitteeSlots()
      Gets the number of camp committee slots available for the camp.
      int getCampID()
      Gets the unique identifier of the camp.
      java.time.LocalDate getClosing()
      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.String getDescription()
      Gets the description of the camp.
      java.lang.String getLocation()
      Gets the location of the camp.
      java.lang.String getName()
      Gets the name of the camp.
      java.lang.String getStaffIC()
      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.
      int getTotalSlots()
      Gets the total number of slots available for the camp.
      boolean getVisibility()
      Gets the visibility status of the camp.
      java.util.List<java.lang.String> getWithdrawn()
      Gets the list of withdrawn participants from the camp.
      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
      void setAvailable​(java.util.List<Schools> school)
      Sets the list of available schools for the camp.
      void setCampCommittee​(java.util.List<java.lang.String> campCommittee)
      Sets the list of camp committee members.
      void setCampCommitteeSlots​(int campCommitteeSlots)
      Sets the number of camp committee slots available for the camp.
      void setCampID​(int campID)
      Sets the unique identifier of the camp.
      void setClosing​(java.time.LocalDate closing)
      Sets the closing date of the camp.
      void setDates​(java.util.List<java.time.LocalDate> dates)
      Sets the list of dates for the camp.
      void setDescription​(java.lang.String description)
      Sets the description of the camp.
      void setLocation​(java.lang.String location)
      Sets the location of the camp.
      void setName​(java.lang.String name)
      Sets the name of the camp.
      void setStaffIC​(java.lang.String staffIC)
      Sets Unique identifier of the staff.
      void setStudents​(java.util.List<java.lang.String> students)
      Sets the list of students (attendees) for the camp.
      void setTotalSlots​(int totalSlots)
      Sets the total number of slots available for the camp.
      void setVisibility​(boolean visibility)
      Sets the visibility status of the camp.
      void setWithdrawn​(java.util.List<java.lang.String> withdrawn)
      Sets the list of withdrawn participants for the camp.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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 class Camp
        Parameters:
        campID - ID of the camp
        name - Name of the camp
        dates - A list of dates for the camp
        closing - Closing date for registration
        available - A list of schools that can register for the camp
        location - Location of the camp
        totalSlots - Number of slots for registration
        description - Description of the camp
        staffIC - IC of staff in charge
        visibility - 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 class Camp
        Parameters:
        campID - ID of the camp
        name - Name of the camp
        dates - A list of dates for the camp
        closing - Closing date for registration
        available - A list of schools that can register for the camp
        location - Location of the camp
        totalSlots - Number of slots for registration
        description - Description of the camp
        staffIC - IC of staff in charge
        visibility - visibility of the camp to students
        students - A list of students that registered for the camp
        campCommitteeSlots - Number of slots for camp committee members
        campCommittee - A list of committee that attached to the camp
        withdrawn - 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.