Class RecurrenceRuleCache

java.lang.Object
jfxtras.icalendarfx.properties.component.recurrence.RecurrenceRuleCache

public class RecurrenceRuleCache extends Object
Handles caching an array of Temporal date/time values to speed up producing a stream of recurrence instances for a recurrence rule (RRULE). RFC 5545 3.8.5.2, page 121 The recurrence set is the complete set of recurrence instances for a calendar component.
Author:
David Bal
  • Field Details

    • temporalCache

      public Temporal[] temporalCache
    • cacheStart

      public int cacheStart
    • cacheEnd

      public int cacheEnd
  • Constructor Details

    • RecurrenceRuleCache

      public RecurrenceRuleCache(VRepeatable<?> component)
  • Method Details

    • previousValue

      public Temporal previousValue(Temporal value)
      finds previous value in recurrence set before input parameter value
      Parameters:
      value - - start value
      Returns:
      - previous recurrence instance
    • getClosestStart

      public Temporal getClosestStart(Temporal targetStart)
      Returns the previous start date/time value of the recurrence set on or before targetStart in the cache. If no value is present in the cache then the DTSTART value is returned. This value is guaranteed to be a valid recurrence date/time. It can be used as a starting point for calculating future recurrences more efficiently than using DTSTART.
      Parameters:
      targetStart - - target date/time to get previous recurrence.
      Returns:
      closest recurrence DTSTART value, without going over.
    • makeCache

      public Stream<Temporal> makeCache(Stream<Temporal> inStream)
      add to cache while streaming recurrences