All Implemented Interfaces:
Almanac, Culture

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

    • LEAP

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

      protected int year
  • 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:
    • getDayCount

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

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

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

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

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

      public Twenty getTwenty()
      Returns:
    • getNineStar

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

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

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

      public boolean equals(Object o)
      Overrides:
      equals in class Tradition