C - the chronology of the erapublic interface Era<C extends Chrono<C>> extends TemporalAccessor, TemporalAdjuster
Most calendar systems have a single epoch dividing the time-line into two eras.
However, some calendar systems, have multiple eras, such as one for the reign
of each leader.
In all cases, the era is conceptually the largest division of the time-line.
Each chronology defines the Era's that are known Eras and a
Chrono.eras to get the valid eras.
For example, the Thai Buddhist calendar system divides time into two eras, before and after a single date. By contrast, the Japanese calendar system has one era for the reign of each Emperor.
Instances of Era may be compared using the == operator.
| Modifier and Type | Method and Description |
|---|---|
ChronoLocalDate<C> |
date(int yearOfEra,
int month,
int day)
Obtains a date in this era given the year-of-era, month, and day.
|
ChronoLocalDate<C> |
dateYearDay(int yearOfEra,
int dayOfYear)
Obtains a date in this era given year-of-era and day-of-year fields.
|
C |
getChrono()
Gets the chronology of this era.
|
String |
getText(TextStyle style,
Locale locale)
Gets the textual representation of this era.
|
int |
getValue()
Gets the numeric value associated with the era as defined by the chronology.
|
get, getLong, isSupported, query, rangeadjustIntoint getValue()
All fields, including eras, have an associated numeric value. The meaning of the numeric value for era is determined by the chronology according to these principles:
C getChrono()
The Chrono represents the calendar system in use.
This always returns the standard form of the chronology.
ChronoLocalDate<C> date(int yearOfEra, int month, int day)
This era is combined with the given date fields to form a date.
The year specified must be the year-of-era.
Methods to create a date from the proleptic-year are on Chrono.
This always uses the standard form of the chronology.
yearOfEra - the calendar system year-of-eramonth - the calendar system month-of-yearday - the calendar system day-of-monthChronoLocalDate<C> dateYearDay(int yearOfEra, int dayOfYear)
This era is combined with the given date fields to form a date.
The year specified must be the year-of-era.
Methods to create a date from the proleptic-year are on Chrono.
This always uses the standard form of the chronology.
yearOfEra - the calendar system year-of-eradayOfYear - the calendar system day-of-yearString getText(TextStyle style, Locale locale)
This returns the textual name used to identify the era. The parameters control the style of the returned text and the locale.
If no textual mapping is found then the numeric value is returned.
style - the style of the text required, not nulllocale - the locale to use, not nullCopyright © 2007-2013 ThreeTen.org. All Rights Reserved.