Class RecurUtil

java.lang.Object
org.bedework.convert.RecurUtil

public class RecurUtil extends Object
Some help with recurrences.
Version:
1.0
Author:
Mike Douglass douglm - rpi.edu
  • Constructor Details

    • RecurUtil

      public RecurUtil()
  • Method Details

    • getRange

      public static RecurUtil.RecurRange getRange(BwEvent ev, int maxYears)
      Returns range of dates for this recurring event possibly bounded by the supplied maximum end date.
      Parameters:
      ev - the recurring event
      maxYears - Provide an upper limit
      Returns:
      the range for this event
    • getPeriods

      public static RecurUtil.RecurPeriods getPeriods(BwEvent ev, int maxYears, int maxInstances)
      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 event
      maxYears - Provide an upper limit
      maxInstances - 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 event
      maxYears - Provide an upper limit
      maxInstances - to limit
      startRange - null or set earliest
      endRange - 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 - event
      recurrenceId - 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 event
      maxYears - Max number of years to prodice
      maxInstances - max number of instances
      fromDate - UTC date-time - if non-null only this and after
      toDate - 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 null
      rangeEnd - - UTC date/time or null
      periodStart - - UTC date/time, NOT null
      periodEnd - - UTC date/time, NOT null
      Returns:
      true if event satisfies the limits