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.
  • Field Details

    • CACHE_RANGE

      private static final int CACHE_RANGE
      See Also:
    • CACHE_SKIP

      private static final int CACHE_SKIP
      See Also:
    • skipCounter

      private int skipCounter
    • temporalCache

      public Temporal[] temporalCache
    • dateTimeStartLast

      private Temporal dateTimeStartLast
    • rRuleLast

      private RecurrenceRuleValue rRuleLast
    • cacheStart

      public int cacheStart
    • cacheEnd

      public int cacheEnd
    • component

      private VRepeatable<?> component
  • 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