org.oddjob.schedules
Class ConstrainedSchedule

java.lang.Object
  extended byorg.oddjob.schedules.AbstractSchedule
      extended byorg.oddjob.schedules.ConstrainedSchedule
All Implemented Interfaces:
RefineableSchedule, Schedule, java.io.Serializable
Direct Known Subclasses:
DayOfMonthSchedule, DayOfWeekSchedule, DayOfYearSchedule, MonthSchedule, TimeSchedule

public abstract class ConstrainedSchedule
extends AbstractSchedule

A base class for a Schedule which has a from and a to date.

See Also:
Serialized Form
Author:
Rob Gordon

Constructor Summary
ConstrainedSchedule()
           
 
Method Summary
abstract  java.util.Date getEndDate(ScheduleContext context)
          For the given time, calculate when this schedule interval should finish.
abstract  java.lang.String getFrom()
          Get the from date/time as a String.
abstract  java.util.Date getStartDate(ScheduleContext context)
          For the given time, calculate when this schedule should start or should have started.
abstract  java.lang.String getTo()
          Get the to date/time as a String.
 Interval nextDue(ScheduleContext context)
          For a given date a schedule will provide the interval this schedule should next be scheduled in.
abstract  void setFrom(java.lang.String from)
           
 void setOn(java.lang.String on)
           
abstract  void setTo(java.lang.String to)
           
 java.lang.String toString()
          Override toString.
 
Methods inherited from class org.oddjob.schedules.AbstractSchedule
addValueSchedule, getChildSchedule, getLimits, setChildSchedule, setLimits
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ConstrainedSchedule

public ConstrainedSchedule()
Method Detail

setFrom

public abstract void setFrom(java.lang.String from)
Oddjob Property:
from
Description:
The from date/time.
Required:
No.
Parameters:
from - The from date.

getFrom

public abstract java.lang.String getFrom()
Get the from date/time as a String.

Returns:
The from date.

setTo

public abstract void setTo(java.lang.String to)
Oddjob Property:
to
Description:
The to date/time.
Required:
No.
Parameters:
to - The to date.

getTo

public abstract java.lang.String getTo()
Get the to date/time as a String.

Returns:
The to date.

getStartDate

public abstract java.util.Date getStartDate(ScheduleContext context)
For the given time, calculate when this schedule should start or should have started.

Returns:
The date/time the scheudle is/was due.

getEndDate

public abstract java.util.Date getEndDate(ScheduleContext context)
For the given time, calculate when this schedule interval should finish.

Returns:
The date/time the schedule should finish.

setOn

public void setOn(java.lang.String on)
Oddjob Property:
on
Description:
The on date/time. This has the same effect as setting from and to to the same thing.
Required:
No.
Throws:
java.text.ParseException - If the string isn't a date.

nextDue

public Interval nextDue(ScheduleContext context)
Description copied from interface: Schedule
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.

Returns:
The next due interval for the schedule.

toString

public java.lang.String toString()
Override toString.

Returns:
A description of the schedule.