Enum Class SolarTerm
- All Implemented Interfaces:
Serializable
,Comparable<SolarTerm>
,java.lang.constant.Constable
See also Wikipedia.
- Since:
- 3.40/4.35
- Author:
- Meno Hochschild
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantDescriptionSolar longitude 330.Solar longitude 0.Solar longitude 30.Solar longitude 60.Solar longitude 90.Solar longitude 120.Solar longitude 150.Solar longitude 180.Solar longitude 210.Solar longitude 240.Solar longitude 270.Solar longitude 300.Solar longitude 315.Solar longitude 345.Solar longitude 15.Solar longitude 45.Solar longitude 75.Solar longitude 105.Solar longitude 135.Solar longitude 165.Solar longitude 195.Solar longitude 225.Solar longitude 255.Solar longitude 285. -
Method Summary
Modifier and TypeMethodDescriptiongetDisplayName(Locale locale)
Gets the description text dependent on the locale.int
getIndex()
Obtains the associated index according to the traditional order in the Chinese calendar.int
Obtains the associated solar longitude in degrees.boolean
isMajor()
Does this instance represent a principal (major) solar term in multiples of 30 degrees?boolean
isMinor()
Does this instance represent a minor solar term?static <D extends EastAsianCalendar<?, D>>
List<D>list(int gregorianYear, Chronology<D> chronology)
Obtains a list of dates of all solar terms beginning with Lichun in spring of given gregorian year.static SolarTerm
Obtains an instance ofSolarTerm
at given moment.static SolarTerm
ofMajor(int index)
Obtains a majorSolarTerm
by given index according to the traditional order in the Chinese calendar.static SolarTerm
ofMinor(int index)
Obtains a minorSolarTerm
by given index according to the traditional order in the Chinese calendar.<D extends EastAsianCalendar<?, D>>
DonOrAfter(D date)
Determines the date when this solar term will happen on or after given date.static SolarTerm
parse(CharSequence text, Locale locale)
Tries to interprete given text as solar term.roll(int amount)
Rolls this instance by given amount of solar terms.<D extends EastAsianCalendar<?, D>>
ChronoOperator<D>Obtains an operator which searches for this solar term on or after Lichun event in the gregorian year corresponding to the East Asian calendar date in question.<D extends EastAsianCalendar<?, D>>
ChronoOperator<D>Obtains an operator which searches for this solar term on or after New Year of the East Asian calendar date in question.static SolarTerm
Returns the enum constant of this class with the specified name.static SolarTerm[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.Methods inherited from class java.lang.Enum
compareTo, describeConstable, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
-
Enum Constant Details
-
MINOR_01_LICHUN_315
Solar longitude 315. Around February 4. Meaning: Beginning of Spring. -
MAJOR_01_YUSHUI_330
Solar longitude 330. Around February 19. Meaning: Rain Water. -
MINOR_02_JINGZHE_345
Solar longitude 345. Around March 6. Meaning: Waking of Insects. -
MAJOR_02_CHUNFEN_000
Solar longitude 0. Around March 21. Meaning: Vernal Equinox. -
MINOR_03_QINGMING_015
Solar longitude 15. Around April 5. Meaning: Pure Brightness. -
MAJOR_03_GUYU_030
Solar longitude 30. Around April 20. Meaning: Grain Rain. -
MINOR_04_LIXIA_045
Solar longitude 45. Around May 6. Meaning: Beginning of Summer. -
MAJOR_04_XIAOMAN_060
Solar longitude 60. Around May 21. Meaning: Grain Full. -
MINOR_05_MANGZHONG_075
Solar longitude 75. Around June 6. Meaning: Grain in Ear. -
MAJOR_05_XIAZHI_090
Solar longitude 90. Around June 21. Meaning: Summer Solstice. -
MINOR_06_XIAOSHU_105
Solar longitude 105. Around July 7. Meaning: Slight Heat. -
MAJOR_06_DASHU_120
Solar longitude 120. Around July 23. Meaning: Great Heat. -
MINOR_07_LIQIU_135
Solar longitude 135. Around August 8. Meaning: Beginning of Autumn. -
MAJOR_07_CHUSHU_150
Solar longitude 150. Around August 23. Meaning: Limit of Heat. -
MINOR_08_BAILU_165
Solar longitude 165. Around September 8. Meaning: White Dew. -
MAJOR_08_QIUFEN_180
Solar longitude 180. Around September 23. Meaning: Autumnal Equinox. -
MINOR_09_HANLU_195
Solar longitude 195. Around October 8. Meaning: Cold Dew. -
MAJOR_09_SHUANGJIANG_210
Solar longitude 210. Around October 24. Meaning: Descent of Frost. -
MINOR_10_LIDONG_225
Solar longitude 225. Around November 8. Meaning: Beginning of Winter. -
MAJOR_10_XIAOXUE_240
Solar longitude 240. Around November 22. Meaning: Slight Snow. -
MINOR_11_DAXUE_255
Solar longitude 255. Around December 7. Meaning: Great Snow. -
MAJOR_11_DONGZHI_270
Solar longitude 270. Around December 22. Meaning: Winter Solstice. -
MINOR_12_XIAOHAN_285
Solar longitude 285. Around January 6. Meaning: Slight Cold. -
MAJOR_12_DAHAN_300
Solar longitude 300. Around January 20. Meaning: Great Cold.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (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 class has no constant with the specified nameNullPointerException
- if the argument is null
-
ofMajor
Obtains a major
SolarTerm
by given index according to the traditional order in the Chinese calendar.- Parameters:
index
- an integer in range1-12
- Returns:
- SolarTerm
- Throws:
IllegalArgumentException
- if the index is out of range
-
ofMinor
Obtains a minor
SolarTerm
by given index according to the traditional order in the Chinese calendar.- Parameters:
index
- an integer in range1-12
- Returns:
- SolarTerm
- Throws:
IllegalArgumentException
- if the index is out of range
-
of
Obtains an instance of
SolarTerm
at given moment.- Parameters:
moment
- the moment for which the solar term needs to be searched- Returns:
- SolarTerm
- Throws:
IllegalArgumentException
- if the Julian day of moment is not in supported range- See Also:
JulianDay.MIN
,JulianDay.MAX
-
getIndex
public int getIndex()Obtains the associated index according to the traditional order in the Chinese calendar.
The index itself is not unique because a solar term must be qualified by the major/minor-property, too.
-
isMajor
public boolean isMajor()Does this instance represent a principal (major) solar term in multiples of 30 degrees?
- Returns:
- boolean
- See Also:
isMinor()
-
isMinor
public boolean isMinor()Does this instance represent a minor solar term?
- Returns:
- boolean
- See Also:
isMajor()
-
getSolarLongitude
public int getSolarLongitude()Obtains the associated solar longitude in degrees.
- Returns:
- angle in degrees (range
0 <= angle < 360
)
-
roll
Rolls this instance by given amount of solar terms.
- Parameters:
amount
- count of solar terms (maybe negative)- Returns:
- result of rolling operation
-
onOrAfter
Determines the date when this solar term will happen on or after given date.
- Type Parameters:
D
- type of the East Asian chronology to be applied- Parameters:
date
- the starting date of the search for this solar term- Returns:
- resulting date when this solar term will happen first
-
list
public static <D extends EastAsianCalendar<?, D>> List<D> list(int gregorianYear, Chronology<D> chronology)Obtains a list of dates of all solar terms beginning with Lichun in spring of given gregorian year.
Note: The returned list of solar terms might cover different calendar years because the solar cycle is generally different from the lunar calendar cycle.
- Type Parameters:
D
- type of the East Asian chronology to be applied- Parameters:
gregorianYear
- the gregorian year in which the first solar term Lichun occurschronology
- chronology for generating the calendar dates of the list- Returns:
- list of calendar dates of all solar terms starting with Lichun in spring of given gregorian year
- Since:
- 5.8
- See Also:
MINOR_01_LICHUN_315
,onOrAfter(D)
-
sinceLichun
Obtains an operator which searches for this solar term on or after Lichun event in the gregorian year corresponding to the East Asian calendar date in question.
Example:
ChineseCalendar chineseNewYear = ChineseCalendar.ofNewYear(2021); // 2021-02-12 assertThat( chineseNewYear.with(SolarTerm.MINOR_01_LICHUN_315.sinceLichun()).transform(PlainDate.class), is(PlainDate.of(2021, 2, 3)));
- Type Parameters:
D
- type of the East Asian chronology to be applied- Returns:
- ChronoOperator applicable on all dates of given chronological type
- Since:
- 5.8
- See Also:
sinceNewYear()
-
sinceNewYear
Obtains an operator which searches for this solar term on or after New Year of the East Asian calendar date in question.
Example:
ChineseCalendar chineseNewYear = ChineseCalendar.ofNewYear(2021); // 2021-02-12 assertThat( chineseNewYear.with(SolarTerm.MINOR_01_LICHUN_315.sinceNewYear()).transform(PlainDate.class), is(PlainDate.of(2022, 2, 4)));
This operator is related to East Asian calendar years and not to the usually different solar term cycles starting at Lichun. Some East Asian calendar years might contain the given solar term even twice or not at all. In first case (if the given solar term occurs twice in corresponding East Asian calendar year), the operator will determine the first and not the second occurence of solar term. If the East Asian calendar year does not contain given solar term then the operator will yield the solar term of next calendar year (see code example above).
- Type Parameters:
D
- type of the East Asian chronology to be applied- Returns:
- ChronoOperator applicable on all dates of given chronological type
- Since:
- 5.8
- See Also:
sinceLichun()
-
getDisplayName
Gets the description text dependent on the locale.
- Parameters:
locale
- language setting- Returns:
- descriptive text (long form, never
null
)
-
parse
Tries to interprete given text as solar term.
- Parameters:
text
- the text to be parsedlocale
- language setting- Returns:
- the parsed solar term if successful
- Throws:
ParseException
- if parsing fails
-