public final class CyclicYear extends SexagesimalName
Represents the cyclic year used in East Asian calendars.
SexagesimalName.Branch, SexagesimalName.Stem| Modifier and Type | Method and Description |
|---|---|
EastAsianYear |
inCycle(int cycle)
Obtains a year reference for given cycle number (technical identifier).
|
EastAsianYear |
inQingDynasty(ChineseEra era)
Obtains an unambivalent year reference for given Qing dynasty.
|
static CyclicYear |
of(int yearOfCycle)
Obtains an instance of cyclic year.
|
static CyclicYear |
of(SexagesimalName.Stem stem,
SexagesimalName.Branch branch)
Obtains an instance of cyclic year.
|
static CyclicYear |
parse(String text,
Locale locale)
Parses the given localized name as a combination of stem and branch to a cyclic year.
|
CyclicYear |
roll(int amount)
Rolls this cyclic year by given amount.
|
compareTo, equals, getBranch, getDisplayName, getNumber, getStem, getZodiac, hashCode, toStringpublic static CyclicYear of(int yearOfCycle)
Obtains an instance of cyclic year.
yearOfCycle - year number in the range 1-60IllegalArgumentException - if the parameter is out of rangepublic static CyclicYear of(SexagesimalName.Stem stem, SexagesimalName.Branch branch)
Obtains an instance of cyclic year.
stem - celestial stembranch - terrestrial branchIllegalArgumentException - if the combination of stem and branch is invalidpublic static CyclicYear parse(String text, Locale locale) throws ParseException
Parses the given localized name as a combination of stem and branch to a cyclic year.
The original Chinese names are usually not translatable. A few languages like Korean, Vietnamese and Russian use their own transcriptions. The pinyin-transcription (official Chinese romanization) serves as fallback for other languages. And the root locale will use a simplified version of pinyin without diacritic accents. This method will always expect a minus sign as separator between stem and branch unless the language is Chinese, Korean or Japanese.
text - the text to be parsedlocale - languageParseException - if the text cannot be parsedSexagesimalName.getDisplayName(Locale)public CyclicYear roll(int amount)
Rolls this cyclic year by given amount.
roll in class SexagesimalNameamount - determines how many years/units this instance should be rolledpublic EastAsianYear inQingDynasty(ChineseEra era)
Obtains an unambivalent year reference for given Qing dynasty.
Note: The years AD 1662 and AD 1722 have the same cyclic year so an unambivalent year reference cannot be determined. This is because the Kangxi-era was 61 years long.
era - the Chinese era representing a historic Qing dynastyIllegalArgumentException - if the era is not a Qing dynasty or if the combination of this cyclic year
together with the era is ambivalent (rare case in QING_KANGXI_1662_1723)public EastAsianYear inCycle(int cycle)
Obtains a year reference for given cycle number (technical identifier).
cycle - number of sexagesimal year cycleIllegalArgumentException - if the cycle is smaller than 1Copyright © 2014–2021. All rights reserved.