|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.cc.framework.util.CalendarHelp
Calendar utility class
Field Summary | |
static int |
DAYS_IN_WEEK
The number of days in a week |
static int |
DOWM_ALLDAYS
Bit mask for Working Days |
static int |
DOWM_FRIDAY
Bit mask for Friday |
static int |
DOWM_MONDAY
Bit mask for Monday |
static int |
DOWM_SATURDAY
Bit mask for Saturday |
static int |
DOWM_SUNDAY
Bit mask for Sunday |
static int |
DOWM_THURSDAY
Bit mask for Thursday |
static int |
DOWM_TUESDAY
Bit mask for Tuesday |
static int |
DOWM_WEDNESDAY
Bit mask for Wednesday |
static int |
DOWM_WEEKDAYS
Bit mask for Working Days |
static int |
DOWM_WEEKENDDAYS
Bit mask for Weekend Days |
Constructor Summary | |
CalendarHelp()
|
Method Summary | |
static boolean |
between(java.util.Calendar date,
java.util.Calendar t1,
java.util.Calendar t2)
This method checks if the given date falls between the dates t1 and t2. |
static int |
getDays(java.util.Calendar date1,
java.util.Calendar date2)
This method calculates the number of days between the two dates. |
static boolean |
isSameDay(java.util.Calendar a,
java.util.Calendar b)
Checks if both dates are on the same day |
static boolean |
isWeekEndDay(int dayOfWeek)
Checks if the given day is a weekend day |
static int |
parseDay(java.lang.String dayName)
Converts a Day Name into a integer value |
static int |
parseDayMask(java.lang.String dayList)
Parses a semicolon separated Day list and creates a day mask |
static int |
rollDay(int dayOfWeek,
int offset)
Rolls the day index by the given offset |
static void |
setFromLong(java.util.Calendar cal,
long timeInMillis)
Initializes the calendar with the given UTC timestamp for compatibility with JDK 1.3 |
static long |
toLong(java.util.Calendar cal)
Converts a calendar into a long value for compatibility with JDK 1.3 |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int DAYS_IN_WEEK
public static final int DOWM_SUNDAY
public static final int DOWM_MONDAY
public static final int DOWM_TUESDAY
public static final int DOWM_WEDNESDAY
public static final int DOWM_THURSDAY
public static final int DOWM_FRIDAY
public static final int DOWM_SATURDAY
public static final int DOWM_WEEKDAYS
public static final int DOWM_WEEKENDDAYS
public static final int DOWM_ALLDAYS
Constructor Detail |
public CalendarHelp()
Method Detail |
public static long toLong(java.util.Calendar cal)
cal
- Calendar to convert
public static void setFromLong(java.util.Calendar cal, long timeInMillis)
cal
- the calendartimeInMillis
- UTC timestamppublic static int getDays(java.util.Calendar date1, java.util.Calendar date2)
date1
- the first daydate2
- the last day
public static boolean isSameDay(java.util.Calendar a, java.util.Calendar b)
a
- first dateb
- second date
true
if the days cover the same daypublic static int parseDayMask(java.lang.String dayList)
dayList
- Semicolon separated list with day names (Locale.ENGLISH)
public static int parseDay(java.lang.String dayName)
dayName
- The Day Name (Locale.ENGLISH)
public static int rollDay(int dayOfWeek, int offset)
dayOfWeek
- Starting day indexoffset
- the offset to roll
public static boolean between(java.util.Calendar date, java.util.Calendar t1, java.util.Calendar t2)
date
- the date to checkt1
- lower interval boundaryt2
- upper interval boundary
true
when the given date falls into the intervalpublic static boolean isWeekEndDay(int dayOfWeek)
dayOfWeek
- the day to check
true
if this is a weekend day
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |