IsoEra

An era _in the ISO calendar system. !(p) The ISO-8601 standard does not define eras. A definition has therefore been created with two eras - 'Current era' (CE) for years on or after 0001-01-01 (ISO), and 'Before current era' (BCE) for years before that.

<table class="striped" style="text-align:left"> <caption style="display:none">ISO years and eras</caption> !(thead) !(tr) <th scope="col">year-of-era</th> <th scope="col">era</th> <th scope="col">proleptic-year</th> </tr> </thead> !(tbody) !(tr) !(td)2</td>!(td)CE</td><th scope="row">2</th> </tr> !(tr) !(td)1</td>!(td)CE</td><th scope="row">1</th> </tr> !(tr) !(td)1</td>!(td)BCE</td><th scope="row">0</th> </tr> !(tr) !(td)2</td>!(td)BCE</td><th scope="row">-1</th> </tr> </tbody> </table> !(p) !(b)Do not use {@code ordinal()} to obtain the numeric representation of {@code IsoEra}. Use {@code getValue()} instead.</b>

@implSpec This is an immutable and thread-safe enum.

@since 1.8

Constructors

this
this(int ordinal)
Undocumented in source.

Members

Functions

adjustInto
Temporal adjustInto(Temporal temporal)
Undocumented in source. Be warned that the author may not have intended to support it.
get
int get(TemporalField field)
Undocumented in source. Be warned that the author may not have intended to support it.
getLong
long getLong(TemporalField field)
Undocumented in source. Be warned that the author may not have intended to support it.
getValue
int getValue()

Gets the numeric era {@code int} value. !(p) The era BCE has the value 0, while the era CE has the value 1.

isSupported
bool isSupported(TemporalField field)
Undocumented in source. Be warned that the author may not have intended to support it.
ordinal
int ordinal()
Undocumented in source. Be warned that the author may not have intended to support it.
range
ValueRange range(TemporalField field)
Undocumented in source. Be warned that the author may not have intended to support it.
super_get
int super_get(TemporalField field)
Undocumented in source. Be warned that the author may not have intended to support it.
super_range
ValueRange super_range(TemporalField field)
Undocumented in source. Be warned that the author may not have intended to support it.
toString
string toString()
Undocumented in source. Be warned that the author may not have intended to support it.

Static functions

of
IsoEra of(int isoEra)

Obtains an instance of {@code IsoEra} from an {@code int} value. !(p) {@code IsoEra} is an enum representing the ISO eras of BCE/CE. This factory allows the enum to be obtained from the {@code int} value.

Static variables

BCE
IsoEra BCE;

The singleton instance for the era before the current one, 'Before Current Era', which has the numeric value 0.

CE
IsoEra CE;

The singleton instance for the current era, 'Current Era', which has the numeric value 1.

Inherited Members

From Era

getValue
int getValue()

Gets the numeric value associated with the era as defined by the chronology. Each chronology defines the predefined Eras and methods to list the Eras of the chronology. !(p) 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: !(ul) !(li)The era _in use at the epoch 1970-01-01 (ISO) has the value 1. !(li)Later eras have sequentially higher values. !(li)Earlier eras have sequentially lower values, which may be negative. </ul>

query
R query(TemporalQuery!(R) query)

Queries this era using the specified query. !(p) This queries this era using the specified query strategy object. The {@code TemporalQuery} object defines the logic to be used to obtain the result. Read the documentation of the query to understand what the result of this method will be. !(p) The result of this method is obtained by invoking the {@link TemporalQuery#queryFrom(TemporalAccessor)} method on the specified query passing {@code this} as the argument.

super_query
R super_query(TemporalQuery!(R) query)
Undocumented in source. Be warned that the author may not have intended to support it.
toString
string toString()

Gets the textual representation of this era. !(p) This returns the textual name used to identify the era, suitable for presentation to the user. The parameters control the style of the returned text and the locale. !(p) If no textual mapping is found then the {@link #getValue() numeric value} is returned.

Meta