com.indexdata.utils
public class CronLine extends Object
Modifier and Type | Field and Description |
---|---|
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 and Description |
---|
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
|
Modifier and Type | Method and Description |
---|---|
static CronLine |
createCronLine(Calendar cal) |
static CronLine |
currentCronLine()
Return a cron line that corresponds to value date and time.
|
String |
get(int field)
Returns value of a given cron field.
|
boolean |
matches(CronLine pattern)
Matches this cron line against the parameter and returns true if the param
is more general (contains wildcards) or equal.
|
Date |
nextMatchingDate(Date date) |
Date |
nextMatchingDateOld(Date offsetDate)
Deprecated.
|
int |
shortestPeriod()
Checks the shortest period of the cron line.
|
Date |
toDate()
Converts cron entry to date;
|
String |
toString() |
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
public CronLine(String line) throws CronLineParseException
line
- For example: "55 23 * * 1" which means every Tuesday 23:55CronLineParseException
public boolean matches(CronLine pattern)
pattern
- pattern to match againstpublic static CronLine currentCronLine()
CronLineParseException
public int shortestPeriod()
public String get(int field)
field
- cron field numberpublic Date toDate()
cronLine
- @Deprecated public Date nextMatchingDateOld(Date offsetDate) throws CronLineParseException
CronLineParseException
public Date nextMatchingDate(Date date) throws CronLineParseException
CronLineParseException
Copyright © 2014. All rights reserved.