public final class CronExpression extends Object implements Serializable, Cloneable
| 限定符和类型 | 字段和说明 |
|---|---|
static int |
MAX_YEAR |
| 构造器和说明 |
|---|
CronExpression(CronExpression expression)
Constructs a new
CronExpression as a copy of an existing
instance. |
CronExpression(String cronExpression)
Constructs a new
CronExpression based on the specified
parameter. |
| 限定符和类型 | 方法和说明 |
|---|---|
Object |
clone()
已过时。
|
String |
getCronExpression() |
String |
getExpressionSummary() |
Date |
getFinalFireTime()
NOT YET IMPLEMENTED: Returns the final time that the
CronExpression will match. |
Date |
getNextInvalidTimeAfter(Date date)
Returns the next date/time after the given date/time which does
not satisfy the expression
|
Date |
getNextValidTimeAfter(Date date)
Returns the next date/time after the given date/time which
satisfies the cron expression.
|
Date |
getTimeAfter(Date afterTime) |
Date |
getTimeBefore(Date endTime)
NOT YET IMPLEMENTED: Returns the time before the given time
that the
CronExpression matches. |
TimeZone |
getTimeZone() |
boolean |
isSatisfiedBy(Date date)
Indicates whether the given date satisfies the cron expression.
|
static boolean |
isValidExpression(String cronExpression)
Indicates whether the specified cron expression can be parsed into a
valid cron expression
|
void |
setTimeZone(TimeZone timeZone)
Sets the time zone for which this
CronExpression
will be resolved. |
String |
toString()
Returns the string representation of the
CronExpression |
static void |
validateExpression(String cronExpression) |
public CronExpression(String cronExpression) throws ParseException
CronExpression based on the specified
parameter.cronExpression - String representation of the cron expression the
new object should representParseException - if the string expression cannot be parsed into a valid
CronExpressionpublic CronExpression(CronExpression expression)
CronExpression as a copy of an existing
instance.expression - The existing cron expression to be copiedpublic boolean isSatisfiedBy(Date date)
date - the date to evaluatepublic Date getNextValidTimeAfter(Date date)
date - the date/time at which to begin the search for the next valid
date/timepublic Date getNextInvalidTimeAfter(Date date)
date - the date/time at which to begin the search for the next
invalid date/timepublic TimeZone getTimeZone()
CronExpression
will be resolved.public void setTimeZone(TimeZone timeZone)
CronExpression
will be resolved.timeZone - the timeZonepublic String toString()
CronExpressionpublic static boolean isValidExpression(String cronExpression)
cronExpression - the expression to evaluatepublic static void validateExpression(String cronExpression) throws ParseException
ParseExceptionpublic String getCronExpression()
public String getExpressionSummary()
public Date getTimeBefore(Date endTime)
CronExpression matches.endTime - the endTimeCronExpression matches.public Date getFinalFireTime()
CronExpression will match.CronExpression will match@Deprecated public Object clone()
Copyright © 2015–2016. All rights reserved.