Class HolidayManager

java.lang.Object
Manager
HolidayManager
All Implemented Interfaces:
Base, BaseManager

public class HolidayManager extends Manager implements BaseManager
A HolidayManager object

A HolidayManager object contains all the parameters and methods required to communicate between entity and boundary of Holiday Class

  • Constructor Details

    • HolidayManager

      public HolidayManager()
      Default Constructor
  • Method Details

    • setManagers

      public void setManagers()
      Method to set all controller classes passed as attributes
      Specified by:
      setManagers in interface Base
    • setMasterLists

      public void setMasterLists()
      Method to set all master lists passed as attributes
      Specified by:
      setMasterLists in interface BaseManager
    • isHoliday

      public boolean isHoliday(String date)
      Method to check if the date passed is a holiday or not
      Parameters:
      date - Date
      Returns:
      True if the date is a holiday, False otherwise
    • getWeekend

      public Boolean getWeekend(String date) throws ParseException
      Method to check if the date is a weekend
      Parameters:
      date - Date
      Returns:
      True if the date is a weekend, False otherwise
      Throws:
      ParseException - creating object error
    • addHoliday

      public int addHoliday(String holidayDate)
      Method to add a holiday
      Parameters:
      holidayDate - The date to be added as a holiday
      Returns:
      1 if date already exists as a holiday, 2 if the date format is wrong, 0 if the addition is a success
    • listAllHolidays

      public ArrayList<String> listAllHolidays()
      Method to return all holidays as an array
      Returns:
      list of all holidays
    • primeHolidays

      public void primeHolidays() throws IOException
      Method to read the input data about holidays
      Throws:
      IOException - If there's read error
    • writeHolidays

      public void writeHolidays() throws IOException
      Method to write back the data to the files
      Throws:
      IOException - If there's write error