Package com.aoindustries.util.schedule
Class Recurring
- java.lang.Object
-
- com.aoindustries.util.schedule.Recurring
-
- Direct Known Subclasses:
Recurring.DayOfWeekList,Recurring.Every,Recurring.MonthList
public abstract class Recurring extends Object
- Author:
- AO Industries, Inc.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classRecurring.DayOfWeekListstatic classRecurring.Everystatic classRecurring.MonthList
-
Constructor Summary
Constructors Constructor Description Recurring()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description StringcheckScheduleFrom(Calendar from, String attribute)Checks if the schedule can start on the given day.abstract booleanequals(Object o)Recurring schedules are equal when they have both the same type and schedule.abstract StringgetRecurringDisplay()abstract Iterator<Calendar>getScheduleIterator(Calendar from)Gets an iterator over dates in the YYYY-MM-DD format.abstract inthashCode()static Recurringparse(String recurring)Parses a human-readable representation of a recurring schedule.
-
-
-
Method Detail
-
parse
public static Recurring parse(String recurring) throws IllegalArgumentException
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 Monday, Wednesday, Friday". Example: "On mon, tue, Sat".
- "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 ### {days|weeks|months|years}" - 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.
- Parameters:
recurring- when null, returns null- Throws:
IllegalArgumentException- if unable to parse recurring
-
equals
public abstract boolean equals(Object o)
Recurring schedules are equal when they have both the same type and schedule.
-
getRecurringDisplay
public abstract String getRecurringDisplay()
-
checkScheduleFrom
public String checkScheduleFrom(Calendar from, String attribute)
Checks if the schedule can start on the given day. Returns null if OK or a string reason of why not OK.
-
-