public final class ThaiBuddhistChrono extends Chrono<ThaiBuddhistChrono> implements java.io.Serializable
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)
is 1941-01-01 (ISO)
.
The fields are defined as follows:
Modifier and Type | Field and Description |
---|---|
static Era<ThaiBuddhistChrono> |
ERA_BE
The singleton instance for the current era - Buddhist - which has the value 1.
|
static Era<ThaiBuddhistChrono> |
ERA_BEFORE_BE
The singleton instance for the era before the current one - Before Buddhist -
which has the value 0.
|
static ThaiBuddhistChrono |
INSTANCE
Singleton instance of the Buddhist chronology.
|
Modifier and Type | Method and Description |
---|---|
ChronoLocalDate<ThaiBuddhistChrono> |
date(int prolepticYear,
int month,
int dayOfMonth)
Obtains a local date in this chronology from the proleptic-year,
month-of-year and day-of-month fields.
|
ChronoLocalDate<ThaiBuddhistChrono> |
date(TemporalAccessor temporal)
Obtains a local date in this chronology from another temporal object.
|
ChronoLocalDate<ThaiBuddhistChrono> |
dateYearDay(int prolepticYear,
int dayOfYear)
Obtains a local date in this chronology from the proleptic-year and
day-of-year fields.
|
Era<ThaiBuddhistChrono> |
eraOf(int eraValue)
Creates the chronology era object from the numeric value.
|
java.util.List<Era<ThaiBuddhistChrono>> |
eras()
Gets the list of eras for the chronology.
|
java.lang.String |
getCalendarType()
Gets the calendar type of the underlying calendar system - 'buddhist'.
|
java.lang.String |
getId()
Gets the ID of the chronology - 'ThaiBuddhist'.
|
boolean |
isLeapYear(long prolepticYear)
Checks if the specified year is a leap year.
|
int |
prolepticYear(Era<ThaiBuddhistChrono> era,
int yearOfEra)
Calculates the proleptic-year given the era and year-of-era.
|
ValueRange |
range(ChronoField field)
Gets the range of valid values for the specified field.
|
compareTo, date, dateNow, dateNow, dateNow, dateTime, dateYearDay, equals, from, getAvailableChronologies, getText, hashCode, localDateTime, of, ofLocale, toString, zonedDateTime, zonedDateTime
public static final ThaiBuddhistChrono INSTANCE
public static final Era<ThaiBuddhistChrono> ERA_BEFORE_BE
public static final Era<ThaiBuddhistChrono> ERA_BE
public java.lang.String getId()
The ID uniquely identifies the Chrono
.
It can be used to lookup the Chrono
using Chrono.of(String)
.
getId
in class Chrono<ThaiBuddhistChrono>
getCalendarType()
public java.lang.String getCalendarType()
The calendar type is an identifier defined by the
Unicode Locale Data Markup Language (LDML) specification.
It can be used to lookup the Chrono
using Chrono.of(String)
.
It can also be used as part of a locale, accessible via
Locale.getUnicodeLocaleType(String)
with the key 'ca'.
getCalendarType
in class Chrono<ThaiBuddhistChrono>
getId()
public ChronoLocalDate<ThaiBuddhistChrono> date(int prolepticYear, int month, int dayOfMonth)
Chrono
date
in class Chrono<ThaiBuddhistChrono>
prolepticYear
- the chronology proleptic-yearmonth
- the chronology month-of-yeardayOfMonth
- the chronology day-of-monthpublic ChronoLocalDate<ThaiBuddhistChrono> dateYearDay(int prolepticYear, int dayOfYear)
Chrono
dateYearDay
in class Chrono<ThaiBuddhistChrono>
prolepticYear
- the chronology proleptic-yeardayOfYear
- the chronology day-of-yearpublic ChronoLocalDate<ThaiBuddhistChrono> date(TemporalAccessor temporal)
Chrono
This creates a date in this chronology based on the specified TemporalAccessor
.
The standard mechanism for conversion between date types is the
local epoch-day
field.
date
in class Chrono<ThaiBuddhistChrono>
temporal
- the temporal object to convert, not nullpublic boolean isLeapYear(long prolepticYear)
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.
isLeapYear
in class Chrono<ThaiBuddhistChrono>
prolepticYear
- the proleptic-year to check, not validated for rangepublic int prolepticYear(Era<ThaiBuddhistChrono> era, int yearOfEra)
Chrono
This combines the era and year-of-era into the single proleptic-year field.
prolepticYear
in class Chrono<ThaiBuddhistChrono>
era
- the era of the correct type for the chronology, not nullyearOfEra
- the chronology year-of-erapublic Era<ThaiBuddhistChrono> eraOf(int eraValue)
Chrono
The era is, conceptually, the largest division of the time-line. Most calendar systems have a single epoch dividing the time-line into two eras. However, some have multiple eras, such as one for the reign of each leader. The exact meaning is determined by the chronology according to the following constraints.
The era in use at 1970-01-01 must have the value 1. Later eras must have sequentially higher values. Earlier eras must have sequentially lower values. Each chronology must refer to an enum or similar singleton to provide the era values.
This method returns the singleton era of the correct type for the specified era value.
eraOf
in class Chrono<ThaiBuddhistChrono>
eraValue
- the era valuepublic java.util.List<Era<ThaiBuddhistChrono>> eras()
Chrono
Most calendar systems have an era, within which the year has meaning. If the calendar system does not support the concept of eras, an empty list must be returned.
eras
in class Chrono<ThaiBuddhistChrono>
public ValueRange range(ChronoField field)
Chrono
All fields can be expressed as a long
integer.
This method returns an object that describes the valid range for that value.
Note that the result only describes the minimum and maximum valid values and it is important not to read too much into them. For example, there could be values within the range that are invalid for the field.
This method will return a result whether or not the chronology supports the field.
range
in class Chrono<ThaiBuddhistChrono>
field
- the field to get the range for, not null