Class ICal4JCalendarEventOccurrenceGenerator
- java.lang.Object
-
- org.silverpeas.core.calendar.ical4j.ICal4JCalendarEventOccurrenceGenerator
-
- All Implemented Interfaces:
CalendarEventOccurrenceGenerator
@Technical @Bean public class ICal4JCalendarEventOccurrenceGenerator extends Object implements CalendarEventOccurrenceGenerator
An implementation of theCalendarEventOccurrenceGenerator
by using the iCal4J library.- Author:
- mmoquillon
-
-
Constructor Summary
Constructors Constructor Description ICal4JCalendarEventOccurrenceGenerator(ICal4JDateCodec iCal4JDateCodec, ICal4JRecurrenceCodec iCal4JRecurrenceCodec)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description long
countOccurrencesOf(CalendarEvent event, Period inPeriod)
Counts the number of occurrences of the specified event in the given period.CalendarEventOccurrence
generateNextOccurrenceOf(CalendarEvent event, ZonedDateTime since)
Generates the next occurrence of the specified event since the given date time.List<CalendarEventOccurrence>
generateOccurrencesOf(List<CalendarEvent> events, Period inPeriod)
Generates the actual occurrences of the specified events and that occur in the period of time.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.silverpeas.core.calendar.CalendarEventOccurrenceGenerator
generateOccurrencesIn
-
-
-
-
Constructor Detail
-
ICal4JCalendarEventOccurrenceGenerator
@Inject public ICal4JCalendarEventOccurrenceGenerator(ICal4JDateCodec iCal4JDateCodec, ICal4JRecurrenceCodec iCal4JRecurrenceCodec)
-
-
Method Detail
-
generateOccurrencesOf
public List<CalendarEventOccurrence> generateOccurrencesOf(List<CalendarEvent> events, Period inPeriod)
Description copied from interface:CalendarEventOccurrenceGenerator
Generates the actual occurrences of the specified events and that occur in the period of time. The occurrences are computed from the recurrence rule of the specified events, from the date and times at which the events start, and for the specified period of time. This method require to be implemented.- Specified by:
generateOccurrencesOf
in interfaceCalendarEventOccurrenceGenerator
- Parameters:
events
- the events.inPeriod
- the period of time the instances of the events occur.- Returns:
- a set of event occurrences that occur in the specified period sorted by the date and time at which they start.
-
countOccurrencesOf
public long countOccurrencesOf(CalendarEvent event, Period inPeriod)
Description copied from interface:CalendarEventOccurrenceGenerator
Counts the number of occurrences of the specified event in the given period. If the period is null, then the period over which the event recurs is taken into account. This method is a faster way to compute the occurrence count of an event by considering only its recurrence rule and by not generating any occurrences.- Specified by:
countOccurrencesOf
in interfaceCalendarEventOccurrenceGenerator
- Parameters:
event
- an event.inPeriod
- the period of time the instances of the events occur. It can be null, in this case the recurrence period is taken in the computation.- Returns:
- the number of occurrences of the event occurring in the specified period or -1 if
the event isn't yet planned or
Long.MAX_VALUE
if there an unlimited number of occurrences (endless recurrence).
-
generateNextOccurrenceOf
public CalendarEventOccurrence generateNextOccurrenceOf(CalendarEvent event, ZonedDateTime since)
Description copied from interface:CalendarEventOccurrenceGenerator
Generates the next occurrence of the specified event since the given date time. The next occurrence is computed from the recurrence rule of the specified event, from the date and times at which the events start, from the specified date, and from recurrence exceptions. This method requires to be implemented.- Specified by:
generateNextOccurrenceOf
in interfaceCalendarEventOccurrenceGenerator
- Parameters:
event
- an event.since
- the date time since which the next occurrence must be computed. No occurrence occurring at this exact given date time (with a precision of one minute) isn't taken into account.- Returns:
- the next occurrence of the given event, null if not
CalendarEventOccurrence
can be computed.
-
-