Package org.threeten.extra.chrono
Enum CopticEra
- All Implemented Interfaces:
Serializable,Comparable<CopticEra>,Era,TemporalAccessor,TemporalAdjuster
An era in the Coptic calendar system.
The Coptic calendar system has two eras. The current era, for years from 1 onwards, is known as the 'Era of the Martyrs'. 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 Era of the Martyrs' era.
The start of the Coptic epoch 0001-01-01 (Coptic) is 0284-08-29 (ISO).
Do not use ordinal() to obtain the numeric representation of CopticEra.
Use getValue() instead.
Implementation Requirements:
This is an immutable and thread-safe enum.-
Enum Constant Summary
Enum Constants -
Method Summary
Modifier and TypeMethodDescriptionintgetValue()Gets the numeric eraintvalue.static CopticEraof(int era) Obtains an instance ofCopticErafrom anintvalue.static CopticEraReturns the enum constant of this type with the specified name.static CopticEra[]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, valueOfMethods inherited from interface java.time.chrono.Era
adjustInto, get, getDisplayName, getLong, isSupported, query, range
-
Enum Constant Details
-
BEFORE_AM
The singleton instance for the era before the current one, 'Before Era of the Martyrs', which has the numeric value 0. -
AM
The singleton instance for the current era, 'Era of the Martyrs', which has the numeric value 1.
-
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
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.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum type has no constant with the specified nameNullPointerException- if the argument is null
-
of
Obtains an instance ofCopticErafrom anintvalue.CopticErais an enum representing the Coptic eras of BEFORE_AM/AM. This factory allows the enum to be obtained from theintvalue.- Parameters:
era- the BEFORE_AM/AM value to represent, from 0 (BEFORE_AM) to 1 (AM)- Returns:
- the era singleton, not null
- Throws:
DateTimeException- if the value is invalid
-
getValue
public int getValue()Gets the numeric eraintvalue.The era BEFORE_AM has the value 0, while the era AM has the value 1.
-