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

public final Enum JulianEra

extends Enum<JulianEra>
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 Julian calendar system.

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.

Implementation Requirements:

This is an immutable and thread-safe enum.

Field Summary

Modifier and TypeField and Description
public static final JulianEra
AD

The singleton instance for the current era, 'Anno Domini', which has the numeric value 1.

public static final JulianEra
BC

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

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public int

Returns:

the era value, from 0 (BC) to 1 (AD)
getValue
()

Implements java.time.chrono.Era.getValue.

Gets the numeric era int value.

public static JulianEra

Returns:

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

Obtains an instance of JulianEra from an int value.

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

Field Detail

BCback to summary
public static final JulianEra BC

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

Constructor Detail

JulianEraback to summary
private JulianEra()

Method Detail

getValueback to summary
public int getValue()

Implements java.time.chrono.Era.getValue.

Gets the numeric era int value.

The era BC has the value 0, while the era AD has the value 1.

Returns:int

the era value, from 0 (BC) to 1 (AD)

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

Obtains an instance of 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.

Parameters
era:int

the BC/AD value to represent, from 0 (BC) to 1 (AD)

Returns:JulianEra

the era singleton, not null

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