Top Description Fields Constructors Methods
java.time.chrono

public final Enum MinguoEra

extends Enum<MinguoEra>
implements Era
Class Inheritance
All Implemented Interfaces
java.time.chrono.Era, java.time.temporal.TemporalAdjuster, java.time.temporal.TemporalAccessor
Static Imports
java.time.temporal.ChronoField.ERA

An era in the Minguo calendar system.

The Minguo calendar system has two eras. The current era, for years from 1 onwards, is known as the 'Republic of China' 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 Republic of China' era.

Minguo years and eras
year-of-era era proleptic-year ISO proleptic-year
2ROC21913
1ROC11912
1BEFORE_ROC01911
2BEFORE_ROC-11910

Do not use ordinal() to obtain the numeric representation of MinguoEra. Use getValue() instead.

Implementation Specification

This is an immutable and thread-safe enum.

Since
1.8

Field Summary

Modifier and TypeField and Description
public static final MinguoEra
BEFORE_ROC

The singleton instance for the era before the current one, 'Before Republic of China Era', which has the numeric value 0.

public static final MinguoEra
ROC

The singleton instance for the current era, 'Republic of China Era', which has the numeric value 1.

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public String
getDisplayName(TextStyle
the style of the text required, not null
style
,
Locale
the locale to use, not null
locale
)

Overrides default java.time.chrono.Era.getDisplayName.

Gets the textual representation of this era.

public int

Returns:

the era value, from 0 (BEFORE_ROC) to 1 (ROC)
getValue
()

Implements java.time.chrono.Era.getValue.

Gets the numeric era int value.

public static MinguoEra

Returns:

the era singleton, not null
of
(int
the BEFORE_ROC/ROC value to represent, from 0 (BEFORE_ROC) to 1 (ROC)
minguoEra
)

Obtains an instance of MinguoEra from an int value.

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

Field Detail

BEFORE_ROCback to summary
public static final MinguoEra BEFORE_ROC

The singleton instance for the era before the current one, 'Before Republic of China Era', which has the numeric value 0.

ROCback to summary
public static final MinguoEra ROC

The singleton instance for the current era, 'Republic of China Era', which has the numeric value 1.

Constructor Detail

MinguoEraback to summary
private MinguoEra()

Method Detail

getDisplayNameback to summary
public String getDisplayName(TextStyle style, Locale locale)

Overrides default java.time.chrono.Era.getDisplayName.

Doc from java.time.chrono.Era.getDisplayName.

Gets the textual representation of this era.

This returns the textual name used to identify the era, suitable for presentation to the user. The parameters control the style of the returned text and the locale.

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

Parameters
style:TextStyle

the style of the text required, not null

locale:Locale

the locale to use, not null

Returns:String

the text value of the era, not null

Annotations
@Override
getValueback to summary
public int getValue()

Implements java.time.chrono.Era.getValue.

Gets the numeric era int value.

The era BEFORE_ROC has the value 0, while the era ROC has the value 1.

Returns:int

the era value, from 0 (BEFORE_ROC) to 1 (ROC)

Annotations
@Override
ofback to summary
public static MinguoEra of(int minguoEra)

Obtains an instance of MinguoEra from an int value.

MinguoEra is an enum representing the Minguo eras of BEFORE_ROC/ROC. This factory allows the enum to be obtained from the int value.

Parameters
minguoEra:int

the BEFORE_ROC/ROC value to represent, from 0 (BEFORE_ROC) to 1 (ROC)

Returns:MinguoEra

the era singleton, not null

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