public class CronSequenceGenerator
extends java.lang.Object
The pattern is a list of six single space-separated fields: representing second, minute, hour, day, month, weekday. Month and weekday names can be given as the first three letters of the English names.
Example patterns:
CronTrigger
Constructor and Description |
---|
CronSequenceGenerator(java.lang.String expression)
Construct a
CronSequenceGenerator from the pattern provided,
using the default TimeZone . |
CronSequenceGenerator(java.lang.String expression,
java.util.TimeZone timeZone)
Construct a
CronSequenceGenerator from the pattern provided,
using the specified TimeZone . |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object other) |
int |
hashCode() |
static boolean |
isValidExpression(java.lang.String expression)
Determine whether the specified expression represents a valid cron pattern.
|
java.util.Date |
next(java.util.Date date)
Get the next
Date in the sequence matching the Cron pattern and
after the value provided. |
java.lang.String |
toString() |
public CronSequenceGenerator(java.lang.String expression)
CronSequenceGenerator
from the pattern provided,
using the default TimeZone
.expression
- a space-separated list of time fieldsjava.lang.IllegalArgumentException
- if the pattern cannot be parsedTimeZone.getDefault()
public CronSequenceGenerator(java.lang.String expression, java.util.TimeZone timeZone)
CronSequenceGenerator
from the pattern provided,
using the specified TimeZone
.expression
- a space-separated list of time fieldstimeZone
- the TimeZone to use for generated trigger timesjava.lang.IllegalArgumentException
- if the pattern cannot be parsedpublic java.util.Date next(java.util.Date date)
Date
in the sequence matching the Cron pattern and
after the value provided. The return value will have a whole number of
seconds, and will be after the input value.date
- a seed valuepublic static boolean isValidExpression(java.lang.String expression)
expression
- the expression to evaluatetrue
if the given expression is a valid cron expressionpublic boolean equals(java.lang.Object other)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object