java.lang.Object
com.aoapps.cron.MatcherSchedule
- All Implemented Interfaces:
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:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionNote: Sunday is 0, not 1 like Calendar.getHour()
getMonth()
Note: months are 1-12 like cron, not 0-11 like Calendar.boolean
isScheduled
(int minute, int hour, int dayOfMonth, int month, int dayOfWeek, int year) Determine if the job should run right now.static Schedule
parseSchedule
(String str) Parses an entire schedule.toString()
-
Constructor Details
-
Method Details
-
parseSchedule
Parses an entire schedule.- Throws:
IllegalArgumentException
-
toString
-
getMinute
-
getHour
-
getDayOfMonth
-
getMonth
Note: months are 1-12 like cron, not 0-11 like Calendar. -
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:Schedule
Determine if the job should run right now.- Specified by:
isScheduled
in interfaceSchedule
- Parameters:
minute
- 0-59hour
- 0-23dayOfMonth
- 1-31month
- 0-11dayOfWeek
- 1-7,Calendar.SUNDAY
throughCalendar.SATURDAY
-