Package org.joda.time.chrono
Class BuddhistChronology
java.lang.Object
org.joda.time.Chronology
org.joda.time.chrono.BaseChronology
org.joda.time.chrono.AssembledChronology
org.joda.time.chrono.BuddhistChronology
- All Implemented Interfaces:
Serializable
A chronology that matches the BuddhistCalendar class supplied by Sun.
The chronology is identical to the Gregorian/Julian, except that the year is offset by +543 and the era is named 'BE' for Buddhist Era.
This class was intended by Sun to model the calendar used in Thailand. However, the actual rules for Thailand are much more involved than this class covers. (This class is accurate after 1941-01-01 ISO).
This chronology is being retained for those who want a same effect replacement for the Sun class. It is hoped that community support will enable a more accurate chronology for Thailand, to be developed.
BuddhistChronology is thread-safe and immutable.
- Since:
- 1.0
- Author:
- Stephen Colebourne, Brian S O'Neill
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class org.joda.time.chrono.AssembledChronology
AssembledChronology.Fields
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
Constant value for 'Buddhist Era', equivalent to the value returned for AD/CE. -
Method Summary
Modifier and TypeMethodDescriptionprotected void
assemble
(AssembledChronology.Fields fields) Invoked by the constructor and after deserialization to allow subclasses to define all of its supported fields.boolean
Checks if this chronology instance equals another.static BuddhistChronology
Standard instance of a Buddhist Chronology, that matches Sun's BuddhistCalendar class.static BuddhistChronology
getInstance
(DateTimeZone zone) Standard instance of a Buddhist Chronology, that matches Sun's BuddhistCalendar class.static BuddhistChronology
Standard instance of a Buddhist Chronology, that matches Sun's BuddhistCalendar class.int
hashCode()
A suitable hash code for the chronology.toString()
Gets a debugging toString.withUTC()
Gets the Chronology in the UTC time zone.withZone
(DateTimeZone zone) Gets the Chronology in a specific time zone.Methods inherited from class org.joda.time.chrono.AssembledChronology
centuries, centuryOfEra, clockhourOfDay, clockhourOfHalfday, dayOfMonth, dayOfWeek, dayOfYear, days, era, eras, getBase, getDateTimeMillis, getDateTimeMillis, getDateTimeMillis, getParam, getZone, halfdayOfDay, halfdays, hourOfDay, hourOfHalfday, hours, millis, millisOfDay, millisOfSecond, minuteOfDay, minuteOfHour, minutes, monthOfYear, months, secondOfDay, secondOfMinute, seconds, weekOfWeekyear, weeks, weekyear, weekyearOfCentury, weekyears, year, yearOfCentury, yearOfEra, years
-
Field Details
-
BE
public static final int BEConstant value for 'Buddhist Era', equivalent to the value returned for AD/CE. Note that this differs from the constant in BuddhistCalendar.- See Also:
-
-
Method Details
-
getInstanceUTC
Standard instance of a Buddhist Chronology, that matches Sun's BuddhistCalendar class. This means that it follows the GregorianJulian calendar rules with a cutover date.The time zone of the returned instance is UTC.
-
getInstance
Standard instance of a Buddhist Chronology, that matches Sun's BuddhistCalendar class. This means that it follows the GregorianJulian calendar rules with a cutover date. -
getInstance
Standard instance of a Buddhist Chronology, that matches Sun's BuddhistCalendar class. This means that it follows the GregorianJulian calendar rules with a cutover date.- Parameters:
zone
- the time zone to use, null is default
-
withUTC
Gets the Chronology in the UTC time zone.- Specified by:
withUTC
in classBaseChronology
- Returns:
- the chronology in UTC
-
withZone
Gets the Chronology in a specific time zone.- Specified by:
withZone
in classBaseChronology
- Parameters:
zone
- the zone to get the chronology in, null is default- Returns:
- the chronology
- See Also:
-
equals
Checks if this chronology instance equals another. -
hashCode
public int hashCode()A suitable hash code for the chronology. -
toString
Gets a debugging toString.- Specified by:
toString
in classBaseChronology
- Returns:
- a debugging string
-
assemble
Description copied from class:AssembledChronology
Invoked by the constructor and after deserialization to allow subclasses to define all of its supported fields. All unset fields default to unsupported instances.- Specified by:
assemble
in classAssembledChronology
- Parameters:
fields
- container of fields
-