public enum JulianEra extends Enum<JulianEra> implements java.time.chrono.Era
The Julian calendar system has two eras. The current era, for years from 1 onwards, is known as 'Anno Domini'. 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 Christ' era.
The start of the Julian epoch 0001-01-01 (Julian)
is 0000-12-30 (ISO)
.
Do not use ordinal()
to obtain the numeric representation of JulianEra
.
Use getValue()
instead.
Enum Constant and Description |
---|
AD
The singleton instance for the current era, 'Anno Domini',
which has the numeric value 1.
|
BC
The singleton instance for the era before the current one, 'Before Christ',
which has the numeric value 0.
|
Modifier and Type | Method and Description |
---|---|
int |
getValue()
Gets the numeric era
int value. |
static JulianEra |
of(int era)
Obtains an instance of
JulianEra from an int value. |
static JulianEra |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static JulianEra[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final JulianEra BC
public static final JulianEra AD
public static JulianEra[] values()
for (JulianEra c : JulianEra.values()) System.out.println(c);
public static JulianEra valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullpublic static JulianEra of(int era)
JulianEra
from an int
value.
JulianEra
is an enum representing the Julian eras of BC/AD.
This factory allows the enum to be obtained from the int
value.
era
- the BC/AD value to represent, from 0 (BC) to 1 (AD)java.time.DateTimeException
- if the value is invalidpublic int getValue()
int
value.
The era BC has the value 0, while the era AD has the value 1.
getValue
in interface java.time.chrono.Era
Copyright © 2010–2014 ThreeTen.org. All rights reserved.