|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.plumtree.openfoundation.util.XPCalendar
public class XPCalendar
XPCalendar is a wrapper over GregorianCalendar, which is the standard calendar used by most of the world.
Field Summary | |
---|---|
static int |
AM
Value of the AM_PM field indicating the period of the day from midnight to just before noon. |
static int |
AM_PM
Field number for Get and Set indicating whether the HOUR is before or after noon. |
static int |
DATE
Field number for Get and Set indicating the day of the month. |
static int |
DAY_OF_MONTH
Field number for Get and Set indicating the day of the month. |
static int |
DAY_OF_WEEK
Field number for Get and Set indicating the day of the week. |
static int |
DAY_OF_WEEK_IN_MONTH
Field number for Get and Set indicating the ordinal number of the day of the week within the current month. |
static int |
DAY_OF_YEAR
Field number for Get and Set indicating the day number within the current year. |
static int |
ERA
Field number for Get and Set indicating the era, e.g., AD or BC in the Julian calendar. |
static java.lang.String |
EXPECTED_VALID_DAY_EXCEPTION_MSG
Valid values for DAY are 1 and above. |
static java.lang.String |
EXPECTED_VALID_MONTH_EXCEPTION_MSG
Valid values for MONTH are 1-12. |
static java.lang.String |
EXPECTED_VALID_YEAR_EXCEPTION_MSG
Year must be a positive number. |
static int |
FRIDAY
Value of the DAY_OF_WEEK field indicating Friday. |
protected java.util.GregorianCalendar |
gc
Internal GregorianCalendar. |
static int |
HOUR
Field number for Get and Set indicating the hour of the morning or afternoon. |
static int |
HOUR_OF_DAY
Field number for Get and Set indicating the hour of the day. |
static int |
MILLISECOND
Field number for Get and Set indicating the millisecond within the second. |
static int |
MINUTE
Field number for Get and Set indicating the minute within the hour. |
static int |
MONDAY
Value of the DAY_OF_WEEK field indicating Monday. |
static int |
MONTH
Field number for Get and Set indicating the month. |
static int |
PM
Value of the AM_PM field indicating the period of the day from noon to just before midnight. |
static int |
SATURDAY
Value of the DAY_OF_WEEK field indicating Saturday. |
static int |
SECOND
Field number for Get and Set indicating the second within the minute. |
static int |
SUNDAY
Value of the DAY_OF_WEEK field indicating Sunday. |
static int |
THURSDAY
Value of the DAY_OF_WEEK field indicating Thursday. |
static int |
TUESDAY
Value of the DAY_OF_WEEK field indicating Tuesday. |
static int |
WEDNESDAY
Value of the DAY_OF_WEEK field indicating Wednesday. |
static int |
WEEK_OF_MONTH
Field number for Get and Set indicating the week number within the current month. |
static int |
WEEK_OF_YEAR
Field number for Get and Set indicating the week number within the current year. |
static int |
YEAR
Field number for Get and Set indicating the year. |
Method Summary | |
---|---|
void |
Add(int unit,
int amount)
Updates the calendar by adding the given amount of units to its current value. |
boolean |
After(XPCalendar when)
Compares the time field records. |
boolean |
Before(XPCalendar when)
Compares the time field records. |
void |
Clear()
Clears the values of all the time fields. |
int |
Get(int unit)
Gets the value for a given time field. |
int |
GetActualMaximum(int unit)
Return the maximum value that this field could have, given the current date. |
int |
GetActualMinimum(int unit)
Return the minimum value that this field could have, given the current date. |
int |
GetFirstDayOfWeek()
Gets the first day of the week; e.g., Sunday in US, Monday in France. |
XPDateTime |
GetGregorianChange()
Gets the Gregorian Calendar change date. |
static XPCalendar |
GetInstance()
Gets a calendar using the default time zone and locale. |
static XPCalendar |
GetInstance(int year,
int month,
int day)
Constructs a GregorianCalendar with the given date set in the default time zone with the default locale. |
static XPCalendar |
GetInstance(int year,
int month,
int day,
int hour,
int minute)
Constructs a GregorianCalendar with the given date and time set for the default time zone with the default locale. |
static XPCalendar |
GetInstance(int year,
int month,
int day,
int hour,
int minute,
int second)
Constructs a GregorianCalendar with the given date and time set for the default time zone with the default locale. |
static XPCalendar |
GetInstance(XPLocale locale)
Gets a calendar using the default time zone and specified locale. |
static XPCalendar |
GetInstance(XPTimeZone timezone)
Gets a calendar using the specified time zone and default locale. |
static XPCalendar |
GetInstance(XPTimeZone timezone,
XPLocale locale)
Gets a calendar with the specified time zone and locale. |
int |
GetMaximum(int unit)
Gets the maximum value for the given time field. |
int |
GetMinimum(int unit)
Gets the minimum value for the given time field. |
XPDateTime |
GetTime()
Gets this Calendar's current time. |
XPTimeZone |
GetTimeZone()
Gets the time zone. |
java.util.GregorianCalendar |
GetUnderlyingObject()
Returns the platform specific object that this class wraps. |
void |
Set(int unit,
int value)
Sets the time field with the given value. |
void |
Set(int year,
int month,
int day)
Sets the values for the fields year, month, and day. |
void |
Set(int year,
int month,
int day,
int hour,
int minute)
Sets the values for the fields year, month, day, hour, and minute. |
void |
Set(int year,
int month,
int day,
int hour,
int minute,
int second)
Sets the values for the fields year, month, day, hour, minute, and second. |
void |
SetTime(XPDateTime date)
Sets this Calendar's current time with the given XPDateTime. |
void |
SetTimeZone(XPTimeZone timezone)
Sets the timezone for the calendar. |
java.lang.String |
toString()
Returns string representation of this XPCalendar forwarding from ToString(). |
java.lang.String |
ToString()
Returns string representation of this XPCalendar. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int ERA
public static final int YEAR
public static final int MONTH
public static final int WEEK_OF_YEAR
public static final int WEEK_OF_MONTH
public static final int DATE
public static final int DAY_OF_MONTH
public static final int DAY_OF_YEAR
public static final int DAY_OF_WEEK
public static final int DAY_OF_WEEK_IN_MONTH
public static final int AM_PM
public static final int HOUR
public static final int HOUR_OF_DAY
public static final int MINUTE
public static final int SECOND
public static final int MILLISECOND
public static final int AM
public static final int PM
public static final int SUNDAY
public static final int MONDAY
public static final int TUESDAY
public static final int WEDNESDAY
public static final int THURSDAY
public static final int FRIDAY
public static final int SATURDAY
protected java.util.GregorianCalendar gc
public static final java.lang.String EXPECTED_VALID_MONTH_EXCEPTION_MSG
public static final java.lang.String EXPECTED_VALID_DAY_EXCEPTION_MSG
public static final java.lang.String EXPECTED_VALID_YEAR_EXCEPTION_MSG
Method Detail |
---|
public static XPCalendar GetInstance()
public static XPCalendar GetInstance(int year, int month, int day)
year
- yyyymonth
- (1-12)day
- (1-31)
public static XPCalendar GetInstance(int year, int month, int day, int hour, int minute)
year
- yyyymonth
- (1-12)day
- (1-31)hour
- (0-23)minute
- (0-59)
public static XPCalendar GetInstance(int year, int month, int day, int hour, int minute, int second)
year
- yyyymonth
- (1-12)day
- (1-31)hour
- (0-23)minute
- (0-59)second
- (0-59)
public static XPCalendar GetInstance(XPLocale locale)
locale
- locale value
public static XPCalendar GetInstance(XPTimeZone timezone)
timezone
- value
public static XPCalendar GetInstance(XPTimeZone timezone, XPLocale locale)
timezone
- Zone Referencelocale
- Locale value
public void Add(int unit, int amount)
unit
- contains the unit of amountamount
- actual value to be addedpublic boolean After(XPCalendar when)
when
- is after the time of XPCalendar
public boolean Before(XPCalendar when)
when
- is after the time of XPCalendar
public void Clear()
public int Get(int unit)
unit
- Integer
public int GetActualMaximum(int unit)
unit
- Current Date
public int GetActualMinimum(int unit)
unit
- Integer
public int GetFirstDayOfWeek()
public XPDateTime GetGregorianChange()
public int GetMaximum(int unit)
unit
- value for the given time field
public int GetMinimum(int unit)
unit
- time field
public XPDateTime GetTime()
public XPTimeZone GetTimeZone()
public java.util.GregorianCalendar GetUnderlyingObject()
public void Set(int unit, int value)
unit
- timevalue
- givenpublic void Set(int year, int month, int day)
year
- yyyymonth
- (1-12)day
- (1-31)public void Set(int year, int month, int day, int hour, int minute)
year
- yyyymonth
- (1-12)day
- (1-31)hour
- (0-23)minute
- (0-59)public void Set(int year, int month, int day, int hour, int minute, int second)
year
- yyyymonth
- (1-12)day
- (1-31)hour
- (0-23)minute
- (0-59)second
- (0-59)public void SetTime(XPDateTime date)
date
- DateTime Value.public void SetTimeZone(XPTimeZone timezone)
timezone
- Instance of XPTimeZonepublic java.lang.String ToString()
public java.lang.String toString()
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |