org.oddjob.schedules.schedules
Class DateSchedule

java.lang.Object
  extended byorg.oddjob.schedules.AbstractSchedule
      extended byorg.oddjob.schedules.schedules.DateSchedule
All Implemented Interfaces:
RefineableSchedule, Schedule, java.io.Serializable

public final class DateSchedule
extends AbstractSchedule
implements java.io.Serializable

Description:
Provide a schedule for a specific date or defining an interval between two dates.

Any number of nested sub schedules are allowed.

Example:
 <date on="25-dec-04"/>
 
See Also:
Serialized Form
Author:
Rob Gordon

Constructor Summary
DateSchedule()
           
 
Method Summary
 java.util.Date getEndDate(ScheduleContext context)
          Return the end date.
 java.lang.String getFrom()
          Get the from Date as a String.
 java.util.Date getStartDate(ScheduleContext context)
          Return the start date.
 java.lang.String getTo()
          Return the to date as a string.
 Interval nextDue(ScheduleContext context)
          For a given date a schedule will provide the interval this schedule should next be scheduled in.
 void setFrom(java.lang.String startDateString)
           
 void setOn(java.lang.String on)
           
 void setTo(java.lang.String endDateString)
           
 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

DateSchedule

public DateSchedule()
Method Detail

setFrom

public void setFrom(java.lang.String startDateString)
Oddjob Property:
from
Description:
The from date for the schedule. Defaults to the the 1st January 1970.
Required:
No.
Parameters:
startDateString - The from date. May be null which indicates the beginning of the time.
Throws:
java.text.ParseException - If the String isn't a Date.

getFrom

public java.lang.String getFrom()
Get the from Date as a String.

Returns:
The from date. May be null.

setTo

public void setTo(java.lang.String endDateString)
Oddjob Property:
to
Description:
The to date for the schedule. Defaults to the end of time.
Required:
No.
Parameters:
endDateString - The end date. May be null.
Throws:
java.text.ParseException - If the string isn't a valid date.

getTo

public java.lang.String getTo()
Return the to date as a string.

Returns:
The to date, may be null.

setOn

public void setOn(java.lang.String on)
Oddjob Property:
on
Description:
A specific date on which to schedule something.
Required:
No.
Throws:
java.text.ParseException - If the string isn't a date.

getStartDate

public java.util.Date getStartDate(ScheduleContext context)
Return the start date.

Returns:
The start date.

getEndDate

public java.util.Date getEndDate(ScheduleContext context)
Return the end date.

Returns:
The end 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.

Specified by:
nextDue in interface Schedule
Returns:
The next due interval for the schedule.

toString

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