|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.indexdata.utils.CronLine
public class CronLine
A CronLine is an internal representation of the time specification as used by cron. It consists of 5 fields: min, hr, mday, month, wday. Each of these is a simple numerical String (but that can be changed later, if we ever want to implement advanced features like 14,45 or 2/5).
Field Summary | |
---|---|
static int |
DAILY_PERIOD
|
static int |
DAY_OF_MONTH
|
static int |
DAY_OF_WEEK
|
static int |
HOUR
|
static int |
MINUTE
|
static int |
MONTH
|
static int |
MONTHLY_PERIOD
|
static int |
WEEKLY_PERIOD
|
static int |
YEARLY_PERIOD
|
Constructor Summary | |
---|---|
CronLine(String line)
Constructs a CronLine from a string representation of following format: "%d %d %d %d %d" applied to minute, hour, day-of-month, month, day-of-week |
Method Summary | |
---|---|
static CronLine |
createCronLine(Calendar cal)
|
static CronLine |
currentCronLine()
Return a cron line that corresponds to current date and time. |
String |
get(int field)
Returns value of a given cron field. |
boolean |
matches(CronLine pattern)
Matches this cron line againts the parameter and returns true if the param is more general (contains wildcards) or equal. |
Date |
nextMatchingDate(Date offsetDate)
Finds the next day that matches this CronLine, ignoring the time of day (hr,min,seconds,millis) |
int |
shortestPeriod()
Checks the shortest period of the cron line. |
Date |
toDate()
Converts cron entry to date; |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int MINUTE
public static final int HOUR
public static final int DAY_OF_MONTH
public static final int MONTH
public static final int DAY_OF_WEEK
public static final int DAILY_PERIOD
public static final int WEEKLY_PERIOD
public static final int MONTHLY_PERIOD
public static final int YEARLY_PERIOD
Constructor Detail |
---|
public CronLine(String line)
line
- For example: "55 23 * * 1" which means every Tuesday 23:55Method Detail |
---|
public boolean matches(CronLine pattern)
pattern
- pattern to match against
public static CronLine currentCronLine()
public static CronLine createCronLine(Calendar cal)
public String toString()
toString
in class Object
public int shortestPeriod()
public String get(int field)
field
- cron field number
public Date toDate()
cronLine
-
public Date nextMatchingDate(Date offsetDate) throws CronLineParseException
offsetDate
- The point in time from which the search for a matching date should start
CronLineParseException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |