public final class CronTab extends Object
| Constructor and Description |
|---|
CronTab(String format) |
CronTab(String format,
Hash hash) |
CronTab(String format,
int line)
Deprecated.
as of 1.448
Use
CronTab(String, int, Hash) |
CronTab(String format,
int line,
Hash hash) |
CronTab(String format,
int line,
Hash hash,
String timezone) |
| Modifier and Type | Method and Description |
|---|---|
Calendar |
ceil(Calendar cal)
See
ceil(long). |
Calendar |
ceil(long t)
Computes the nearest future timestamp that matches this cron tab.
|
String |
checkSanity()
Checks if this crontab entry looks reasonable,
and if not, return an warning message.
|
Calendar |
floor(Calendar cal)
See
floor(long)
This method modifies the given calendar and returns the same object. |
Calendar |
floor(long t)
Computes the nearest past timestamp that matched this cron tab.
|
static String |
hashify(String spec)
Checks a prospective crontab specification to see if it could benefit from balanced hashes.
|
String |
toString() |
public CronTab(String format) throws antlr.ANTLRException
antlr.ANTLRExceptionpublic CronTab(String format, Hash hash) throws antlr.ANTLRException
antlr.ANTLRException@Deprecated public CronTab(String format, int line) throws antlr.ANTLRException
CronTab(String, int, Hash)antlr.ANTLRExceptionpublic CronTab(String format, int line, Hash hash) throws antlr.ANTLRException
hash - Used to spread out token like "@daily". Null to preserve the legacy behaviour
of not spreading it out at all.antlr.ANTLRExceptionpublic CronTab(String format, int line, Hash hash, @CheckForNull String timezone) throws antlr.ANTLRException
timezone - Used to schedule cron in a different timezone. Null to use the default system
timezoneantlr.ANTLRExceptionpublic Calendar ceil(long t)
More precisely, given the time 't', computes another smallest time x such that:
Note that if t already matches this cron, it's returned as is.
public Calendar ceil(Calendar cal)
ceil(long).
This method modifies the given calendar and returns the same object.public Calendar floor(long t)
More precisely, given the time 't', computes another smallest time x such that:
Note that if t already matches this cron, it's returned as is.
public Calendar floor(Calendar cal)
floor(long)
This method modifies the given calendar and returns the same object.@CheckForNull public String checkSanity()
The point of this method is to catch syntactically correct but semantically suspicious combinations, like "* 0 * * *"
@CheckForNull public static String hashify(String spec)
spec - a (legal) specCopyright © 2019. All rights reserved.