|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.novell.nds.dirxml.util.CronSchedule.Field
public abstract static class CronSchedule.Field
Class representing one field of a crontab schedule specification. The
concrete instantiations for Field represent the following
5 crontab fields:
| Field | minimum | maximum |
|---|---|---|
| Minute | 0 | 59 |
| Hour | 0 | 23 |
| Day of the month | 1 | 31 |
| Month of the year | 1 | 12 |
| Day of the week | 0 | 6 |
| Method Summary | |
|---|---|
void |
addScheduleRange(int start,
int end)
Add a range of scheduled values to those values already scheduled. |
void |
addScheduleValue(int value)
Add a single value to those already scheduled. |
void |
addScheduleValues(int[] values)
Add several values to be scheduled to those already scheduled. |
boolean |
allScheduled()
Return true if all in-range values for this field
are scheduled. |
int |
getMax()
Return the maximum allowable value for field. |
int |
getMaxScheduled()
Return the maximum in-range value that is scheduled by this Field instance. |
int |
getMin()
Return the minimum allowable value for field. |
int |
getMinScheduled()
Return the minimum in-range value that is scheduled by this Field instance. |
Iterator |
getScheduledValues()
Return an Iterator that will iterate over all scheduled
values in this Field instance. |
boolean |
inRange(int checkValue)
Return true if the passed value falls in the allowable range
for this field. |
abstract boolean |
isScheduled(Calendar time)
Return true if that part of date/time represented by the passed Calendar
instance corresponding to this Field is scheduled. |
boolean |
isScheduled(int checkValue)
Return true if the passed value is in the scheduled specification
for this Field instance. |
void |
parse(String spec)
|
void |
reset()
Reset this Field to the equivalent of "*". |
void |
setScheduleRange(int start,
int end)
Set a range of scheduled values. |
void |
setScheduleValue(int value)
Set a single value to be scheduled. |
void |
setScheduleValues(int[] values)
Set several values to be scheduled. |
String |
toString()
Return the String representation for this Field instance. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Method Detail |
|---|
public int getMin()
public int getMax()
public String toString()
String representation for this Field instance.
Examples:
toString in class ObjectString representation
public void parse(String spec)
throws CronSchedule.SpecException
CronSchedule.SpecExceptionpublic void reset()
Field to the equivalent of "*".
Note that this means all in-range values are scheduled, not that
no in-range values are scheduled.
public void setScheduleRange(int start,
int end)
throws CronSchedule.SpecException
start - beginning of rangeend - end (inclusive) of range
CronSchedule.SpecException - thrown if start or end are out-of-range.
public void addScheduleRange(int start,
int end)
throws CronSchedule.SpecException
start - beginning of rangeend - end (inclusive) of range
CronSchedule.SpecException - thrown if start or end are out-of-range.
public void setScheduleValue(int value)
throws CronSchedule.SpecException
value - the value to be set
CronSchedule.SpecException - thrown if value is out-of-range.
public void addScheduleValue(int value)
throws CronSchedule.SpecException
value - the value to be set
CronSchedule.SpecException - thrown if value is out-of-range.
public void setScheduleValues(int[] values)
throws CronSchedule.SpecException
values - a non-null array of zero or more values
CronSchedule.SpecException - thrown if any element of values is out-of-range.
public void addScheduleValues(int[] values)
throws CronSchedule.SpecException
values - a non-null array of zero or more values
CronSchedule.SpecException - thrown if any element of values is out-of-range.public boolean allScheduled()
true if all in-range values for this field
are scheduled. Corresponds to a specification of "*" (among other possibilities).
true if all in-range values for this field are scheduled.public boolean inRange(int checkValue)
true if the passed value falls in the allowable range
for this field.
checkValue - value to check
true if passed value is in range.public boolean isScheduled(int checkValue)
true if the passed value is in the scheduled specification
for this Field instance.
Example: For a day-of-the-week specification of "1-5", the passed value
3 will return true.
checkValue - value to check
true if passed value is scheduled by this Field.public abstract boolean isScheduled(Calendar time)
true if that part of date/time represented by the passed Calendar
instance corresponding to this Field is scheduled.
Example: For a day-of-the-week specification of "1-5", the passed value corresponding to
May 30, 2006 10:41 will return true (since May 30, 2006 is a Tuesday).
time - Calendar instance to check.
true if passed value is scheduled by this Field.public int getMinScheduled()
Field instance.
public int getMaxScheduled()
Field instance.
public Iterator getScheduledValues()
Iterator that will iterate over all scheduled
values in this Field instance.
Iterator instance whose next() method
returns Integer objects.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||