org.treesched
Interface Schedule

All Known Subinterfaces:
CompoundSchedule, RefineableSchedule
All Known Implementing Classes:
AbstractSchedule, BrokenSchedule, ScheduleList, TopScheduleElement

public interface Schedule

The interface that defines a schedule.

Author:
Rob Gordon

Method Summary
 Interval nextDue(java.util.Date now)
          For a given date a schedule will provide the interval this schedule should next be scheduled in.
 void reset()
          Reset the schedule.
 void setLimits(Interval limits)
          Specifies limits for the schedule.
 

Method Detail

nextDue

public Interval nextDue(java.util.Date now)
For a given date a schedule will provide the interval this schedule should next be scheduled in.

If the schedule is never due again for the given date, null is returned.

Parameters:
now - The date now.
Returns:
The next due interval for the schedule.

setLimits

public void setLimits(Interval limits)
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.

Parameters:
limits - The interval which bounds the schedule.

reset

public void reset()
Reset the schedule. This allows schedules which contain state, such as count to be reset.