The main date and time API is built on the ISO calendar system. The chronology operates behind the scenes to represent the general concept of a calendar system.
See Chronology
for more details.
Implementation Specification
This class is separated from the Chronology
interface so that the static methods
are not inherited. While Chronology
can be implemented directly, it is strongly
recommended to extend this abstract class instead.
This class must be implemented with care to ensure other classes operate correctly. All implementations that can be instantiated must be final, immutable and thread-safe. Subclasses should be Serializable wherever possible.
Modifier and Type | Field and Description |
---|---|
private static final ConcurrentHashMap | CHRONOS_BY_ID
Map of available calendars by ID. |
private static final ConcurrentHashMap | CHRONOS_BY_TYPE
Map of available calendars by calendar type. |
Access | Constructor and Description |
---|---|
protected |
Modifier and Type | Method and Description |
---|---|
pack-priv void | addFieldValue(Map<TemporalField, Long> fieldValues, ChronoField
the field to add, not null field, long the value to add, not null value)Adds a field-value pair to the map, checking for conflicts. |
public int | Returns: the comparator value, that is this ID string compared with theother 's ID stringthe other chronology to compare to, not null other)Implements java. Compares this chronology to another chronology. |
public boolean | Returns: true if this is equal to the other chronologythe object to check, null returns false obj)Overrides java. Implements java. Checks if this chronology is equal to another chronology. |
pack-priv static Set | Returns: the independent, modifiable set of the available chronology IDs, not nullHides java. Returns the available chronologies. |
public int | Returns: a suitable hash codeOverrides java. Implements java. A hash code for this chronology. |
private static boolean | Returns: true if the cache was initializedInitialization of the maps from id and type to Chronology. |
pack-priv static Chronology | Returns: the chronology with the identifier requested, not nullthe chronology ID or calendar system type, not null id)Hides java. Obtains an instance of |
private static Chronology | |
pack-priv static Chronology | Returns: the calendar system associated with the locale, not nullthe locale to use to obtain the calendar system, not null locale)Hides java. Obtains an instance of |
pack-priv static Chronology | |
private void | |
pack-priv static Chronology | Returns: the already registered Chronology if any, may be nullthe chronology to register; not null chrono)Register a Chronology by its ID and type for lookup by |
pack-priv static Chronology | Returns: the already registered Chronology if any, may be nullthe chronology to register; not null chrono, String the ID to register the chronology; not null id)Register a Chronology by ID and type for lookup by |
pack-priv ChronoLocalDate | |
public ChronoLocalDate | Returns: the resolved date, null if insufficient information to create a datethe map of fields to values, which can be updated, not null fieldValues, ResolverStyle the requested type of resolve, not null resolverStyle)Implements java. Resolves parsed |
pack-priv void | |
pack-priv ChronoLocalDate | |
pack-priv ChronoLocalDate | |
pack-priv ChronoLocalDate | |
pack-priv ChronoLocalDate | |
pack-priv ChronoLocalDate | |
pack-priv ChronoLocalDate | |
pack-priv ChronoLocalDate | |
public String | Returns: a string representation of this chronology, not nullOverrides java. Implements java. Outputs this chronology as a |
pack-priv void | |
pack-priv Object | Returns: the instance ofSer , not nullWrites the Chronology using a dedicated serialized form. |
CHRONOS_BY_ID | back to summary |
---|---|
private static final ConcurrentHashMap<String, Chronology> CHRONOS_BY_ID Map of available calendars by ID. |
CHRONOS_BY_TYPE | back to summary |
---|---|
private static final ConcurrentHashMap<String, Chronology> CHRONOS_BY_TYPE Map of available calendars by calendar type. |
AbstractChronology | back to summary |
---|---|
protected AbstractChronology() Creates an instance. |
addFieldValue | back to summary |
---|---|
pack-priv void addFieldValue(Map<TemporalField, Long> fieldValues, ChronoField field, long value) Adds a field-value pair to the map, checking for conflicts. If the field is not already present, then the field-value pair is added to the map. If the field is already present and it has the same value as that specified, no action occurs. If the field is already present and it has a different value to that specified, then an exception is thrown.
|
compareTo | back to summary |
---|---|
public int compareTo(Chronology other) Implements java. Compares this chronology to another chronology.
The comparison order first by the chronology ID string, then by any
additional information specific to the subclass.
It is "consistent with equals", as defined by Implementation Specification This implementation compares the chronology ID. Subclasses must compare any additional state that they store.
|
equals | back to summary |
---|---|
public boolean equals(Object obj) Overrides java. Implements java. Checks if this chronology is equal to another chronology. The comparison is based on the entire state of the object. Implementation Specification This implementation checks the type and calls
|
getAvailableChronologies | back to summary |
---|---|
pack-priv static Set Hides java. Returns the available chronologies.
Each returned
|
hashCode | back to summary |
---|---|
public int hashCode() Overrides java. Implements java. A hash code for this chronology. The hash code should be based on the entire state of the object. Implementation Specification This implementation is based on the chronology ID and class. Subclasses should add any additional state that they store.
|
initCache | back to summary |
---|---|
private static boolean initCache() Initialization of the maps from id and type to Chronology.
The ServiceLoader is used to find and register any implementations
of The initialization is done only once using the registration of the IsoChronology as the test and the final step. Multiple threads may perform the initialization concurrently. Only the first registration of each Chronology is retained by the ConcurrentHashMap.
|
of | back to summary |
---|---|
pack-priv static Chronology of(String id) Hides java. Obtains an instance of
|
of0 | back to summary |
---|---|
private static Chronology of0(String id) Obtains an instance of
|
ofLocale | back to summary |
---|---|
pack-priv static Chronology ofLocale(Locale locale) Hides java. Obtains an instance of
See
|
readExternal | back to summary |
---|---|
pack-priv static Chronology readExternal(DataInput in) throws IOException |
readObject | back to summary |
---|---|
private void readObject(ObjectInputStream s) throws ObjectStreamException Defend against malicious streams.
|
registerChrono | back to summary |
---|---|
pack-priv static Chronology registerChrono(Chronology chrono) Register a Chronology by its ID and type for lookup by
|
registerChrono | back to summary |
---|---|
pack-priv static Chronology registerChrono(Chronology chrono, String id) Register a Chronology by ID and type for lookup by
|
resolveAligned | back to summary |
---|---|
pack-priv ChronoLocalDate resolveAligned(ChronoLocalDate base, long months, long weeks, long dow) |
resolveDate | back to summary |
---|---|
public ChronoLocalDate resolveDate(Map<TemporalField, Long> fieldValues, ResolverStyle resolverStyle) Implements java. Resolves parsed
Most
The default implementation is suitable for most calendar systems.
If
|
resolveProlepticMonth | back to summary |
---|---|
pack-priv void resolveProlepticMonth(Map<TemporalField, Long> fieldValues, ResolverStyle resolverStyle) |
resolveYAA | back to summary |
---|---|
pack-priv ChronoLocalDate resolveYAA(Map<TemporalField, Long> fieldValues, ResolverStyle resolverStyle) |
resolveYAD | back to summary |
---|---|
pack-priv ChronoLocalDate resolveYAD(Map<TemporalField, Long> fieldValues, ResolverStyle resolverStyle) |
resolveYD | back to summary |
---|---|
pack-priv ChronoLocalDate resolveYD(Map<TemporalField, Long> fieldValues, ResolverStyle resolverStyle) |
resolveYearOfEra | back to summary |
---|---|
pack-priv ChronoLocalDate resolveYearOfEra(Map<TemporalField, Long> fieldValues, ResolverStyle resolverStyle) |
resolveYMAA | back to summary |
---|---|
pack-priv ChronoLocalDate resolveYMAA(Map<TemporalField, Long> fieldValues, ResolverStyle resolverStyle) |
resolveYMAD | back to summary |
---|---|
pack-priv ChronoLocalDate resolveYMAD(Map<TemporalField, Long> fieldValues, ResolverStyle resolverStyle) |
resolveYMD | back to summary |
---|---|
pack-priv ChronoLocalDate resolveYMD(Map<TemporalField, Long> fieldValues, ResolverStyle resolverStyle) |
toString | back to summary |
---|---|
public String toString() Overrides java. Implements java. Outputs this chronology as a |
writeExternal | back to summary |
---|---|
pack-priv void writeExternal(DataOutput out) throws IOException |
writeReplace | back to summary |
---|---|
pack-priv Object writeReplace() Writes the Chronology using a dedicated serialized form. out.writeByte(1); // identifies this as a Chronology out.writeUTF(getId()); |