Home » quartz-1.6.0 » org » quartz » impl » calendar » [javadoc | source]
org.quartz.impl.calendar
public class: CronCalendar [javadoc | source]
java.lang.Object
   org.quartz.impl.calendar.BaseCalendar
      org.quartz.impl.calendar.CronCalendar

All Implemented Interfaces:
    Serializable, Calendar

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-23 ? * *".

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
static final  long serialVersionUID     
 CronExpression cronExpression     
Fields inherited from org.quartz.impl.calendar.BaseCalendar:
serialVersionUID
Constructor:
 public CronCalendar(String expression) throws ParseException 
    Create a CronCalendar with the given cron expression and no baseCalendar.
    Parameters:
    expression - a String representation of the desired cron expression
 public CronCalendar(Calendar baseCalendar,
    String expression) throws ParseException 
    Create a CronCalendar with the given cron expression and baseCalendar.
    Parameters:
    baseCalendar - the base calendar for this calendar instance – see BaseCalendar for more information on base calendar functionality
    expression - a String representation of the desired cron expression
 public CronCalendar(String name,
    String expression) throws ParseException 
 public CronCalendar(Calendar baseCalendar,
    String expression,
    TimeZone timeZone) throws ParseException 
    Create a CronCalendar with the given cron exprssion, baseCalendar, and TimeZone.
    Parameters:
    baseCalendar - the base calendar for this calendar instance – see BaseCalendar for more information on base calendar functionality
    expression - a String representation of the desired cron expression
    timeZone - Specifies for which time zone the expression should be interpreted, i.e. the expression 0 0 10 * * ?, is resolved to 10:00 am in this time zone. If timeZone is null then TimeZone.getDefault() will be used.
 public CronCalendar(String name,
    Calendar baseCalendar,
    String expression) throws ParseException 
 public CronCalendar(String name,
    Calendar baseCalendar,
    String expression,
    TimeZone timeZone) throws ParseException 
Method from org.quartz.impl.calendar.CronCalendar Summary:
getCronExpression,   getName,   getNextIncludedTime,   getTimeZone,   isTimeIncluded,   setCronExpression,   setCronExpression,   setTimeZone,   toString
Methods from org.quartz.impl.calendar.BaseCalendar:
buildHoliday,   buildHoliday,   createJavaCalendar,   createJavaCalendar,   getBaseCalendar,   getDescription,   getEndOfDayJavaCalendar,   getJavaCalendar,   getNextIncludedTime,   getStartOfDayJavaCalendar,   getTimeZone,   isTimeIncluded,   setBaseCalendar,   setDescription,   setTimeZone
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.quartz.impl.calendar.CronCalendar Detail:
 public CronExpression getCronExpression() 
    Returns the object representation of the cron expression that defines the dates and times this calendar excludes.
 public String getName() 
Deprecated! The - use of name is no longer supported.

    Returns the name of the CronCalendar
 public long getNextIncludedTime(long timeInMillis) 
    Determines the next time included by the CronCalendar after the specified time.
 public TimeZone getTimeZone() 
    Returns the time zone for which the CronExpression of this CronCalendar will be resolved.

    Overrides BaseCalendar#getTimeZone() to defer to its CronExpression.

 public boolean isTimeIncluded(long timeInMillis) 
    Determines whether the given time (in milliseconds) is 'included' by the BaseCalendar
 public  void setCronExpression(String expression) throws ParseException 
    Sets the cron expression for the calendar to a new value
 public  void setCronExpression(CronExpression expression) 
    Sets the cron expression for the calendar to a new value
 public  void setTimeZone(TimeZone timeZone) 
    Sets the time zone for which the CronExpression of this CronCalendar will be resolved. If timeZone is null then TimeZone.getDefault() will be used.

    Overrides BaseCalendar#setTimeZone(TimeZone) to defer to its CronExpression.

 public String toString() 
    Returns a string representing the properties of the CronCalendar