Enum Class SolarTerm
- All Implemented Interfaces:
Serializable, Comparable<SolarTerm>, Constable
Solar Terms (二十四节气) enumeration
二十四节气枚举
The 24 solar terms are a calendar of 24 periods used in traditional East Asian calendars to govern such activities as farming.
二十四节气是传统东亚历法中用于指导农业等活动的24个时期。
Features | 主要功能:
- 24 solar terms enumeration - 二十四节气枚举
- Chinese and English names - 中英文名称
- Solar longitude values - 太阳黄经值
- Seasonal grouping - 季节分组
Usage Examples | 使用示例:
SolarTerm term = SolarTerm.LICHUN;
String name = term.getChineseName(); // "立春"
int index = term.getIndex(); // 0
Security | 安全性:
- Thread-safe: Yes (enum is inherently thread-safe) - 线程安全: 是(枚举本身是线程安全的)
- Immutable: Yes - 不可变: 是
- Since:
- JDK 25, opencode-base-date V1.0.0
- Author:
- Leon Soo www.LeonSoo.com
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class Enum
Enum.EnumDesc<E> -
Enum Constant Summary
Enum Constants -
Method Summary
Modifier and TypeMethodDescriptionstatic SolarTermfromChineseName(String chineseName) Gets the solar term by Chinese name 按中文名称获取节气Gets the Chinese name 获取中文名称Gets the English name 获取英文名称intgetIndex()Gets the index (0-23) 获取索引(0-23)intGets the season of this solar term 获取此节气所属季节Gets the season name in Chinese 获取季节的中文名称doubleGets the sun longitude in degrees 获取太阳黄经度数booleanChecks if this is a major solar term (中气) 检查是否为中气booleanChecks if this is a minor solar term (节气) 检查是否为节气(小节气)next()Gets the next solar term 获取下一个节气static SolarTermof(int index) Gets the solar term by index (0-23) 按索引获取节气(0-23)previous()Gets the previous solar term 获取上一个节气toString()static SolarTermReturns 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.
-
Enum Constant Details
-
LICHUN
-
YUSHUI
-
JINGZHE
-
CHUNFEN
-
QINGMING
-
GUYU
-
LIXIA
-
XIAOMAN
-
MANGZHONG
-
XIAZHI
-
XIAOSHU
-
DASHU
-
LIQIU
-
CHUSHU
-
BAILU
-
QIUFEN
-
HANLU
-
SHUANGJIANG
-
LIDONG
-
XIAOXUE
-
DAXUE
-
DONGZHI
-
XIAOHAN
-
DAHAN
-
-
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
-
of
Gets the solar term by index (0-23) 按索引获取节气(0-23)- Parameters:
index- the index | 索引- Returns:
- the solar term | 节气
-
fromChineseName
-
getIndex
public int getIndex()Gets the index (0-23) 获取索引(0-23)- Returns:
- the index | 索引
-
getChineseName
-
getEnglishName
-
getSunLongitude
public double getSunLongitude()Gets the sun longitude in degrees 获取太阳黄经度数- Returns:
- the sun longitude | 太阳黄经
-
next
-
previous
Gets the previous solar term 获取上一个节气- Returns:
- the previous solar term | 上一个节气
-
isMajorTerm
public boolean isMajorTerm()Checks if this is a major solar term (中气) 检查是否为中气- Returns:
- true if major term | 如果是中气返回true
-
isMinorTerm
public boolean isMinorTerm()Checks if this is a minor solar term (节气) 检查是否为节气(小节气)- Returns:
- true if minor term | 如果是节气返回true
-
getSeason
public int getSeason()Gets the season of this solar term 获取此节气所属季节- Returns:
- the season (0=Spring, 1=Summer, 2=Autumn, 3=Winter) | 季节
-
getSeasonName
Gets the season name in Chinese 获取季节的中文名称- Returns:
- the season name | 季节名称
-
toString
-