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

public final Enum AccountingEra

extends Enum<AccountingEra>
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 Accounting calendar system.

The Accounting calendar system has two eras. The current era, for years from 1 onwards, is known as the '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 accounting epochs 0001-01-01 (Accounting) will vary against the ISO calendar. Depending on options chosen, it can start as early as 0000-01-26 (ISO) or as late as 0001-01-04 (ISO).

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

Implementation Requirements:

This is an immutable and thread-safe enum.

Field Summary

Modifier and TypeField and Description
public static final AccountingEra
BCE

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

public static final AccountingEra
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 AccountingEra

Returns:

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

Obtains an instance of AccountingEra from an int value.

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

Field Detail

BCEback to summary
public static final AccountingEra 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 AccountingEra CE

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

Constructor Detail

AccountingEraback to summary
private AccountingEra()

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 AccountingEra of(int era)

Obtains an instance of AccountingEra from an int value.

AccountingEra is an enum representing the Accounting 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:AccountingEra

the era singleton, not null

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