public class HolidayCalendar extends AbstractCalendar<HolidayCalendar>
This implementation of the Calendar stores a list of holidays (full days that are excluded from scheduling).
The implementation DOES take the year into consideration, so if you want to exclude July 4th for the next 10 years, you need to add 10 entries to the exclude list.
| Constructor and Description |
|---|
HolidayCalendar() |
HolidayCalendar(HolidayCalendar aOther) |
HolidayCalendar(ICalendar baseCalendar) |
HolidayCalendar(ICalendar baseCalendar,
TimeZone timeZone) |
HolidayCalendar(TimeZone timeZone) |
| Modifier and Type | Method and Description |
|---|---|
void |
addExcludedDate(Date excludedDate)
Add the given Date to the list of excluded days.
|
HolidayCalendar |
getClone() |
SortedSet<Date> |
getExcludedDates()
Returns a
SortedSet of Dates representing the excluded days. |
long |
getNextIncludedTime(long nTimeStamp)
Determine the next time (in milliseconds) that is 'included' by the
Calendar after the given time.
|
boolean |
isTimeIncluded(long timeStamp)
Determine whether the given time (in milliseconds) is 'included' by the
Calendar.
|
void |
removeExcludedDate(Date dateToRemove) |
createJavaCalendar, createJavaCalendar, getBaseCalendar, getDescription, getEndOfDayJavaCalendar, getStartOfDayJavaCalendar, getTimeZone, setBaseCalendar, setDescription, setTimeZonepublic HolidayCalendar(@Nonnull HolidayCalendar aOther)
public HolidayCalendar()
public HolidayCalendar(ICalendar baseCalendar)
public HolidayCalendar(TimeZone timeZone)
public boolean isTimeIncluded(long timeStamp)
Determine whether the given time (in milliseconds) is 'included' by the Calendar.
Note that this Calendar is only has full-day precision.
isTimeIncluded in interface ICalendarisTimeIncluded in class AbstractCalendar<HolidayCalendar>ICalendar.isTimeIncluded(long)public long getNextIncludedTime(long nTimeStamp)
getNextIncludedTime in interface ICalendargetNextIncludedTime in class AbstractCalendar<HolidayCalendar>ICalendar.getNextIncludedTime(long)public void addExcludedDate(Date excludedDate)
public void removeExcludedDate(Date dateToRemove)
public SortedSet<Date> getExcludedDates()
Returns a SortedSet of Dates representing the excluded days.
Only the month, day and year of the returned dates are significant.
@Nonnull public HolidayCalendar getClone()
Copyright © 2016–2021 Philip Helger. All rights reserved.