public final class BuddhistChronology extends AssembledChronology
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.
AssembledChronology.Fields
Modifier and Type | Field and Description |
---|---|
static int |
BE
Constant value for 'Buddhist Era', equivalent to the value returned
for AD/CE.
|
private static int |
BUDDHIST_OFFSET
Number of years difference in calendars.
|
private static java.util.concurrent.ConcurrentHashMap<DateTimeZone,BuddhistChronology> |
cCache
Cache of zone to chronology
|
private static DateTimeField |
ERA_FIELD
A singleton era field.
|
private static BuddhistChronology |
INSTANCE_UTC
UTC instance of the chronology
|
private static long |
serialVersionUID
Serialization lock
|
Modifier | Constructor and Description |
---|---|
private |
BuddhistChronology(Chronology base,
java.lang.Object param)
Restricted constructor.
|
Modifier and Type | Method and Description |
---|---|
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(java.lang.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.
|
private java.lang.Object |
readResolve()
Serialization singleton
|
java.lang.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.
|
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
private static final long serialVersionUID
public static final int BE
private static final DateTimeField ERA_FIELD
private static final int BUDDHIST_OFFSET
private static final java.util.concurrent.ConcurrentHashMap<DateTimeZone,BuddhistChronology> cCache
private static final BuddhistChronology INSTANCE_UTC
private BuddhistChronology(Chronology base, java.lang.Object param)
param
- if non-null, then don't change the field setpublic static BuddhistChronology getInstanceUTC()
The time zone of the returned instance is UTC.
public static BuddhistChronology getInstance()
public static BuddhistChronology getInstance(DateTimeZone zone)
zone
- the time zone to use, null is defaultprivate java.lang.Object readResolve()
public Chronology withUTC()
withUTC
in class BaseChronology
public Chronology withZone(DateTimeZone zone)
withZone
in class BaseChronology
zone
- the zone to get the chronology in, null is defaultZonedChronology
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
obj
- the object to compare topublic int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class BaseChronology
protected void assemble(AssembledChronology.Fields fields)
AssembledChronology
assemble
in class AssembledChronology
fields
- container of fields