Class HolidayManager
java.lang.Object
Manager
HolidayManager
- All Implemented Interfaces:
Base,BaseManager
A HolidayManager object
A HolidayManager object contains all the parameters and methods required
to communicate between entity and boundary of Holiday Class
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintaddHoliday(String holidayDate) Method to add a holidaygetWeekend(String date) Method to check if the date is a weekendbooleanMethod to check if the date passed is a holiday or notMethod to return all holidays as an arrayvoidMethod to read the input data about holidaysvoidMethod to set all controller classes passed as attributesvoidMethod to set all master lists passed as attributesvoidMethod to write back the data to the filesMethods inherited from class Manager
getCentralManager, setCentralManagerMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Base
getCentralManager, setCentralManager
-
Constructor Details
-
HolidayManager
public HolidayManager()Default Constructor
-
-
Method Details
-
setManagers
public void setManagers()Method to set all controller classes passed as attributes- Specified by:
setManagersin interfaceBase
-
setMasterLists
public void setMasterLists()Method to set all master lists passed as attributes- Specified by:
setMasterListsin interfaceBaseManager
-
isHoliday
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
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
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
Method to return all holidays as an array- Returns:
- list of all holidays
-
primeHolidays
Method to read the input data about holidays- Throws:
IOException- If there's read error
-
writeHolidays
Method to write back the data to the files- Throws:
IOException- If there's write error
-