Package mondrian.util
Class ScheduleUtil
- java.lang.Object
-
- mondrian.util.ScheduleUtil
-
-
Field Summary
Fields Modifier and Type Field Description (package private) static Calendar
epochDay
(package private) static Calendar
midnightTime
-
Constructor Summary
Constructors Constructor Description ScheduleUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
assertTrue(boolean b)
static void
assertTrue(boolean b, String s)
static Calendar
ceiling(Calendar calendar)
Returns a calendar rounded up to the next midnight, unless it is already midnight.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.static Calendar
createCalendar(Date date)
Creates a calendar in UTC, and initializes it todate
.static Calendar
createDateCalendar(int year, int month, int dayOfMonth)
Creates a calendar and sets it to a given year, month, date.static Time
createTime(int hour, int minutes, int second)
Creates aTime
static Calendar
createTimeCalendar(int hours, int minutes, int seconds)
Creates a calendar and sets it to a given hours, minutes, seconds.static Calendar
createTimeCalendar(Time time)
Creates a calendar from a time.static Calendar
floor(Calendar calendar)
Returns a calendar rounded down to the previous midnight.static Calendar
getTime(Calendar calendar)
Extracts the time part of a date.static boolean
is0000(Calendar calendar)
static boolean
isTime(Calendar calendar)
static int
julianDay(Calendar calendar)
Returns the julian day number of a given date.static boolean
lessThan(Time t1, Time t2, boolean strict)
static boolean
lessThan(Date d1, Date d2, boolean strict)
static Error
newInternal()
static Error
newInternal(String s)
static Error
newInternal(Throwable e, String s)
static int
timezoneOffset(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?)
-
-