Package mondrian.util

Class ScheduleUtil


  • class ScheduleUtil
    extends Object
    Utility functions for Schedule and supporting classes.
    • Field Detail

      • epochDay

        static final Calendar epochDay
      • midnightTime

        static final Calendar midnightTime
    • Constructor Detail

      • ScheduleUtil

        ScheduleUtil()
    • Method Detail

      • assertTrue

        public static void assertTrue​(boolean b)
      • assertTrue

        public static void assertTrue​(boolean b,
                                      String s)
      • newInternal

        public static Error newInternal()
      • newInternal

        public static Error newInternal​(String s)
      • lessThan

        public static boolean lessThan​(Time t1,
                                       Time t2,
                                       boolean strict)
      • lessThan

        public static boolean lessThan​(Date d1,
                                       Date d2,
                                       boolean strict)
      • is0000

        public static boolean is0000​(Calendar calendar)
      • isTime

        public static boolean isTime​(Calendar calendar)
      • floor

        public static Calendar floor​(Calendar calendar)
        Returns a calendar rounded down to the previous midnight.
      • ceiling

        public static Calendar ceiling​(Calendar calendar)
        Returns a calendar rounded up to the next midnight, unless it is already midnight.
      • getTime

        public static Calendar getTime​(Calendar calendar)
        Extracts the time part of a date. Given a null date, returns null.
      • createCalendar

        public static Calendar createCalendar​(Date date)
        Creates a calendar in UTC, and initializes it to date.
        Pre-condition:
        date != null
        Post-condition:
        return != null
      • createCalendar

        public static Calendar createCalendar​(int year,
                                              int month,
                                              int day,
                                              int hour,
                                              int minute,
                                              int second)
        Creates a calendar in UTC, and initializes it to a given year, month, day, hour, minute, second. NOTE: month is 1-based
      • createTimeCalendar

        public static Calendar createTimeCalendar​(Time time)
        Creates a calendar from a time. Milliseconds are ignored.
        Pre-condition:
        time != null
        Post-condition:
        return != null
      • createTimeCalendar

        public static Calendar createTimeCalendar​(int hours,
                                                  int minutes,
                                                  int seconds)
        Creates a calendar and sets it to a given hours, minutes, seconds.
      • createDateCalendar

        public static Calendar createDateCalendar​(int year,
                                                  int month,
                                                  int dayOfMonth)
        Creates a calendar and sets it to a given year, month, date.
      • createTime

        public static Time createTime​(int hour,
                                      int minutes,
                                      int second)
        Creates a Time
      • julianDay

        public static int julianDay​(Calendar calendar)
        Returns the julian day number of a given date. (Is there a better way to do this?)
      • timezoneOffset

        public static int timezoneOffset​(TimeZone tz,
                                         Calendar calendar)
        Returns the offset from UTC in milliseconds in this timezone on a given date.