Top Description Fields Constructors Methods
org.threeten.extra.chrono

public final Enum PaxEra

extends Enum<PaxEra>
implements Era
Class Inheritance
All Implemented Interfaces
java.time.chrono.Era, java.time.temporal.TemporalAdjuster, java.time.temporal.TemporalAccessor
Imports
java.time.DateTimeException, java.time.chrono.Era

An era in the Pax calendar system.

The Pax calendar system has two eras. The current era, for years from 1 onwards, is known as 'Current Era'. All previous years, zero or earlier in the proleptic count or one and greater in the year-of-era count, are part of the 'Before Current Era' era.

The start of the Pax epoch 0001-01-01 (Pax) is 0000-12-31 (ISO).

Do not use ordinal() to obtain the numeric representation of PaxEra. Use getValue() instead.

Implementation Requirements:

This is an immutable and thread-safe enum.

Field Summary

Modifier and TypeField and Description
public static final PaxEra
BCE

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

public static final PaxEra
CE

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

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public int

Returns:

the era value, from 0 (BCE) to 1 (CE)
getValue
()

Implements java.time.chrono.Era.getValue.

Gets the numeric era int value.

public static PaxEra

Returns:

the era singleton, not null
of
(final int
the BCE/CE value to represent, from 0 (BCE) to 1 (CE)
era
)

Obtains an instance of PaxEra from an int value.

public static PaxEra
public static PaxEra[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

BCEback to summary
public static final PaxEra BCE

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

CEback to summary
public static final PaxEra CE

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

Constructor Detail

PaxEraback to summary
private PaxEra()

Method Detail

getValueback to summary
public int getValue()

Implements java.time.chrono.Era.getValue.

Gets the numeric era int value.

The era BCE has the value 0, while the era CE has the value 1.

Returns:int

the era value, from 0 (BCE) to 1 (CE)

Annotations
@Override
ofback to summary
public static PaxEra of(final int era)

Obtains an instance of PaxEra from an int value.

PaxEra is an enum representing the Pax eras of BCE/CE. This factory allows the enum to be obtained from the int value.

Parameters
era:int

the BCE/CE value to represent, from 0 (BCE) to 1 (CE)

Returns:PaxEra

the era singleton, not null

Exceptions
DateTimeException:
if the value is invalid
valueOfback to summary
public static PaxEra valueOf(String name)
valuesback to summary
public static PaxEra[] values()