- java.lang.Object
- 
- java.time.chrono.AbstractChronology
- 
- java.time.chrono.ThaiBuddhistChronology
 
 
- 
- All Implemented Interfaces:
- Serializable,- Comparable<Chronology>,- Chronology
 
 public final class ThaiBuddhistChronology extends AbstractChronology implements Serializable The Thai Buddhist calendar system.This chronology defines the rules of the Thai Buddhist calendar system. This calendar system is primarily used in Thailand. Dates are aligned such that 2484-01-01 (Buddhist)is1941-01-01 (ISO).The fields are defined as follows: - era - There are two eras, the current 'Buddhist' (ERA_BE) and the previous era (ERA_BEFORE_BE).
- year-of-era - The year-of-era for the current era increases uniformly from the epoch at year one. For the previous era the year increases from one as time goes backwards. The value for the current era is equal to the ISO proleptic-year plus 543.
- proleptic-year - The proleptic year is the same as the year-of-era for the current era. For the previous era, years have zero, then negative values. The value is equal to the ISO proleptic-year plus 543.
- month-of-year - The ThaiBuddhist month-of-year exactly matches ISO.
- day-of-month - The ThaiBuddhist day-of-month exactly matches ISO.
- day-of-year - The ThaiBuddhist day-of-year exactly matches ISO.
- leap-year - The ThaiBuddhist leap-year pattern exactly matches ISO, such that the two calendars are never out of step.
 - Implementation Requirements:
- This class is immutable and thread-safe.
- Since:
- 1.8
- See Also:
- Serialized Form
 
- 
- 
Field SummaryFields Modifier and Type Field Description static ThaiBuddhistChronologyINSTANCESingleton instance of the Buddhist chronology.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description ThaiBuddhistDatedate(int prolepticYear, int month, int dayOfMonth)Obtains a local date in Thai Buddhist calendar system from the proleptic-year, month-of-year and day-of-month fields.ThaiBuddhistDatedate(Era era, int yearOfEra, int month, int dayOfMonth)Obtains a local date in Thai Buddhist calendar system from the era, year-of-era, month-of-year and day-of-month fields.ThaiBuddhistDatedateEpochDay(long epochDay)Obtains a local date in the Thai Buddhist calendar system from the epoch-day.ThaiBuddhistDatedateYearDay(int prolepticYear, int dayOfYear)Obtains a local date in Thai Buddhist calendar system from the proleptic-year and day-of-year fields.ThaiBuddhistDatedateYearDay(Era era, int yearOfEra, int dayOfYear)Obtains a local date in Thai Buddhist calendar system from the era, year-of-era and day-of-year fields.StringgetCalendarType()Gets the calendar type of the underlying calendar system - 'buddhist'.StringgetId()Gets the ID of the chronology - 'ThaiBuddhist'.booleanisLeapYear(long prolepticYear)Checks if the specified year is a leap year.- 
Methods declared in class java.time.chrono.AbstractChronologycompareTo, equals, hashCode, resolveDate, toString
 - 
Methods declared in class java.lang.Objectclone, finalize, getClass, notify, notifyAll, wait, wait, wait
 - 
Methods declared in interface java.time.chrono.Chronologydate, dateNow, dateNow, dateNow, epochSecond, epochSecond, eraOf, eras, getDisplayName, localDateTime, period, prolepticYear, range, zonedDateTime, zonedDateTime
 
- 
 
- 
- 
- 
Field Detail- 
INSTANCEpublic static final ThaiBuddhistChronology INSTANCE Singleton instance of the Buddhist chronology.
 
- 
 - 
Method Detail- 
getIdpublic String getId() Gets the ID of the chronology - 'ThaiBuddhist'.The ID uniquely identifies the Chronology. It can be used to lookup theChronologyusingChronology.of(String).- Specified by:
- getIdin interface- Chronology
- Returns:
- the chronology ID - 'ThaiBuddhist'
- See Also:
- getCalendarType()
 
 - 
getCalendarTypepublic String getCalendarType() Gets the calendar type of the underlying calendar system - 'buddhist'.The calendar type is an identifier defined by the Unicode Locale Data Markup Language (LDML) specification. It can be used to lookup the ChronologyusingChronology.of(String). It can also be used as part of a locale, accessible viaLocale.getUnicodeLocaleType(String)with the key 'ca'.- Specified by:
- getCalendarTypein interface- Chronology
- Returns:
- the calendar system type - 'buddhist'
- See Also:
- getId()
 
 - 
datepublic ThaiBuddhistDate date(Era era, int yearOfEra, int month, int dayOfMonth) Obtains a local date in Thai Buddhist calendar system from the era, year-of-era, month-of-year and day-of-month fields.- Specified by:
- datein interface- Chronology
- Parameters:
- era- the Thai Buddhist era, not null
- yearOfEra- the year-of-era
- month- the month-of-year
- dayOfMonth- the day-of-month
- Returns:
- the Thai Buddhist local date, not null
- Throws:
- DateTimeException- if unable to create the date
- ClassCastException- if the- erais not a- ThaiBuddhistEra
 
 - 
datepublic ThaiBuddhistDate date(int prolepticYear, int month, int dayOfMonth) Obtains a local date in Thai Buddhist calendar system from the proleptic-year, month-of-year and day-of-month fields.- Specified by:
- datein interface- Chronology
- Parameters:
- prolepticYear- the proleptic-year
- month- the month-of-year
- dayOfMonth- the day-of-month
- Returns:
- the Thai Buddhist local date, not null
- Throws:
- DateTimeException- if unable to create the date
 
 - 
dateYearDaypublic ThaiBuddhistDate dateYearDay(Era era, int yearOfEra, int dayOfYear) Obtains a local date in Thai Buddhist calendar system from the era, year-of-era and day-of-year fields.- Specified by:
- dateYearDayin interface- Chronology
- Parameters:
- era- the Thai Buddhist era, not null
- yearOfEra- the year-of-era
- dayOfYear- the day-of-year
- Returns:
- the Thai Buddhist local date, not null
- Throws:
- DateTimeException- if unable to create the date
- ClassCastException- if the- erais not a- ThaiBuddhistEra
 
 - 
dateYearDaypublic ThaiBuddhistDate dateYearDay(int prolepticYear, int dayOfYear) Obtains a local date in Thai Buddhist calendar system from the proleptic-year and day-of-year fields.- Specified by:
- dateYearDayin interface- Chronology
- Parameters:
- prolepticYear- the proleptic-year
- dayOfYear- the day-of-year
- Returns:
- the Thai Buddhist local date, not null
- Throws:
- DateTimeException- if unable to create the date
 
 - 
dateEpochDaypublic ThaiBuddhistDate dateEpochDay(long epochDay) Obtains a local date in the Thai Buddhist calendar system from the epoch-day.- Specified by:
- dateEpochDayin interface- Chronology
- Parameters:
- epochDay- the epoch day
- Returns:
- the Thai Buddhist local date, not null
- Throws:
- DateTimeException- if unable to create the date
 
 - 
isLeapYearpublic boolean isLeapYear(long prolepticYear) Checks if the specified year is a leap year.Thai Buddhist leap years occur exactly in line with ISO leap years. This method does not validate the year passed in, and only has a well-defined result for years in the supported range. - Specified by:
- isLeapYearin interface- Chronology
- Parameters:
- prolepticYear- the proleptic-year to check, not validated for range
- Returns:
- true if the year is a leap year
 
 
- 
 
-