- java.lang.Object
-
- com.aoapps.cron.MatcherSchedule
-
- All Implemented Interfaces:
Schedule
public class MatcherSchedule extends Object implements Schedule
Parses a cron-like schedule line, including support for lists, steps, ranges, asterisks, names, and special strings. This also extends the syntax to allow multiple cron-like schedules separated by semicolon (;). See man 5 crontab- Author:
- AO Industries, Inc.
- See Also:
CronJob
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description MatchergetDayOfMonth()MatchergetDayOfWeek()Note: Sunday is 0, not 1 like Calendar.MatchergetHour()MatchergetMinute()MatchergetMonth()Note: months are 1-12 like cron, not 0-11 like Calendar.booleanisScheduled(int minute, int hour, int dayOfMonth, int month, int dayOfWeek, int year)Determine if the job should run right now.static ScheduleparseSchedule(String str)Parses an entire schedule.StringtoString()
-
-
-
Method Detail
-
parseSchedule
public static Schedule parseSchedule(String str) throws IllegalArgumentException
Parses an entire schedule.- Throws:
IllegalArgumentException
-
getMinute
public Matcher getMinute()
-
getHour
public Matcher getHour()
-
getDayOfMonth
public Matcher getDayOfMonth()
-
getMonth
public Matcher getMonth()
Note: months are 1-12 like cron, not 0-11 like Calendar.
-
getDayOfWeek
public Matcher getDayOfWeek()
Note: Sunday is 0, not 1 like Calendar.
-
isScheduled
public boolean isScheduled(int minute, int hour, int dayOfMonth, int month, int dayOfWeek, int year)Description copied from interface:ScheduleDetermine if the job should run right now.- Specified by:
isScheduledin interfaceSchedule- Parameters:
minute- 0-59hour- 0-23dayOfMonth- 1-31month- 0-11dayOfWeek- 1-7,Calendar.SUNDAYthroughCalendar.SATURDAY
-
-