Module bus.core

Class LunarYear

All Implemented Interfaces:
Almanac, Culture

public class LunarYear extends Loops
农历年
Since:
Java 17+
Author:
Kimi Liu
  • Field Details

    • year

      protected int year
    • LEAP

      protected static final Map<Integer,List<Integer>> LEAP
      缓存{闰月:年}
  • Constructor Details

    • LunarYear

      public LunarYear(int year)
  • Method Details

    • fromYear

      public static LunarYear fromYear(int year)
      从年初始化
      Parameters:
      year - 年,支持-1到9999年
      Returns:
      农历年
    • getYear

      public int getYear()
      Returns:
    • getSixtyCycle

      public SixtyCycle getSixtyCycle()
      干支
      Returns:
      干支
    • getDayCount

      public int getDayCount()
      天数
      Returns:
      天数
    • getMonthCount

      public int getMonthCount()
      月数
      Returns:
      月数
    • getName

      public String getName()
      依据国家标准《农历的编算和颁行》GB/T 33661-2017,农历年有2种命名方法:干支纪年法和生肖纪年法,这里默认采用干支纪年法。
      Returns:
      名称
    • getTwenty

      public Twenty getTwenty()
      Returns:
    • getNineStar

      public NineStar getNineStar()
      九星
      Returns:
      九星
    • getJupiterDirection

      public Direction getJupiterDirection()
      太岁方位
      Returns:
      方位
    • next

      public LunarYear next(int n)
      Description copied from interface: Culture
      推移
      Parameters:
      n - 推移步数
      Returns:
      this
    • getLeapMonth

      public int getLeapMonth()
      闰月
      Returns:
      闰月数字,1代表闰1月,0代表无闰月
    • getFirstMonth

      public LunarMonth getFirstMonth()
      首月(农历月,即一月,俗称正月)
      Returns:
      农历月
    • getMonths

      public List<LunarMonth> getMonths()
      月份列表
      Returns:
      月份列表,一般有12个月,当年有闰月时,有13个月。
    • getVesta

      public Vesta getVesta()
      灶马头
      Returns:
      灶马头