|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.quartz.impl.calendar.BaseCalendar
org.quartz.impl.calendar.CronCalendar
This implementation of the Calendar excludes the set of times expressed by a
given CronExpression. For example, you
could use this calendar to exclude all but business hours (8AM - 5PM) every
day using the expression "* * 0-7,18-24 ? * *".
It is important to remember that the cron expression here describes a set of
times to be excluded from firing. Whereas the cron expression in
CronTrigger describes a set of times that can
be included for firing. Thus, if a CronTrigger has a
given cron expression and is associated with a CronCalendar with
the same expression, the calendar will exclude all the times the
trigger includes, and they will cancel each other out.
| Field Summary |
| Fields inherited from interface org.quartz.Calendar |
MONTH |
| Constructor Summary | |
CronCalendar(String name,
Calendar baseCalendar,
String expression)
Create a CronCalendar with the given cron exprssion and
baseCalendar. |
|
CronCalendar(String name,
String expression)
Create a CronCalendar with the given cron expression and no
baseCalendar. |
|
| Method Summary | |
CronExpression |
getCronExpression()
Returns the object representation of the cron expression that defines the dates and times this calendar excludes. |
String |
getName()
Returns the name of the CronCalendar |
long |
getNextIncludedTime(long timeInMillis)
Determines the next time included by the CronCalendar
after the specified time. |
boolean |
isTimeIncluded(long timeInMillis)
Determines whether the given time (in milliseconds) is 'included' by the BaseCalendar |
void |
setCronExpression(CronExpression expression)
Sets the cron expression for the calendar to a new value |
void |
setCronExpression(String expression)
Sets the cron expression for the calendar to a new value |
String |
toString()
Returns a string representing the properties of the CronCalendar |
| Methods inherited from class org.quartz.impl.calendar.BaseCalendar |
buildHoliday, buildHoliday, getBaseCalendar, getDescription, getJavaCalendar, setBaseCalendar, setDescription |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public CronCalendar(String name,
String expression)
throws ParseException
CronCalendar with the given cron expression and no
baseCalendar.
name - the name for the DailyCalendarexpression - a String representation of the desired cron expression
public CronCalendar(String name,
Calendar baseCalendar,
String expression)
throws ParseException
CronCalendar with the given cron exprssion and
baseCalendar.
name - the name for the DailyCalendarbaseCalendar - the base calendar for this calendar instance –
see BaseCalendar for more information on base
calendar functionalityexpression - a String representation of the desired cron expression| Method Detail |
public String getName()
CronCalendar
CronCalendarpublic boolean isTimeIncluded(long timeInMillis)
BaseCalendar
isTimeIncluded in interface CalendarisTimeIncluded in class BaseCalendartimeInMillis - the date/time to test
CronCalendarCalendar.isTimeIncluded(long)public long getNextIncludedTime(long timeInMillis)
CronCalendar
after the specified time.
getNextIncludedTime in interface CalendargetNextIncludedTime in class BaseCalendartimeInMillis - the initial date/time after which to find an
included time
Calendar.getNextIncludedTime(long)public String toString()
CronCalendar
public CronExpression getCronExpression()
CronExpression
public void setCronExpression(String expression)
throws ParseException
expression - the new string value to build a cron expression from
ParseException - if the string expression cannot be parsedpublic void setCronExpression(CronExpression expression)
expression - the new cron expression
|
Quartz Enterprise Job Scheduler Project Page | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||