|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.treesched.AbstractSchedule
org.treesched.schedules.DateSchedule
Provide a schedule for a specific date or between two dates.
Allowed attributes:
| format | The date format to use to parse the other attributes. | Optional |
| from | The from date for the schedule. Defaults to the the 0 java date. | Optional |
| to | The to date for the schedule. Defaults to the max java date. | Optional |
| on | A specific date on which to provide the schedule. | Optional |
Any number of nested sub schedules are allowed.
typical configuration is:
<date on="25-dec-04"/>
| Field Summary | |
static java.lang.String |
DEFAULT_DATE_FORMAT
|
| Constructor Summary | |
DateSchedule()
|
|
| Method Summary | |
java.util.Date |
getEndDate(java.util.Date now)
Return the end date. |
java.lang.String |
getFormat()
Get the date format used for translating string attributes. |
java.lang.String |
getFrom()
Get the from Date as a String. |
java.util.Date |
getStartDate(java.util.Date now)
Return the start date. |
java.lang.String |
getTo()
Return the to date as a string. |
Interval |
nextDue(java.util.Date now)
For a given date a schedule will provide the interval this schedule should next be scheduled in. |
void |
setFormat(java.lang.String dateFormat)
Set the date format to use for translating string attributes. |
void |
setFrom(java.lang.String startDateString)
Set the from date as a String. |
void |
setOn(java.lang.String on)
Set the on date as a string. |
void |
setTo(java.lang.String endDateString)
Set the end date as a String. |
java.lang.String |
toString()
Override toString. |
| Methods inherited from class org.treesched.AbstractSchedule |
addChildSchedule, getChildSchedule, getLimits, reset, setChildSchedule, setLimits |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
public static final java.lang.String DEFAULT_DATE_FORMAT
| Constructor Detail |
public DateSchedule()
| Method Detail |
public void setFormat(java.lang.String dateFormat)
dateFormat - The date format.public java.lang.String getFormat()
public void setFrom(java.lang.String startDateString)
throws java.text.ParseException
startDateString - The from date. May be null which
indicates the beginning of the time.
java.text.ParseException - If the String isn't a Date.public java.lang.String getFrom()
public void setTo(java.lang.String endDateString)
throws java.text.ParseException
endDateString - The end date. May be null.
java.text.ParseException - If the string isn't a valid date.public java.lang.String getTo()
public void setOn(java.lang.String on)
throws java.text.ParseException
java.text.ParseException - If the string isn't a date.public java.util.Date getStartDate(java.util.Date now)
public java.util.Date getEndDate(java.util.Date now)
public Interval nextDue(java.util.Date now)
ScheduleIf the schedule is never due again for the given date, null is returned.
nextDue in interface Schedulenow - The date now.
public java.lang.String toString()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||