|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectedu.sdsc.inca.util.CronSchedule
public class CronSchedule
A class that represents a cron schedule: an event schedule that allows for execution based on some combination of minute, hour, day of month, month, and day of week. See crontab(5).
| Constructor Summary | |
|---|---|
CronSchedule()
|
|
CronSchedule(java.lang.String min,
java.lang.String hour,
java.lang.String mday,
java.lang.String month,
java.lang.String wday)
|
|
| Method Summary | |
|---|---|
java.lang.String |
getHour()
Returns the hour field of the schedule. |
java.lang.String |
getMday()
Returns the day of month field of the schedule. |
int |
getMinimum(int target,
java.lang.String spec,
int lowest,
int highest)
Given a cron field spec, a target integer, and a range, returns the lowest integer w/in the range, equal or greater to the target, that is included in the list of values specified by the field spec. |
java.lang.String |
getMinute()
Returns the minute field of the schedule. |
java.lang.String |
getMonth()
Returns the month field of the schedule. |
java.lang.String |
getWday()
Returns the day of week field of the schedule. |
java.util.Date |
nextEvent()
Returns the next date/time that this schedule will cause an event. |
java.util.Date |
nextEvent(java.util.Date d)
Returns the next date/time after a specified date/time that this schedule will cause an event. |
static CronSchedule |
parse(java.lang.String spec)
A factory method that returns the CronSchedule corresponding to a cron spec. |
static CronSchedule |
parseWHM(java.lang.String whm)
A factory method that returns the CronSchedule corresponding to a cron spec w/an alternate format. |
void |
setHour(java.lang.String hour)
Sets the hour field of the schedule. |
void |
setMday(java.lang.String mday)
Sets the day of month field of the schedule. |
void |
setMinute(java.lang.String minute)
Sets the minute field of the schedule. |
void |
setMonth(java.lang.String month)
Sets the month field of the schedule. |
void |
setWday(java.lang.String wday)
Sets the day of week field of the schedule. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public CronSchedule()
public CronSchedule(java.lang.String min,
java.lang.String hour,
java.lang.String mday,
java.lang.String month,
java.lang.String wday)
| Method Detail |
|---|
public java.lang.String getHour()
public java.lang.String getMday()
public java.lang.String getMinute()
public java.lang.String getMonth()
public java.lang.String getWday()
public void setHour(java.lang.String hour)
hour - the hour field of the schedulepublic void setMday(java.lang.String mday)
mday - the day of month field of the schedulepublic void setMinute(java.lang.String minute)
minute - the minute field of the schedulepublic void setMonth(java.lang.String month)
month - the month field of the schedulepublic void setWday(java.lang.String wday)
wday - the day of week field of the schedulepublic java.util.Date nextEvent()
public java.util.Date nextEvent(java.util.Date d)
d - a date/time preceding the returned value
public int getMinimum(int target,
java.lang.String spec,
int lowest,
int highest)
target - the target integerspec - cron field spec, format [0-9]+(-[0-9]+)?(,...)*(/[0-9]+)?
(one or more values/ranges with an optional step)lowest - the range low bound, inclusivehighest - the range high bound, inclusive
public static CronSchedule parse(java.lang.String spec)
throws java.text.ParseException
spec - the cron spec: min hour mday month wday
ParseError - on a bad spec
java.text.ParseException
public static CronSchedule parseWHM(java.lang.String whm)
throws java.text.ParseException
spec - the cron spec: [[wday:]hour:]minute
unspecified fields are equivalent to "*"
ParseError - on a bad spec
java.text.ParseException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||