| |
|
| java.lang.Object com.opensymphony.oscache.util.FastCronParser
FastCronParser | public class FastCronParser (Code) | | Parses cron expressions and determines at what time in the past is the
most recent match for the supplied expression.
author: Chris Miller author: $Author: ltorunski $ version: $Revision: 340 $ |
Constructor Summary | |
public | FastCronParser() Creates a FastCronParser that uses a default cron expression of "* * * * *". | public | FastCronParser(String cronExpression) Constructs a new FastCronParser based on the supplied expression. |
Method Summary | |
public String | getCronExpression() Retrieves the current cron expression. | public String | getExpressionSummary() Recreates the original human-readable cron expression based on the internal
datastructure values. | public long | getTimeBefore(long time) Find the most recent time that matches this cron expression. | public boolean | hasMoreRecentMatch(long time) Determines whether this cron expression matches a date/time that is more recent
than the one supplied.
Parameters: time - The time to compare the cron expression against. | public void | setCronExpression(String cronExpression) Resets the cron expression to the value supplied. |
FastCronParser | public FastCronParser()(Code) | | Creates a FastCronParser that uses a default cron expression of "* * * * *".
This will match any time that is supplied.
|
FastCronParser | public FastCronParser(String cronExpression) throws ParseException(Code) | | Constructs a new FastCronParser based on the supplied expression.
throws: ParseException - if the supplied expression is not a valid cron expression. |
getCronExpression | public String getCronExpression()(Code) | | Retrieves the current cron expression.
the current cron expression. |
getExpressionSummary | public String getExpressionSummary()(Code) | | Recreates the original human-readable cron expression based on the internal
datastructure values.
A cron expression that corresponds to the current state of theinternal data structure. |
getTimeBefore | public long getTimeBefore(long time)(Code) | | Find the most recent time that matches this cron expression. This time will
always be in the past, ie a lower value than the supplied time.
Parameters: time - The time (in milliseconds) that we're using as our upper bound. The time (in milliseconds) when this cron event last occurred. |
hasMoreRecentMatch | public boolean hasMoreRecentMatch(long time)(Code) | | Determines whether this cron expression matches a date/time that is more recent
than the one supplied.
Parameters: time - The time to compare the cron expression against. true if the cron expression matches a time that is closerto the current time than the supplied time is, false otherwise. |
setCronExpression | public void setCronExpression(String cronExpression) throws ParseException(Code) | | Resets the cron expression to the value supplied.
Parameters: cronExpression - the new cron expression. throws: ParseException - if the supplied expression is not a valid cron expression. |
|
|
|