public abstract class ConstrainedSchedule extends AbstractSchedule
| Constructor and Description |
|---|
ConstrainedSchedule() |
| Modifier and Type | Method and Description |
|---|---|
protected abstract java.util.Calendar |
fromCalendar(java.util.Date referenceDate,
java.util.TimeZone timeZone)
Provide a Calendar for the start of the constraint.
|
protected abstract CalendarUnit |
intervalBetween()
Sub classes must provide a unit which is what must be
added to move the schedule on.
|
protected Interval |
lastInterval(ScheduleContext context)
Calculate the last interval.
|
ScheduleResult |
nextDue(ScheduleContext context)
For a given date a schedule will provide the interval this schedule
should next be scheduled in.
|
protected Interval |
nextInterval(ScheduleContext context)
Calculate the next interval, without children.
|
protected java.util.Calendar |
shiftFromCalendar(java.util.Calendar calendar,
int intervals)
Shift the from Calendar by an interval.
|
protected java.util.Calendar |
shiftToCalendar(java.util.Calendar calendar,
int intervals)
Shift the to Calendar by an interval.
|
protected abstract java.util.Calendar |
toCalendar(java.util.Date referenceDate,
java.util.TimeZone timeZone)
Provide a Calendar for the end of the constraint.
|
abstract java.lang.String |
toString()
Force sub classes to override toString.
|
getRefinement, setRefinementprotected abstract java.util.Calendar fromCalendar(java.util.Date referenceDate,
java.util.TimeZone timeZone)
referenceDate - The date/time now.timeZone - The time zone.protected abstract java.util.Calendar toCalendar(java.util.Date referenceDate,
java.util.TimeZone timeZone)
referenceDate - The date/time now.timeZone - The time zone.protected abstract CalendarUnit intervalBetween()
protected final Interval nextInterval(ScheduleContext context)
context - protected final Interval lastInterval(ScheduleContext context)
context - protected java.util.Calendar shiftFromCalendar(java.util.Calendar calendar,
int intervals)
calendar - interval. - protected java.util.Calendar shiftToCalendar(java.util.Calendar calendar,
int intervals)
shiftFromCalendar(Calendar, int)calendar - intervals - public ScheduleResult nextDue(ScheduleContext context)
ScheduleIf the schedule is never due again for the given date, null is returned.
public abstract java.lang.String toString()
toString in class java.lang.Object