public class BuddhistCalendar
extends GregorianCalendar
| java.lang.Object | |||
| android.icu.util.Calendar | |||
| android.icu.util.GregorianCalendar | |||
| android.icu.util.BuddhistCalendar | |||
BuddhistCalendar是的子类GregorianCalendar ,因为佛的诞生是数年。 这是一些主要佛教国家(如泰国)的公民日历,它用于其他地方的宗教用途。
除了年份和时代外,佛历在各个方面都与公历相同。 自公元前543年(公历)开始佛的编号,公元前1年(公历)等于544年(佛教时代),1998年公元为2541年。
佛历只有一个允许的时代: BE 。 如果日历不处于宽松模式(请参阅setLenient ),则在1/1/1 BE之前的日期将被拒绝,并且IllegalArgumentException 。
这个类不应该被分类。
通常应使用 getInstance(ULocale)传入 ULocale并使用标记 "@calendar=buddhist"来实例化 "@calendar=buddhist" 。
也可以看看:
常量(Constants) |
|
|---|---|
int |
BE 佛教时代的不变。 |
Inherited constants |
|---|
android.icu.util.GregorianCalendar
|
android.icu.util.Calendar
|
Inherited fields |
|---|
android.icu.util.GregorianCalendar
|
android.icu.util.Calendar
|
Public constructors |
|
|---|---|
BuddhistCalendar() 使用缺省语言环境的默认时区中的当前时间构造 |
|
BuddhistCalendar(TimeZone zone) 根据给定时区中当前时间和默认语言环境构造一个 |
|
BuddhistCalendar(Locale aLocale) 根据给定语言环境的默认时区中的当前时间构造一个 |
|
BuddhistCalendar(ULocale locale) 根据给定语言环境的默认时区中的当前时间构造一个 |
|
BuddhistCalendar(TimeZone zone, Locale aLocale) 根据给定语言环境给定时区中的当前时间构造一个 |
|
BuddhistCalendar(TimeZone zone, ULocale locale) 基于给定语言环境给定时区中的当前时间构造一个 |
|
BuddhistCalendar(Date date) 使用缺省区域设置在默认时区中设置的给定日期构造 |
|
BuddhistCalendar(int year, int month, int date) 使用缺省区域设置在默认时区中设置的给定日期构造 |
|
BuddhistCalendar(int year, int month, int date, int hour, int minute, int second) 使用默认语言环境为默认时区设置的给定日期和时间构造佛教日历。 |
|
公共方法(Public methods) |
|
|---|---|
String |
getType() [icu]返回此Calendar对象的日历类型名称字符串。 |
Protected methods |
|
|---|---|
void |
handleComputeFields(int julianDay) 重写日历以计算特定于混合公历 - 儒略历日历系统的几个字段。 |
int |
handleComputeMonthStart(int eyear, int month, boolean useMonth) 返回给定月/年开始的JD |
int |
handleGetExtendedYear() 返回当前字段定义的扩展年份。 |
int |
handleGetLimit(int field, int limitType) 覆盖GregorianCalendar。 |
继承方法(Inherited methods) |
|
|---|---|
android.icu.util.GregorianCalendar
|
|
android.icu.util.Calendar
|
|
java.lang.Object
|
|
java.lang.Comparable
|
|
BuddhistCalendar (TimeZone zone)
根据给定时区中的当前时间和默认语言环境构造一个 BuddhistCalendar 。
| 参数(Parameters) | |
|---|---|
zone |
TimeZone: the given time zone. |
BuddhistCalendar (Locale aLocale)
根据给定语言环境的默认时区中的当前时间构造一个 BuddhistCalendar 。
| 参数(Parameters) | |
|---|---|
aLocale |
Locale: the given locale. |
BuddhistCalendar (ULocale locale)
根据给定语言环境的默认时区中的当前时间构造 BuddhistCalendar 。
| 参数(Parameters) | |
|---|---|
locale |
ULocale: the given ulocale. |
BuddhistCalendar (TimeZone zone, Locale aLocale)
根据给定语言环境给定时区中的当前时间构造一个 BuddhistCalendar 。
| 参数(Parameters) | |
|---|---|
zone |
TimeZone: the given time zone. |
aLocale |
Locale: the given locale. |
BuddhistCalendar (TimeZone zone, ULocale locale)
基于给定语言环境给定时区中的当前时间构造一个 BuddhistCalendar 。
| 参数(Parameters) | |
|---|---|
zone |
TimeZone: the given time zone. |
locale |
ULocale: the given ulocale. |
BuddhistCalendar (Date date)
使用缺省区域设置在默认时区中设置的给定日期构造 BuddhistCalendar 。
| 参数(Parameters) | |
|---|---|
date |
Date: The date to which the new calendar is set. |
BuddhistCalendar (int year,
int month,
int date)
使用缺省区域设置在缺省时区中设置的给定日期构造 BuddhistCalendar 。
| 参数(Parameters) | |
|---|---|
year |
int: The value used to set the calendar's YEAR time field. |
month |
int: The value used to set the calendar's MONTH time field. The value is 0-based. e.g., 0 for January. |
date |
int: The value used to set the calendar's DATE time field. |
BuddhistCalendar (int year,
int month,
int date,
int hour,
int minute,
int second)
使用默认语言环境为默认时区设置的给定日期和时间构造佛教日历。
| 参数(Parameters) | |
|---|---|
year |
int: The value used to set the calendar's YEAR time field. |
month |
int: The value used to set the calendar's MONTH time field. The value is 0-based. e.g., 0 for January. |
date |
int: The value used to set the calendar's DATE time field. |
hour |
int: The value used to set the calendar's HOUR_OF_DAY time field. |
minute |
int: The value used to set the calendar's MINUTE time field. |
second |
int: The value used to set the calendar's SECOND time field. |
String getType ()
[icu]返回此Calendar对象的日历类型名称字符串。 返回的字符串是传统的ICU日历属性值,例如“gregorian”或“japanese”。
请参阅http://www.unicode.org/reports/tr35/#Key_Type_Definitions中有关语言环境ID的日历属性的type =“old type name”
| 返回(Returns) | |
|---|---|
String |
legacy calendar type name string |
void handleComputeFields (int julianDay)
重写日历以计算特定于混合公历 - 儒略历日历系统的几个字段。 这些是:
| 参数(Parameters) | |
|---|---|
julianDay |
int
|
int handleComputeMonthStart (int eyear,
int month,
boolean useMonth)
返回给定月/年开始的JD
| 参数(Parameters) | |
|---|---|
eyear |
int: the extended year |
month |
int: the zero-based month, or 0 if useMonth is false |
useMonth |
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 |
| 返回(Returns) | |
|---|---|
int |
the Julian day number of the day before the first day of the given month and year |
int handleGetExtendedYear ()
返回当前字段定义的扩展年份。 这将使用EXTENDED_YEAR字段或特定于日历系统的YEAR和超年字段(如ERA),具体取决于哪一组字段较新。
| 返回(Returns) | |
|---|---|
int |
the extended year |
int handleGetLimit (int field,
int limitType)
覆盖GregorianCalendar。 只有一个佛教时代。 我们应该在这里处理YEAR,YEAR_WOY和EXTENDED_YEAR,以实现1..5000000的范围,但这并不重要。
| 参数(Parameters) | |
|---|---|
field |
int: one of the above field numbers |
limitType |
int: one of MINIMUM, GREATEST_MINIMUM, LEAST_MAXIMUM, or MAXIMUM |
| 返回(Returns) | |
|---|---|
int |
|