public class RecurrenceProcessor extends Object
Modifier and Type | Class and Description |
---|---|
static class |
RecurrenceProcessor.DaySet |
Constructor and Description |
---|
RecurrenceProcessor() |
Modifier and Type | Method and Description |
---|---|
void |
expand(Time dtstart,
EventRecurrence r,
long rangeStartDateValue,
long rangeEndDateValue,
boolean add,
TreeSet<Long> out)
Run the recurrence algorithm.
|
long[] |
expand(Time dtstart,
RecurrenceSet recur,
long rangeStartMillis,
long rangeEndMillis)
Expands the recurrence within the given range using the given dtstart
value.
|
long |
getLastOccurence(Time dtstart,
RecurrenceSet recur)
Returns the time (millis since epoch) of the last occurrence,
or -1 if the event repeats forever.
|
long |
getLastOccurence(Time dtstart,
Time maxtime,
RecurrenceSet recur)
Returns the time (millis since epoch) of the last occurrence,
or -1 if the event repeats forever.
|
public long getLastOccurence(Time dtstart, RecurrenceSet recur) throws DateException
dtstart
- the time of the first occurrencerecur
- the recurrenceDateException
public long getLastOccurence(Time dtstart, Time maxtime, RecurrenceSet recur) throws DateException
dtstart
- the time of the first occurrencemaxtime
- the max possible time of the last occurrence. null means no limitrecur
- the recurrenceDateException
public long[] expand(Time dtstart, RecurrenceSet recur, long rangeStartMillis, long rangeEndMillis) throws DateException
dtstart
- a Time object representing the first occurrencerecur
- the recurrence rules, including RRULE, RDATES, EXRULE, and
EXDATESrangeStartMillis
- the beginning of the range to expand, in UTC
millisecondsrangeEndMillis
- the non-inclusive end of the range to expand, in
UTC milliseconds; use -1 for the entire range.DateException
TimeFormatException
- if recur cannot be parsedpublic void expand(Time dtstart, EventRecurrence r, long rangeStartDateValue, long rangeEndDateValue, boolean add, TreeSet<Long> out) throws DateException
dtstart
- the dtstart date as defined in RFC2445. This
Time
should be in the timezone of the event.r
- the parsed recurrence, as defiend in RFC2445rangeStartDateValue
- the first date-time you care about, inclusiverangeEndDateValue
- the last date-time you care about, not inclusive (so
if you care about everything up through and including
Dec 22 1995, set last to Dec 23, 1995 00:00:00add
- Whether or not we should add to out, or remove from out.out
- the TreeSet you'd like to fill with the eventsDateException
TimeFormatException
- if r cannot be parsed.