public final class EastAsianMonth extends java.lang.Object implements java.lang.Comparable<EastAsianMonth>, java.io.Serializable
Represents a month used in the East Asian countries China, Korea or Japan.
This kind of month has its origins in the Chinese calendar. It is defined within the lunisolar context and sometimes allows a leap month. Such a leap month happens about every 2-3 years and has the same number as the preceding one. Therefore it is important not to leave out the leap month flag before a month number if such a month has to be printed.
However, in Japan, the East Asian month is identical to the gregorian month since Meiji 6 (1873) and does no longer make usage of any leap months.
| Modifier and Type | Field and Description |
|---|---|
static AttributeKey<java.lang.Character> |
LEAP_MONTH_INDICATOR
Format attribute which defines a symbol character for the leap month deviating from standard.
|
| Modifier and Type | Method and Description |
|---|---|
int |
compareTo(EastAsianMonth other) |
boolean |
equals(java.lang.Object obj) |
java.lang.String |
getDisplayName(java.util.Locale locale,
NumberSystem numsys)
Obtains a textual representation of this month for display purposes.
|
int |
getNumber()
Gets the corresponding numerical value which is not necessarily unique due to a possible
leap month flag.
|
java.lang.String |
getOldJapaneseName(java.util.Locale locale)
Gets the traditional Japanese month name.
|
int |
hashCode() |
boolean |
isLeap()
Is this month a lunisolar leap month?
|
java.lang.String |
toString() |
static EastAsianMonth |
valueOf(int month)
Gets the standard East Asian month which corresponds to the given numerical value.
|
EastAsianMonth |
withLeap()
Obtains the leap month version of this month.
|
public static final AttributeKey<java.lang.Character> LEAP_MONTH_INDICATOR
Format attribute which defines a symbol character for the leap month deviating from standard.
ChronoFormatter.with(AttributeKey, char)public static EastAsianMonth valueOf(int month)
Gets the standard East Asian month which corresponds to the given numerical value.
Users have to invoke the method withLeap() in order to obtain a leap month.
month - standard month in the range [1-12]java.lang.IllegalArgumentException - if given argument is out of rangepublic int getNumber()
Gets the corresponding numerical value which is not necessarily unique due to a possible leap month flag.
Lunisolar leap months have the same number as the preceding month.
isLeap()public boolean isLeap()
Is this month a lunisolar leap month?
public EastAsianMonth withLeap()
Obtains the leap month version of this month.
public java.lang.String getOldJapaneseName(java.util.Locale locale)
Gets the traditional Japanese month name.
Note: The leap month flag is ignored.
locale - language settingnull)public java.lang.String getDisplayName(java.util.Locale locale,
NumberSystem numsys)
Obtains a textual representation of this month for display purposes.
East Asian months are traditionally displayed in a numeric way. Example:
EastAsianMonth month = EastAsianMonth.valueOf(1).withLeap();
String s = month.getDisplayName(Locale.ENGLISH, NumberSystem.ARABIC);
System.out.println(s); // output with leap-indicator "i": i1
The leap indicator is locale-sensitive. Time4J uses the asterisk as default, but for the major European languages with some affinity to Latin also the small letter "i" (intercalary). The East Asian languages Japanese, Chinese and Korean have their own special characters.
locale - language settingnumsys - number systemnull)public int compareTo(EastAsianMonth other)
compareTo in interface java.lang.Comparable<EastAsianMonth>public boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Object