public class RecurrenceRuleCache
extends java.lang.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.
Modifier and Type | Field and Description |
---|---|
int |
cacheEnd |
int |
cacheStart |
java.time.temporal.Temporal[] |
temporalCache |
Constructor and Description |
---|
RecurrenceRuleCache(VRepeatable<?> component) |
Modifier and Type | Method and Description |
---|---|
java.time.temporal.Temporal |
getClosestStart(java.time.temporal.Temporal targetStart)
Returns the previous start date/time value of the recurrence set on or before targetStart in the cache.
|
java.util.stream.Stream<java.time.temporal.Temporal> |
makeCache(java.util.stream.Stream<java.time.temporal.Temporal> inStream)
add to cache while streaming recurrences
|
java.time.temporal.Temporal |
previousValue(java.time.temporal.Temporal value)
finds previous value in recurrence set before input parameter value
|
public java.time.temporal.Temporal[] temporalCache
public int cacheStart
public int cacheEnd
public RecurrenceRuleCache(VRepeatable<?> component)
public java.time.temporal.Temporal previousValue(java.time.temporal.Temporal value)
finds previous value in recurrence set before input parameter value
value
- - start valuepublic java.time.temporal.Temporal getClosestStart(java.time.temporal.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.
targetStart
- - target date/time to get previous recurrence.public java.util.stream.Stream<java.time.temporal.Temporal> makeCache(java.util.stream.Stream<java.time.temporal.Temporal> inStream)
add to cache while streaming recurrences