Package mondrian.util
Class ScheduleUtil
- java.lang.Object
-
- mondrian.util.ScheduleUtil
-
-
Field Summary
Fields Modifier and Type Field Description (package private) static CalendarepochDay(package private) static CalendarmidnightTime
-
Constructor Summary
Constructors Constructor Description ScheduleUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidassertTrue(boolean b)static voidassertTrue(boolean b, String s)static Calendarceiling(Calendar calendar)Returns a calendar rounded up to the next midnight, unless it is already midnight.static CalendarcreateCalendar(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.static CalendarcreateCalendar(Date date)Creates a calendar in UTC, and initializes it todate.static CalendarcreateDateCalendar(int year, int month, int dayOfMonth)Creates a calendar and sets it to a given year, month, date.static TimecreateTime(int hour, int minutes, int second)Creates aTimestatic CalendarcreateTimeCalendar(int hours, int minutes, int seconds)Creates a calendar and sets it to a given hours, minutes, seconds.static CalendarcreateTimeCalendar(Time time)Creates a calendar from a time.static Calendarfloor(Calendar calendar)Returns a calendar rounded down to the previous midnight.static CalendargetTime(Calendar calendar)Extracts the time part of a date.static booleanis0000(Calendar calendar)static booleanisTime(Calendar calendar)static intjulianDay(Calendar calendar)Returns the julian day number of a given date.static booleanlessThan(Time t1, Time t2, boolean strict)static booleanlessThan(Date d1, Date d2, boolean strict)static ErrornewInternal()static ErrornewInternal(String s)static ErrornewInternal(Throwable e, String s)static inttimezoneOffset(TimeZone tz, Calendar calendar)Returns the offset from UTC in milliseconds in this timezone on a given date.
-
-
-
Method Detail
-
assertTrue
public static void assertTrue(boolean b)
-
assertTrue
public static void assertTrue(boolean b, String s)
-
newInternal
public static Error newInternal()
-
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 todate.- 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.
-
julianDay
public static int julianDay(Calendar calendar)
Returns the julian day number of a given date. (Is there a better way to do this?)
-
-