java.lang.Object
com.aoapps.hodgepodge.schedule.Recurring
- Direct Known Subclasses:
Recurring.DayOfWeekList
,Recurring.Every
,Recurring.EveryByDayOfWeek
,Recurring.EveryByMonth
,Recurring.MonthList
- Author:
- AO Industries, Inc.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
static class
static class
static class
static class
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptioncheckScheduleFrom
(Calendar from, String attribute) Checks if the schedule can start on the given day.abstract boolean
Recurring schedules are equal when they have both the same type and schedule.abstract String
getScheduleIterator
(Calendar from) Gets an iterator over dates in the YYYY-MM-DD format.abstract int
hashCode()
static Recurring
Parses a human-readable representation of a recurring schedule.
-
Field Details
-
EVERYDAY
-
WEEKDAYS
-
WEEKLY
-
MONTHLY
-
YEARLY
-
-
Constructor Details
-
Recurring
public Recurring()
-
-
Method Details
-
parse
Parses a human-readable representation of a recurring schedule. All parsing case-insensitive. Supported values are:- "everyday" - Task must be done every day
- "weekdays" - Monday through Friday (no holidays scheduled - yet)
- "on day-of-week-list" - on a comma-separated list of days of the week. The day of the week for the "on" date must be in this list. Example: "on Mondays, Wednesdays, Fridays". Example: "on Monday, Wednesday, Friday". Example: "On mon, tue, Sat". Example: "on Mondays, Wednesday, Fri".
- "weekly" - recurring on the same day every week.
- "monthly" - recurring on the same day every month. If the day is past the last day of the month, the last day of the month is used.
- "yearly" - recurring on the same day every year. If the day is past the last day of the month for a given year, the last day of the month is used. (Only affects February 29th)
- "every (other|second|third|fourth|fifth|sixth|seventh|eighth|ninth|tenth|eleventh|twelfth|###) {days|weeks|months|years|day-of-week|month-of-year}" - recurring every unit days. For "months", if the day is past the last day of the month, the last day of the month is used. For "day-of-week", is named day such as "every other Friday" or "every 4 Mondays". For "month-of-year", is named month such as "every other March" or "every 3 Januaries".
- Parameters:
recurring
- when null, returns null- Throws:
IllegalArgumentException
- if unable to parse recurring
-
equals
Recurring schedules are equal when they have both the same type and schedule. -
hashCode
public abstract int hashCode() -
getRecurringDisplay
-
checkScheduleFrom
Checks if the schedule can start on the given day. Returns null if OK or a string reason of why not OK. -
getScheduleIterator
Gets an iterator over dates in the YYYY-MM-DD format. The iteration starts at the given date.
-