Interface Calendar
-
- All Superinterfaces:
java.lang.Cloneable,java.io.Serializable
- All Known Implementing Classes:
AnnualCalendar,BaseCalendar,CronCalendar,DailyCalendar,HolidayCalendar,MonthlyCalendar,WeeklyCalendar
public interface Calendar extends java.io.Serializable, java.lang.CloneableAn interface to be implemented by objects that define spaces of time during which an associatedmay (not) fire. Calendars do not define actual fire times, but rather are used to limit aTriggerTriggerfrom firing on its normal schedule if necessary. Most Calendars include all times by default and allow the user to specify times to exclude.As such, it is often useful to think of Calendars as being used to exclude a block of time - as opposed to include a block of time. (i.e. the schedule "fire every five minutes except on Sundays" could be implemented with a
SimpleTriggerand aWeeklyCalendarwhich excludes Sundays)Implementations MUST take care of being properly
CloneableandSerializable.- Author:
- James House, Juergen Donnerstag
-
-
Field Summary
Fields Modifier and Type Field Description static intMONTH
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.lang.Objectclone()CalendargetBaseCalendar()Get the base calendar.java.lang.StringgetDescription()Return the description given to theCalendarinstance by its creator (if any).longgetNextIncludedTime(long timeStamp)Determine the next time (in milliseconds) that is 'included' by the Calendar after the given time.booleanisTimeIncluded(long timeStamp)Determine whether the given time (in milliseconds) is 'included' by the Calendar.voidsetBaseCalendar(Calendar baseCalendar)Set a new base calendar or remove the existing one.voidsetDescription(java.lang.String description)Set a description for theCalendarinstance - may be useful for remembering/displaying the purpose of the calendar, though the description has no meaning to Quartz.
-
-
-
Field Detail
-
MONTH
static final int MONTH
- See Also:
- Constant Field Values
-
-
Method Detail
-
setBaseCalendar
void setBaseCalendar(Calendar baseCalendar)
Set a new base calendar or remove the existing one.
-
getBaseCalendar
Calendar getBaseCalendar()
Get the base calendar. Will be null, if not set.
-
isTimeIncluded
boolean isTimeIncluded(long timeStamp)
Determine whether the given time (in milliseconds) is 'included' by the Calendar.
-
getNextIncludedTime
long getNextIncludedTime(long timeStamp)
Determine the next time (in milliseconds) that is 'included' by the Calendar after the given time.
-
getDescription
java.lang.String getDescription()
Return the description given to the
Calendarinstance by its creator (if any).- Returns:
- null if no description was set.
-
setDescription
void setDescription(java.lang.String description)
Set a description for the
Calendarinstance - may be useful for remembering/displaying the purpose of the calendar, though the description has no meaning to Quartz.
-
clone
java.lang.Object clone()
-
-