Class HolidayCalendar
- java.lang.Object
-
- org.quartz.impl.calendar.BaseCalendar
-
- org.quartz.impl.calendar.HolidayCalendar
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Cloneable
,Calendar
public class HolidayCalendar extends BaseCalendar implements Calendar, java.io.Serializable
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.
- Author:
- Sharada Jambula, Juergen Donnerstag
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description HolidayCalendar()
HolidayCalendar(java.util.TimeZone timeZone)
HolidayCalendar(Calendar baseCalendar)
HolidayCalendar(Calendar baseCalendar, java.util.TimeZone timeZone)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addExcludedDate(java.util.Date excludedDate)
Add the given Date to the list of excluded days.java.lang.Object
clone()
java.util.SortedSet<java.util.Date>
getExcludedDates()
Returns aSortedSet
of Dates representing the excluded days.long
getNextIncludedTime(long timeStamp)
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(java.util.Date dateToRemove)
-
Methods inherited from class org.quartz.impl.calendar.BaseCalendar
createJavaCalendar, createJavaCalendar, getBaseCalendar, getDescription, getEndOfDayJavaCalendar, getStartOfDayJavaCalendar, getTimeZone, setBaseCalendar, setDescription, setTimeZone
-
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.quartz.Calendar
getBaseCalendar, getDescription, setBaseCalendar, setDescription
-
-
-
-
Method Detail
-
clone
public java.lang.Object clone()
- Specified by:
clone
in interfaceCalendar
- Overrides:
clone
in classBaseCalendar
-
isTimeIncluded
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.
- Specified by:
isTimeIncluded
in interfaceCalendar
- Overrides:
isTimeIncluded
in classBaseCalendar
- See Also:
Calendar.isTimeIncluded(long)
-
getNextIncludedTime
public long getNextIncludedTime(long timeStamp)
Determine the next time (in milliseconds) that is 'included' by the Calendar after the given time.
Note that this Calendar is only has full-day precision.
- Specified by:
getNextIncludedTime
in interfaceCalendar
- Overrides:
getNextIncludedTime
in classBaseCalendar
- See Also:
Calendar.getNextIncludedTime(long)
-
addExcludedDate
public void addExcludedDate(java.util.Date excludedDate)
Add the given Date to the list of excluded days. Only the month, day and year of the returned dates are significant.
-
removeExcludedDate
public void removeExcludedDate(java.util.Date dateToRemove)
-
getExcludedDates
public java.util.SortedSet<java.util.Date> getExcludedDates()
Returns a
SortedSet
of Dates representing the excluded days. Only the month, day and year of the returned dates are significant.
-
-