org.joda.time.chrono

Class BuddhistChronology

Implemented Interfaces:
Serializable

public final class BuddhistChronology
extends AssembledChronology

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 chronlogy 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.

Authors:
Stephen Colebourne
Brian S O'Neill
Since:
1.0

Nested Class Summary

Nested classes/interfaces inherited from class org.joda.time.chrono.AssembledChronology

AssembledChronology.Fields

Field Summary

static int
BE
Constant value for 'Buddhist Era', equivalent to the value returned for AD/CE.

Method Summary

protected void
assemble(AssembledChronology.Fields fields)
Invoked by the constructor and after deserialization to allow subclasses to define all of its supported fields.
boolean
equals(Object obj)
Checks if this chronology instance equals another.
static BuddhistChronology
getInstance()
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
getInstanceUTC()
Standard instance of a Buddhist Chronology, that matches Sun's BuddhistCalendar class.
int
hashCode()
A suitable hash code for the chronology.
String
toString()
Gets a debugging toString.
Chronology
withUTC()
Gets the Chronology in the UTC time zone.
Chronology
withZone(DateTimeZone zone)
Gets the Chronology in a specific time zone.

Methods inherited from class org.joda.time.chrono.AssembledChronology

assemble, 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

Methods inherited from class org.joda.time.chrono.BaseChronology

add, add, centuries, centuryOfEra, clockhourOfDay, clockhourOfHalfday, dayOfMonth, dayOfWeek, dayOfYear, days, era, eras, get, get, get, getDateTimeMillis, getDateTimeMillis, getDateTimeMillis, getZone, halfdayOfDay, halfdays, hourOfDay, hourOfHalfday, hours, millis, millisOfDay, millisOfSecond, minuteOfDay, minuteOfHour, minutes, monthOfYear, months, secondOfDay, secondOfMinute, seconds, set, toString, validate, weekOfWeekyear, weeks, weekyear, weekyearOfCentury, weekyears, withUTC, withZone, year, yearOfCentury, yearOfEra, years

Methods inherited from class org.joda.time.Chronology

add, add, centuries, centuryOfEra, clockhourOfDay, clockhourOfHalfday, dayOfMonth, dayOfWeek, dayOfYear, days, era, eras, get, get, get, getBuddhist, getBuddhist, getBuddhistUTC, getCoptic, getCoptic, getCopticUTC, getDateTimeMillis, getDateTimeMillis, getDateTimeMillis, getGJ, getGJ, getGJUTC, getGregorian, getGregorian, getGregorianUTC, getISO, getISO, getISOUTC, getJulian, getJulian, getJulianUTC, getZone, halfdayOfDay, halfdays, hourOfDay, hourOfHalfday, hours, millis, millisOfDay, millisOfSecond, minuteOfDay, minuteOfHour, minutes, monthOfYear, months, secondOfDay, secondOfMinute, seconds, set, toString, validate, weekOfWeekyear, weeks, weekyear, weekyearOfCentury, weekyears, withUTC, withZone, year, yearOfCentury, yearOfEra, years

Field Details

BE

public static final int BE
Constant value for 'Buddhist Era', equivalent to the value returned for AD/CE. Note that this differs from the constant in BuddhistCalendar.
Field Value:
1

Method Details

assemble

protected void assemble(AssembledChronology.Fields fields)
Invoked by the constructor and after deserialization to allow subclasses to define all of its supported fields. All unset fields default to unsupported instances.
Overrides:
assemble in interface AssembledChronology
Parameters:
fields - container of fields

equals

public boolean equals(Object obj)
Checks if this chronology instance equals another.
Parameters:
obj - the object to compare to
Returns:
true if equal
Since:
1.6

getInstance

public static BuddhistChronology 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

public static BuddhistChronology getInstance(DateTimeZone zone)
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

getInstanceUTC

public static BuddhistChronology 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.


hashCode

public int hashCode()
A suitable hash code for the chronology.
Returns:
the hash code
Since:
1.6

toString

public String toString()
Gets a debugging toString.
Overrides:
toString in interface BaseChronology
Returns:
a debugging string

withUTC

public Chronology withUTC()
Gets the Chronology in the UTC time zone.
Overrides:
withUTC in interface BaseChronology
Returns:
the chronology in UTC

withZone

public Chronology withZone(DateTimeZone zone)
Gets the Chronology in a specific time zone.
Overrides:
withZone in interface BaseChronology
Parameters:
zone - the zone to get the chronology in, null is default
Returns:
the chronology

Copyright (c) 2001-2006 - Joda.org