Class ICal4JCalendarEventOccurrenceGenerator

    • Constructor Detail

    • 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 interface CalendarEventOccurrenceGenerator
        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 interface CalendarEventOccurrenceGenerator
        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 interface CalendarEventOccurrenceGenerator
        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.