javax.time.i18n
Enum CopticEra

java.lang.Object
  extended by java.lang.Enum<CopticEra>
      extended by javax.time.i18n.CopticEra
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<CopticEra>, Era

public enum CopticEra
extends java.lang.Enum<CopticEra>
implements Era

An era in the Coptic calendar system.

The Coptic calendar system uses the 'Era of the Martyrs'. 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.

This is an immutable and thread-safe enum.

Author:
Stephen Colebourne

Enum Constant Summary
AM
          The singleton instance for the era EM - 'Era of the Martyrs'.
BAM
          The singleton instance for the era BAM - 'Before Era of the Martyrs'.
 
Method Summary
 java.lang.String getText(TextStyle style, java.util.Locale locale)
          Gets the textual representation, such as 'BEM' or 'EM'.
 int getValue()
          Gets the numeric era int value.
static CopticEra of(int era)
          Obtains an instance of HistoricEra from an int value.
static CopticEra valueOf(java.lang.String name)
          Returns 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, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

BAM

public static final CopticEra BAM
The singleton instance for the era BAM - 'Before Era of the Martyrs'. This has the numeric value of 0.


AM

public static final CopticEra AM
The singleton instance for the era EM - 'Era of the Martyrs'. This has the numeric value of 1.

Method Detail

values

public static CopticEra[] 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 (CopticEra c : CopticEra.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static CopticEra valueOf(java.lang.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.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
java.lang.NullPointerException - if the argument is null

of

public static CopticEra of(int era)
Obtains an instance of HistoricEra from an int value.

HistoricEra is an enum representing the historic eras of BCE/CE. This factory allows the enum to be obtained from the int value. The int value follows Calendar, assigning 0 to BCE and 1 to CE.

An exception is thrown if the value is invalid. The exception uses the ISOChronology BCE/CE rule to indicate the failed rule.

Parameters:
era - the BCE/CE value to represent, from 0 (BCE) to 1 (CE)
Returns:
the HistoricEra singleton, not null
Throws:
IllegalCalendarFieldValueException - if the value is invalid

getValue

public int getValue()
Gets the numeric era int value.

The era BAM has the value 0, while the era AM has the value 1.

Specified by:
getValue in interface Era
Returns:
the era value, from 0 (BAM) to 1 (AM)

getText

public java.lang.String getText(TextStyle style,
                                java.util.Locale locale)
Gets the textual representation, such as 'BEM' or 'EM'.

If no textual mapping is found then the numeric value is returned.

Parameters:
locale - the locale to use, not null
Returns:
the short text value of the month-of-year, not null