net.sf.nachocalendar.holidays
Class HoliDayModel
java.lang.Objectnet.sf.nachocalendar.holidays.HoliDayModel
- DataModel
public class HoliDayModel
extends java.lang.Object
implements DataModel
Default implementation for HoliDayModel. It has a collection
to contain the holidays and convenient accesor methods.
HoliDayModel()- Creates a new instance of DefaultHoliDayModel.
|
void | addHoliDay(HoliDay day)- Adds a new holiday to the Collection.
|
void | clear()- Removes all holidays from the Collection.
|
Collection | getAll()- Returns a Collection with the Holidays.
|
Object | getData(Date date)- Returns the data asociated with the provided date.
|
HoliDay | getHoliDay(Date date)- Checks if the date provided is holiday.
|
int | getSize()- Returns the quantity of holidays in the Collection.
|
void | removeHoliDay(HoliDay day)- Removes the provided holiday from the Collection.
|
HoliDayModel
public HoliDayModel()
Creates a new instance of DefaultHoliDayModel.
addHoliDay
public void addHoliDay(HoliDay day)
Adds a new holiday to the Collection.
clear
public void clear()
Removes all holidays from the Collection.
getAll
public Collection getAll()
Returns a Collection with the Holidays.
- Collection with the Holidays
getData
public Object getData(Date date)
Returns the data asociated with the provided date.
- the data asociated or null
getHoliDay
public HoliDay getHoliDay(Date date)
Checks if the date provided is holiday.
date - Date to be checked
- the holiday or null if it's not a holiday
getSize
public int getSize()
Returns the quantity of holidays in the Collection.
- the size of the Collection
removeHoliDay
public void removeHoliDay(HoliDay day)
Removes the provided holiday from the Collection.
day - holiday to be removed