All Implemented Interfaces:
Almanac, Culture

public class Zodiac extends Samsara
生肖
Since:
Java 17+
Author:
Kimi Liu
  • Field Details

    • NAMES

      public static final String[] NAMES
  • Constructor Details

    • Zodiac

      public Zodiac(int index)
    • Zodiac

      public Zodiac(String name)
  • Method Details

    • fromIndex

      public static Zodiac fromIndex(int index)
    • fromName

      public static Zodiac fromName(String name)
    • getName

      public static String getName(Date date)
      通过生日计算生肖,只计算1900年后出生的人
      Parameters:
      date - 出生日期(年需农历)
      Returns:
      星座名
    • getName

      public static String getName(Calendar calendar)
      通过生日计算生肖,只计算1900年后出生的人
      Parameters:
      calendar - 出生日期(年需农历)
      Returns:
      星座名
    • getName

      public static String getName(int year)
      计算生肖
      Parameters:
      year - 农历年
      Returns:
      生肖名
    • next

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

      public EarthBranch getEarthBranch()
      地支
      Returns:
      地支