|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.oddjob.schedules.AbstractSchedule
org.oddjob.schedules.ConstrainedSchedule
public abstract class ConstrainedSchedule
A base class for a Schedule which has a from and a to date.
Constructor Summary | |
---|---|
ConstrainedSchedule()
|
Method Summary | |
---|---|
protected abstract Calendar |
fromCalendar(Date referenceDate,
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 Calendar |
shiftFromCalendar(Calendar calendar,
int intervals)
Shift the from Calendar by an interval. |
protected Calendar |
shiftToCalendar(Calendar calendar,
int intervals)
Shift the to Calendar by an interval. |
protected abstract Calendar |
toCalendar(Date referenceDate,
TimeZone timeZone)
Provide a Calendar for the end of the constraint. |
abstract String |
toString()
Force sub classes to override toString. |
Methods inherited from class org.oddjob.schedules.AbstractSchedule |
---|
getRefinement, setRefinement |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public ConstrainedSchedule()
Method Detail |
---|
protected abstract Calendar fromCalendar(Date referenceDate, TimeZone timeZone)
referenceDate
- The date/time now.timeZone
- The time zone.
protected abstract Calendar toCalendar(Date referenceDate, 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 Calendar shiftFromCalendar(Calendar calendar, int intervals)
calendar
- interval.
-
protected Calendar shiftToCalendar(Calendar calendar, int intervals)
shiftFromCalendar(Calendar, int)
calendar
- intervals
-
public ScheduleResult nextDue(ScheduleContext context)
Schedule
If the schedule is never due again for the given date, null is returned.
public abstract String toString()
toString
in class Object
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |