org.oddjob.schedules
Class AbstractSchedule

java.lang.Object
  extended byorg.oddjob.schedules.AbstractSchedule
All Implemented Interfaces:
RefineableSchedule, Schedule, java.io.Serializable
Direct Known Subclasses:
AfterSchedule, ConstrainedSchedule, CountSchedule, DateSchedule, DayAfterSchedule, LastSchedule, OccurrenceSchedule, RegularSchedule

public abstract class AbstractSchedule
extends java.lang.Object
implements java.io.Serializable, RefineableSchedule

Proved a basis of common functionality for schedules.

See Also:
Serialized Form
Author:
Rob Gordon

Constructor Summary
AbstractSchedule()
           
 
Method Summary
 void addValueSchedule(Schedule schedule)
          Add a child schedule of the given name.
 Schedule getChildSchedule()
          Return the child schedule.
 Interval getLimits()
          Get any limits set for this schedule.
 void setChildSchedule(Schedule schedule)
          Set the child schedule.
 void setLimits(Interval limits)
          Specifies limits for the schedule.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.oddjob.schedules.Schedule
nextDue
 

Constructor Detail

AbstractSchedule

public AbstractSchedule()
Method Detail

setLimits

public void setLimits(Interval limits)
Description copied from interface: Schedule
Specifies limits for the schedule. If they are set then the start of the interval return by #nextDue(Date) must be within the limits.

A repeating schedule will also use the start of the limit to calculate the boundry between intervals.

Specified by:
setLimits in interface Schedule
Parameters:
limits - The interval which bounds the schedule.

getLimits

public Interval getLimits()
Get any limits set for this schedule.

Returns:
The limits, may be null.

setChildSchedule

public void setChildSchedule(Schedule schedule)
Set the child schedule.

Parameters:
schedule - The child schedule.

addValueSchedule

public void addValueSchedule(Schedule schedule)
Description copied from interface: RefineableSchedule
Add a child schedule of the given name. The implementing class will typically use a factory to create the schedule, add it to it's list of child schedules, and return it so that it's attributes may be set by the calling application.

Specified by:
addValueSchedule in interface RefineableSchedule
Parameters:
schedule - The child schedule.

getChildSchedule

public Schedule getChildSchedule()
Return the child schedule.

Returns:
The child schedule.