BuddhistCalendar is a subclass of GregorianCalendar
that numbers years since the birth of the Buddha. This is the civil calendar
in some predominantly Buddhist countries such as Thailand, and it is used for
religious purposes elsewhere.
The Buddhist calendar is identical to the Gregorian calendar in all respects except for the year and era. Years are numbered since the birth of the Buddha in 543 BC (Gregorian), so that 1 AD (Gregorian) is equivalent to 544 BE (Buddhist Era) and 1998 AD is 2541 BE.
The Buddhist Calendar has only one allowable era: BE. If the
calendar is not in lenient mode (see setLenient), dates before
1/1/1 BE are rejected with an IllegalArgumentException.
This class should not be subclassed.
BuddhistCalendar usually should be instantiated using
com. passing in a ULocale
with the tag "@calendar=buddhist".
com.ibm.icu.util.Calendar , com.ibm.icu.util.GregorianCalendar
| Modifier and Type | Field and Description |
|---|---|
| public static final int | BE
Constant for the Buddhist Era. |
| private static final int | |
| private static final int | |
| private static final long |
| Access | Constructor and Description |
|---|---|
| public | BuddhistCalendar()
Constructs a |
| public | BuddhistCalendar(TimeZone
the given time zone. zone)Constructs a |
| public | BuddhistCalendar(Locale
the given locale. aLocale)Constructs a |
| public | BuddhistCalendar(ULocale
the given ulocale. locale)Constructs a |
| public | BuddhistCalendar(TimeZone
the given time zone. zone, Locale the given locale. aLocale)Constructs a |
| public | BuddhistCalendar(TimeZone
the given time zone. zone, ULocale the given ulocale. locale)Constructs a |
| public | BuddhistCalendar(Date
The date to which the new calendar is set. date)Constructs a |
| public | BuddhistCalendar(int
The value used to set the calendar's year, int YEAR time field.The value used to set the calendar's month, int MONTH time field.
The value is 0-based. e.g., 0 for January.The value used to set the calendar's date)DATE time field.Constructs a |
| public | BuddhistCalendar(int
The value used to set the calendar's year, int YEAR time field.The value used to set the calendar's month, int MONTH time field.
The value is 0-based. e.g., 0 for January.The value used to set the calendar's date, int DATE time field.The value used to set the calendar's hour, int HOUR_OF_DAY time field.The value used to set the calendar's minute, int MINUTE time field.The value used to set the calendar's second)SECOND time field.Constructs a BuddhistCalendar with the given date and time set for the default time zone with the default locale. |
| Modifier and Type | Method and Description |
|---|---|
| public String | |
| protected void | handleComputeFields(int julianDay)
Overrides com. |
| protected int | handleComputeMonthStart(int
the extended year eyear, int the zero-based month, or 0 if useMonth is false month, boolean if false, compute the day before the first day of
the given year, otherwise, compute the day before the first day of
the given month useMonth)Overrides com. |
| protected int | handleGetExtendedYear()
Overrides com. |
| protected int | handleGetLimit(int
one of the above field numbers field, int one of limitType)MINIMUM, GREATEST_MINIMUM,
LEAST_MAXIMUM, or MAXIMUMOverrides com. |
| BE | back to summary |
|---|---|
| public static final int BE Constant for the Buddhist Era. This is the only allowable
| |
| BUDDHIST_ERA_START | back to summary |
|---|---|
| private static final int BUDDHIST_ERA_START | |
| GREGORIAN_EPOCH | back to summary |
|---|---|
| private static final int GREGORIAN_EPOCH | |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID | |
| BuddhistCalendar | back to summary |
|---|---|
| public BuddhistCalendar() Constructs a
| |
| BuddhistCalendar | back to summary |
|---|---|
| public BuddhistCalendar(TimeZone zone) Constructs a | |
| BuddhistCalendar | back to summary |
|---|---|
| public BuddhistCalendar(Locale aLocale) Constructs a | |
| BuddhistCalendar | back to summary |
|---|---|
| public BuddhistCalendar(ULocale locale) Constructs a | |
| BuddhistCalendar | back to summary |
|---|---|
| public BuddhistCalendar(TimeZone zone, Locale aLocale) Constructs a | |
| BuddhistCalendar | back to summary |
|---|---|
| public BuddhistCalendar(TimeZone zone, ULocale locale) Constructs a | |
| BuddhistCalendar | back to summary |
|---|---|
| public BuddhistCalendar(Date date) Constructs a | |
| BuddhistCalendar | back to summary |
|---|---|
| public BuddhistCalendar(int year, int month, int date) Constructs a | |
| BuddhistCalendar | back to summary |
|---|---|
| public BuddhistCalendar(int year, int month, int date, int hour, int minute, int second) Constructs a BuddhistCalendar with the given date and time set for the default time zone with the default locale.
| |
| getType | back to summary |
|---|---|
| public String getType() Overrides com. Doc from com. ICU See type="old type name" for the calendar attribute of locale IDs at http://www.unicode.org/reports/tr35/#Key_Type_Definitions
| |
| handleComputeFields | back to summary |
|---|---|
| protected void handleComputeFields(int julianDay) Overrides com. Doc from com. Override Calendar to compute several fields specific to the hybrid Gregorian-Julian calendar system. These are:
| |
| handleComputeMonthStart | back to summary |
|---|---|
| protected int handleComputeMonthStart(int eyear, int month, boolean useMonth) Overrides com. Doc from com. Return JD of start of given month/year
| |
| handleGetExtendedYear | back to summary |
|---|---|
| protected int handleGetExtendedYear() Overrides com. Doc from com. Returns the extended year defined by the current fields. This will use the EXTENDED_YEAR field or the YEAR and supra-year fields (such as ERA) specific to the calendar system, depending on which set of fields is newer.
| |
| handleGetLimit | back to summary |
|---|---|
| protected int handleGetLimit(int field, int limitType) Overrides com. Override GregorianCalendar. There is only one Buddhist ERA. We should really handle YEAR, YEAR_WOY, and EXTENDED_YEAR here too to implement the 1..5000000 range, but it's not critical.
| |