Enum Class SolarTerm

java.lang.Object
java.lang.Enum<SolarTerm>
cloud.opencode.base.date.lunar.SolarTerm
All Implemented Interfaces:
Serializable, Comparable<SolarTerm>, Constable

public enum SolarTerm extends Enum<SolarTerm>
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:
  • Enum Constant Details

    • LICHUN

      public static final SolarTerm LICHUN
    • YUSHUI

      public static final SolarTerm YUSHUI
    • JINGZHE

      public static final SolarTerm JINGZHE
    • CHUNFEN

      public static final SolarTerm CHUNFEN
    • QINGMING

      public static final SolarTerm QINGMING
    • GUYU

      public static final SolarTerm GUYU
    • LIXIA

      public static final SolarTerm LIXIA
    • XIAOMAN

      public static final SolarTerm XIAOMAN
    • MANGZHONG

      public static final SolarTerm MANGZHONG
    • XIAZHI

      public static final SolarTerm XIAZHI
    • XIAOSHU

      public static final SolarTerm XIAOSHU
    • DASHU

      public static final SolarTerm DASHU
    • LIQIU

      public static final SolarTerm LIQIU
    • CHUSHU

      public static final SolarTerm CHUSHU
    • BAILU

      public static final SolarTerm BAILU
    • QIUFEN

      public static final SolarTerm QIUFEN
    • HANLU

      public static final SolarTerm HANLU
    • SHUANGJIANG

      public static final SolarTerm SHUANGJIANG
    • LIDONG

      public static final SolarTerm LIDONG
    • XIAOXUE

      public static final SolarTerm XIAOXUE
    • DAXUE

      public static final SolarTerm DAXUE
    • DONGZHI

      public static final SolarTerm DONGZHI
    • XIAOHAN

      public static final SolarTerm XIAOHAN
    • DAHAN

      public static final SolarTerm DAHAN
  • Method Details

    • values

      public static SolarTerm[] 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

      public static SolarTerm valueOf(String name)
      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 name
      NullPointerException - if the argument is null
    • of

      public static SolarTerm of(int index)
      Gets the solar term by index (0-23) 按索引获取节气(0-23)
      Parameters:
      index - the index | 索引
      Returns:
      the solar term | 节气
    • fromChineseName

      public static SolarTerm fromChineseName(String chineseName)
      Gets the solar term by Chinese name 按中文名称获取节气
      Parameters:
      chineseName - the Chinese name | 中文名称
      Returns:
      the solar term, or null if not found | 节气,如果未找到则为null
    • getIndex

      public int getIndex()
      Gets the index (0-23) 获取索引(0-23)
      Returns:
      the index | 索引
    • getChineseName

      public String getChineseName()
      Gets the Chinese name 获取中文名称
      Returns:
      the Chinese name | 中文名称
    • getEnglishName

      public String getEnglishName()
      Gets the English name 获取英文名称
      Returns:
      the English name | 英文名称
    • getSunLongitude

      public double getSunLongitude()
      Gets the sun longitude in degrees 获取太阳黄经度数
      Returns:
      the sun longitude | 太阳黄经
    • next

      public SolarTerm next()
      Gets the next solar term 获取下一个节气
      Returns:
      the next solar term | 下一个节气
    • previous

      public SolarTerm 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

      public String getSeasonName()
      Gets the season name in Chinese 获取季节的中文名称
      Returns:
      the season name | 季节名称
    • toString

      public String toString()
      Overrides:
      toString in class Enum<SolarTerm>