All Implemented Interfaces:
Almanac, Culture

public class SolarDay extends Loops
公历日
Since:
Java 17+
Author:
Kimi Liu
  • Field Details

    • NAMES

      public static final String[] NAMES
    • month

      protected SolarMonth month
      公历月
    • day

      protected int day
  • Constructor Details

    • SolarDay

      public SolarDay(int year, int month, int day)
      初始化
      Parameters:
      year - 年
      month - 月
      day - 日
  • Method Details

    • fromYmd

      public static SolarDay fromYmd(int year, int month, int day)
    • getSolarMonth

      public SolarMonth getSolarMonth()
      公历月
      Returns:
      公历月
    • getYear

      public int getYear()
      Returns:
    • getMonth

      public int getMonth()
      Returns:
    • getDay

      public int getDay()
      Returns:
    • getWeek

      public Week getWeek()
      星期
      Returns:
      星期
    • getConstellation

      public Constellation getConstellation()
      星座
      Returns:
      星座
    • getName

      public String getName()
      Description copied from interface: Almanac
      名称
      Returns:
      名称
    • toString

      public String toString()
      Overrides:
      toString in class Tradition
    • next

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

      public boolean isBefore(SolarDay target)
      是否在指定公历日之前
      Parameters:
      target - 公历日
      Returns:
      true/false
    • isAfter

      public boolean isAfter(SolarDay target)
      是否在指定公历日之后
      Parameters:
      target - 公历日
      Returns:
      true/false
    • getTerm

      public SolarTerms getTerm()
      节气
      Returns:
      节气
    • getTermDay

      public SolarTermDay getTermDay()
      节气第几天
      Returns:
      节气第几天
    • getSolarWeek

      public SolarWeek getSolarWeek(int start)
      公历周
      Parameters:
      start - 起始星期,1234560分别代表星期一至星期天
      Returns:
      公历周
    • getClimateDay

      public ClimateDay getClimateDay()
      七十二候
      Returns:
      七十二候
    • getDogDay

      public DogDay getDogDay()
      三伏天
      Returns:
      三伏天
    • getNineDay

      public NineDay getNineDay()
      数九天
      Returns:
      数九天
    • getPlumRainDay

      public PlumRainDay getPlumRainDay()
      梅雨天(芒种后的第1个丙日入梅,小暑后的第1个未日出梅)
      Returns:
      梅雨天
    • getIndexInYear

      public int getIndexInYear()
      位于当年的索引
      Returns:
      索引
    • subtract

      public int subtract(SolarDay target)
      公历日期相减,获得相差天数
      Parameters:
      target - 公历
      Returns:
      天数
    • getJulianDay

      public JulianDay getJulianDay()
      儒略日
      Returns:
      儒略日
    • getLunarDay

      public LunarDay getLunarDay()
      农历日
      Returns:
      农历日
    • getHoliday

      public Holiday getHoliday()
      法定假日,如果当天不是法定假日,返回null
      Returns:
      法定假日
    • getFestival

      public SolarFestival getFestival()
      公历现代节日,如果当天不是公历现代节日,返回null
      Returns:
      公历现代节日