- All Implemented Interfaces:
public enum AccountingEra extends Enum<AccountingEra> implements EraAn 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
Do not use
ordinal()to obtain the numeric representation of
Implementation Requirements:This is an immutable and thread-safe enum.
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description
getValue()Gets the numeric era
of(int era)Obtains an instance of
valueOf(String name)Returns the enum constant of this type with the specified name.
values()Returns an array containing the constants of this enum type, in the order they are declared.
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
Enum Constant Detail
public static final AccountingEra BCEThe singleton instance for the era before the current one, 'Before Current Era', which has the numeric value 0.
public static final AccountingEra CEThe singleton instance for the current era, 'Current Era', which has the numeric value 1.
public static AccountingEra values()Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (AccountingEra c : AccountingEra.values()) System.out.println(c);
- an array containing the constants of this enum type, in the order they are declared
public static AccountingEra valueOf(String name)Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
public static AccountingEra of(int era)Obtains an instance of
AccountingErais an enum representing the Accounting eras of BCE/CE. This factory allows the enum to be obtained from the
era- the BCE/CE value to represent, from 0 (BCE) to 1 (CE)
- the era singleton, not null
DateTimeException- if the value is invalid