|
Copyright © 2006 BEA Systems, Inc. All Rights Reserved | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.compoze.collab.util.CalendarUtility
public class CalendarUtility
This class contains utility methods for manipulating calendars and related items.
Constructor Summary | |
---|---|
CalendarUtility()
|
Method Summary | |
---|---|
static void |
main(String[] args)
Exerciser. |
static Date |
roundDate(Date date)
Rounds a date to the nearest midnight. |
static Date |
truncateDate(Date date,
int iField)
Truncates a date to the resolution of the given calendar field. |
static Date |
truncateDate(Date date,
int iField,
Calendar cal)
Truncates a date to the resolution of the given calendar field. |
static Date |
truncateDate(Date date,
int iField,
Locale locale)
Truncates a date to the resolution of the given calendar field. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CalendarUtility()
Method Detail |
---|
public static Date truncateDate(Date date, int iField)
date
- date to roundiField
- the calendar field (valid fields are
YEAR, MONTH, DATE, DAY_OF_MONTH, HOUR_OF_DAY,
MINUTE, SECOND, and MILLISECOND)- fields less
significant than this will be set to their
minimum value
Calendar
public static Date truncateDate(Date date, int iField, Locale locale)
date
- date to roundiField
- the calendar field (valid fields are
YEAR, MONTH, DATE, DAY_OF_MONTH, HOUR_OF_DAY,
MINUTE, SECOND, and MILLISECOND)- fields less
significant than this will be set to their
minimum valuelocale
- the locale to use
Calendar
public static Date truncateDate(Date date, int iField, Calendar cal)
date
- date to trucate (null
to not
set the calendar time)iField
- the calendar field (valid fields are
YEAR, MONTH, DATE, DAY_OF_MONTH, HOUR_OF_DAY,
MINUTE, SECOND, and MILLISECOND)- fields less
significant than this will be set to their
minimum valuecal
- the calendar to use
Calendar
public static Date roundDate(Date date)
date
- date to round
Calendar
public static void main(String[] args)
args
- arguments (none taken)
|
Copyright © 2006 BEA Systems, Inc. All Rights Reserved | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |