|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.webmethods.caf.faces.data.object.Schedule
public class Schedule
Schedule that encapsulates an interval of time, plus an optional relative starting date (the "at" property). For example, to create a schedule that repeats every 5 days, set the interval property to "5D" and don't set the at property. To create a schedule that repeats at 12:30 AM every 5 days, set the interval property to "5D" and the at property to "00:30".
When storing a schedule for repeated execution,
you'd usually store the interval and the previous/next date of execution.
To calculate the next date on the schedule at a later time,
restore the interval as a DateFields
object,
and invoke DateFields#addToDate
with the previous date,
looping until the resulting date is greater than the current date
(in case you missed some dates on the schedule
between the date stored and the current date).
Field Summary | |
---|---|
protected DateFields |
m_at
Relative starting date for the interval. |
protected DateFields |
m_interval
Interval at which schedule repeats. |
Constructor Summary | |
---|---|
Schedule()
New schedule with no interval or relative start. |
|
Schedule(DateFields interval)
New schedule with an interval and no relative start. |
|
Schedule(DateFields interval,
DateFields at)
New schedule with an interval and a relative start. |
Method Summary | |
---|---|
DateFields |
getAt()
Relative starting date for the interval. |
DateFields |
getInterval()
Interval at which schedule repeats. |
Date |
nextDate(Date d)
Calculates the next date on the schedule, relative to the specified date. |
Date |
previousDate(Date d)
Calculates the previous date on the schedule, relative to the specified date. |
void |
setAt(DateFields at)
Relative starting date for the interval. |
void |
setInterval(DateFields interval)
Interval at which schedule repeats. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected DateFields m_at
Schedule.nextDate(java.util.Date)
and Schedule.previousDate(java.util.Date)
may produce inconsistent results.
protected DateFields m_interval
Constructor Detail |
---|
public Schedule()
Schedule.nextDate(java.util.Date)
or the #prevDate
.
public Schedule(DateFields interval)
public Schedule(DateFields interval, DateFields at)
Method Detail |
---|
public Date nextDate(Date d)
d
- Current date.
public Date previousDate(Date d)
d
- Current date.
public DateFields getAt()
Schedule.nextDate(java.util.Date)
and Schedule.previousDate(java.util.Date)
may produce inconsistent results.
public void setAt(DateFields at)
Schedule.nextDate(java.util.Date)
and Schedule.previousDate(java.util.Date)
may produce inconsistent results.
param at Relative starting date for the interval.
public DateFields getInterval()
public void setInterval(DateFields interval)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |