java.time.chrono.Era
, java.time.temporal.TemporalAccessor
, java.time.temporal.TemporalAdjuster
public enum AccountingEra extends java.lang.Enum<AccountingEra> implements java.time.chrono.Era
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.
Enum Constant | Description |
---|---|
BCE |
The singleton instance for the era before the current one, 'Before Current Era',
which has the numeric value 0.
|
CE |
The singleton instance for the current era, 'Current Era',
which has the numeric value 1.
|
Modifier and Type | Method | Description |
---|---|---|
int |
getValue() |
Gets the numeric era
int value. |
static AccountingEra |
of(int era) |
Obtains an instance of
AccountingEra from an int value. |
static AccountingEra |
valueOf(java.lang.String name) |
Returns the enum constant of this type with the specified name.
|
static AccountingEra[] |
values() |
Returns an array containing the constants of this enum type, in
the order they are declared.
|
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
public static final AccountingEra BCE
public static final AccountingEra CE
public static AccountingEra[] values()
for (AccountingEra c : AccountingEra.values()) System.out.println(c);
public static AccountingEra valueOf(java.lang.String name)
name
- the name of the enum constant to be returned.java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is nullpublic static AccountingEra of(int era)
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.
era
- the BCE/CE value to represent, from 0 (BCE) to 1 (CE)java.time.DateTimeException
- if the value is invalidpublic int getValue()
int
value.
The era BCE has the value 0, while the era CE has the value 1.
getValue
in interface java.time.chrono.Era
Copyright © 2010–2018 ThreeTen.org. All rights reserved.