Class Util

java.lang.Object
org.opencastproject.scheduler.api.Util

public final class Util extends Object
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
    The minimum separation between one event ending and the next starting
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    adjustRrule(net.fortuna.ical4j.model.property.RRule rRule, Date start, TimeZone tz)
    Adjust the given UTC rrule to the given timezone.
    static List<net.fortuna.ical4j.model.Period>
    calculatePeriods(Calendar startCalTz, Calendar endCalTz, long duration, net.fortuna.ical4j.model.Recur recur, TimeZone tz)
    Given a start time and end time with a recurrence rule and a timezone, all periods of the recurrence rule are calculated taken daylight saving time into account.
    static List<net.fortuna.ical4j.model.Period>
    calculatePeriods(Date start, Date end, long duration, net.fortuna.ical4j.model.property.RRule rRule, TimeZone tz)
    Backward compatibility, converts parameters as required for the updated calculatePeriods
    static boolean
    schedulingIntervalsOverlap(Date start1, Date end1, Date start2, Date end2)
    Check if two intervals (for example, for two scheduled events), overlap.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • EVENT_MINIMUM_SEPARATION_MILLISECONDS

      public static final int EVENT_MINIMUM_SEPARATION_MILLISECONDS
      The minimum separation between one event ending and the next starting
      See Also:
  • Method Details

    • adjustRrule

      public static void adjustRrule(net.fortuna.ical4j.model.property.RRule rRule, Date start, TimeZone tz)
      Adjust the given UTC rrule to the given timezone.
      Parameters:
      rRule - The rrule to adjust.
      start - The start date in UTC
      tz - The target timezone.
    • calculatePeriods

      public static List<net.fortuna.ical4j.model.Period> calculatePeriods(Date start, Date end, long duration, net.fortuna.ical4j.model.property.RRule rRule, TimeZone tz)
      Backward compatibility, converts parameters as required for the updated calculatePeriods
      Parameters:
      start - date in the scheduled time zone
      end - date in the scheduled time zone
      duration -
      rRule -
      tz - , time zone of the scheduled event
      Returns:
      the calculated periods
    • calculatePeriods

      public static List<net.fortuna.ical4j.model.Period> calculatePeriods(Calendar startCalTz, Calendar endCalTz, long duration, net.fortuna.ical4j.model.Recur recur, TimeZone tz)
      Given a start time and end time with a recurrence rule and a timezone, all periods of the recurrence rule are calculated taken daylight saving time into account.
      Parameters:
      startCalTz - , Calendar date time of the recurrence in the timezone of the scheduled CA
      endCalTz - , Calendar date time of the recurrence in the timezone of the scheduled CA
      duration - , the length of each event
      recur - , the recurrence rule (based on the Start time zone, including start hour and days of week)
      tz - , the timezone of the scheduled CA
      Returns:
      a list of event Periods that match the rule and start and end times
    • schedulingIntervalsOverlap

      public static boolean schedulingIntervalsOverlap(Date start1, Date end1, Date start2, Date end2)
      Check if two intervals (for example, for two scheduled events), overlap.
      Parameters:
      start1 - start of first interval
      end1 - end of first interval
      start2 - start of second interval
      end2 - end of second interval
      Returns:
      true if they overlap, false if they don't