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

All Implemented Interfaces:
    Serializable, Calendar

Direct Known Subclasses:
    WeeklyCalendar, DailyCalendar, AnnualCalendar, CronCalendar, MonthlyCalendar, HolidayCalendar

This implementation of the Calendar may be used (you don't have to) as a base class for more sophisticated one's. It merely implements the base functionality required by each Calendar.

Regarded as base functionality is the treatment of base calendars. Base calendar allow you to chain (stack) as much calendars as you may need. For example to exclude weekends you may use WeeklyCalendar. In order to exclude holidays as well you may define a WeeklyCalendar instance to be the base calendar for HolidayCalendar instance.

Field Summary
static final  long serialVersionUID     
Constructor:
 public BaseCalendar() 
 public BaseCalendar(Calendar baseCalendar) 
 public BaseCalendar(TimeZone timeZone) 
    Parameters:
    timeZone - The time zone to use for this Calendar, null if TimeZone#getDefault() should be used
 public BaseCalendar(Calendar baseCalendar,
    TimeZone timeZone) 
    Parameters:
    timeZone - The time zone to use for this Calendar, null if TimeZone#getDefault() should be used
Method from org.quartz.impl.calendar.BaseCalendar Summary:
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.BaseCalendar Detail:
 public static Date buildHoliday(Date excludedDate) 
Deprecated! Always - uses the default time zone.

    Utility method. Return the date of excludeDate. The time fraction will be reset to 00.00:00.
 public static long buildHoliday(long timeStamp) 
Deprecated! Always - uses the default time zone.

    Utility method. Return just the date of timeStamp. The time fraction will be reset to 00.00:00.
 protected Calendar createJavaCalendar() 
    Build a java.util.Calendar with the current time. The new Calendar will use the BaseCalendar time zone if it is not null.
 protected Calendar createJavaCalendar(long timeStamp) 
    Build a java.util.Calendar for the given timeStamp. The new Calendar will use the BaseCalendar time zone if it is not null.
 public Calendar getBaseCalendar() 

    Get the base calendar. Will be null, if not set.

 public String getDescription() 

    Return the description given to the Calendar instance by its creator (if any).

 protected Calendar getEndOfDayJavaCalendar(long timeInMillis) 
    Returns the end of the given day java.util.Calendar . This calculation will take the BaseCalendar time zone into account if it is not null.
 public static Calendar getJavaCalendar(long timeStamp) 
Deprecated! Always - uses the default time zone.

    Utility method. Return a java.util.Calendar for timeStamp.
 public long getNextIncludedTime(long timeStamp) 

    Determine the next time (in milliseconds) that is 'included' by the Calendar after the given time. Return the original value if timeStamp is included. Return 0 if all days are excluded.

 protected Calendar getStartOfDayJavaCalendar(long timeInMillis) 
    Returns the start of the given day as a java.util.Calendar . This calculation will take the BaseCalendar time zone into account if it is not null.
 public TimeZone getTimeZone() 
    Returns the time zone for which this Calendar will be resolved.
 public boolean isTimeIncluded(long timeStamp) 

    Check if date/time represented by timeStamp is included. If included return true. The implementation of BaseCalendar simply calls the base calendars isTimeIncluded() method if base calendar is set.

 public  void setBaseCalendar(Calendar baseCalendar) 

    Set a new base calendar or remove the existing one

 public  void setDescription(String description) 

    Set a description for the Calendar instance - may be useful for remembering/displaying the purpose of the calendar, though the description has no meaning to Quartz.

 public  void setTimeZone(TimeZone timeZone) 
    Sets the time zone for which this Calendar will be resolved.