com.miginfocom.calendar.activity.recurrence
Interface Recurrence

All Known Implementing Classes:
CompositeRecurrence, RecurrenceRule

public interface Recurrence

A recurring event of some kind.


Method Summary
 java.util.ArrayList getDateRanges(DateRangeI baseRange, DateRangeI withinRange, boolean optimizeRange)
          Returns the recurrence date ranges that has its start date within withinRange.
 java.lang.Long getLastRecurrenceMillis(DateRangeI baseRange, java.util.Calendar max)
          Returns the end date (millisecond inclusive) of the last recurrence or null if the recurrence will continue forever.
 boolean isRepeatingForever()
          Returns if this recurrence has no end limit and will thus be repeating forever.
 

Method Detail

getDateRanges

java.util.ArrayList getDateRanges(DateRangeI baseRange,
                                  DateRangeI withinRange,
                                  boolean optimizeRange)
Returns the recurrence date ranges that has its start date within withinRange. baseRange will be part of the returned list unless excluded by any of the contained excluding rules or not within withinRange.

Parameters:
baseRange - The range on which to base the returned ranges. Called DTSTART/DTEND in RFC 2445 (iCalendar). This is the first dateRange in the recurrence.
withinRange - All returned ranges will have touch this range. Never null.
optimizeRange - Optimizes the recurrence rule for withinRange. Set to false if the recurrence is bugging. This is working in the tests but the algorithm is quite advanced and is a bit hard to find all possibilities for how this optimization works. Note that this value should not in any way change the returned values, it will only use less computations if set to true.
Returns:
The recurrence date ranges. Never null. The list will not be sorted. Will contain newly created and free to use MutableDateRanges

getLastRecurrenceMillis

java.lang.Long getLastRecurrenceMillis(DateRangeI baseRange,
                                       java.util.Calendar max)
Returns the end date (millisecond inclusive) of the last recurrence or null if the recurrence will continue forever.

Parameters:
baseRange - The range on which to base the recurrence on ranges. Called DTSTART/DTEND in RFC 2445 (iCalendar)
max - If not null the evaluation will never go after this date and this will thus be the latest date possible to return. Since the recurrences have to be evaluated in all to return the last recurrence this can be a safetynet to not make the evaluation take too much time.
Returns:
The end date (millisecond inclusive) of the last recurrence or null if the recurrence will continue forever.

isRepeatingForever

boolean isRepeatingForever()
Returns if this recurrence has no end limit and will thus be repeating forever.

Returns:
If this recurrence has no end limit and will thus be repeating forever.


Copyright © 2009 MiG InfoCom AB. All Rights Reserved.