Package org.bedework.convert
Class RecurUtil
java.lang.Object
org.bedework.convert.RecurUtil
Some help with recurrences.
- Version:
- 1.0
- Author:
- Mike Douglass douglm - rpi.edu
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic classstatic class -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic RecurUtil.RecurrencefromRecurrencId(BwEvent master, String recurrenceId) Generate a recurrence instance for the given master event based on the recurrenceId and the date/time info in the master.static RecurUtil.RecurPeriodsgetPeriods(BwEvent ev, int maxYears, int maxInstances) Returns a list of instances for this recurring event possibly bounded by the supplied maximum end date.static RecurUtil.RecurPeriodsgetPeriods(BwEvent ev, int maxYears, int maxInstances, String startRange, String endRange) Returns a list of instances for this recurring event possibly bounded by the supplied maximum end date.static RecurUtil.RecurRangeReturns range of dates for this recurring event possibly bounded by the supplied maximum end date.static Collection<RecurUtil.Recurrence>getRecurrences(EventInfo ei, int maxYears, int maxInstances, String fromDate, String toDate) static booleaninDateTimeRange(String rangeStart, String rangeEnd, String periodStart, String periodEnd) Returns true if the period start and end dates overlap the specified limits.
-
Constructor Details
-
RecurUtil
public RecurUtil()
-
-
Method Details
-
getRange
Returns range of dates for this recurring event possibly bounded by the supplied maximum end date.- Parameters:
ev- the recurring eventmaxYears- Provide an upper limit- Returns:
- the range for this event
-
getPeriods
Returns a list of instances for this recurring event possibly bounded by the supplied maximum end date.This is mostly a copy of VEvent.getConsumedTime()
- Parameters:
ev- the recurring eventmaxYears- Provide an upper limitmaxInstances- to limit- Returns:
- a list of periods for this event
-
getPeriods
public static RecurUtil.RecurPeriods getPeriods(BwEvent ev, int maxYears, int maxInstances, String startRange, String endRange) Returns a list of instances for this recurring event possibly bounded by the supplied maximum end date.This is mostly a copy of VEvent.getConsumedTime()
- Parameters:
ev- the recurring eventmaxYears- Provide an upper limitmaxInstances- to limitstartRange- null or set earliestendRange- null or set latest- Returns:
- a list of periods for this event
-
fromRecurrencId
public static RecurUtil.Recurrence fromRecurrencId(BwEvent master, String recurrenceId) throws CalFacadeException Generate a recurrence instance for the given master event based on the recurrenceId and the date/time info in the master.- Parameters:
master- eventrecurrenceId- for the instance.- Returns:
- instance object filled in.
- Throws:
CalFacadeException
-
getRecurrences
public static Collection<RecurUtil.Recurrence> getRecurrences(EventInfo ei, int maxYears, int maxInstances, String fromDate, String toDate) - Parameters:
ei- master eventmaxYears- Max number of years to prodicemaxInstances- max number of instancesfromDate- UTC date-time - if non-null only this and aftertoDate- UTC date-time - if non-null before this date- Returns:
- collection of recurrences
-
inDateTimeRange
public static boolean inDateTimeRange(String rangeStart, String rangeEnd, String periodStart, String periodEnd) Returns true if the period start and end dates overlap the specified limits. Either or both of rangeStart and rangeEnd may be null.- Parameters:
rangeStart- - UTC date/time or nullrangeEnd- - UTC date/time or nullperiodStart- - UTC date/time, NOT nullperiodEnd- - UTC date/time, NOT null- Returns:
- true if event satisfies the limits
-