Enum Class Constellation
- All Implemented Interfaces:
Serializable,Comparable<Constellation>,Constable
星座
- Since:
- Java 17+
- Author:
- Kimi Liu
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum Constants -
Method Summary
Modifier and TypeMethodDescriptionstatic Constellationget(int code) 按宫位获取星座static Constellationget(int month, int day) 按月日获取星座static String[]获取枚举属性信息static Constellation按日期获取星座static Constellation按月日获取星座longgetCode()getName()getName(int code) static StringgetName(int month, int day) 通过生日计算星座static String通过生日计算星座static String通过生日计算星座static String通过生日计算星座static ConstellationReturns the enum constant of this class with the specified name.static Constellation[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
ARIES
白羊座 -
TAURUS
金牛座 -
GEMINI
双子座 -
CANCER
巨蟹座 -
LEO
狮子座 -
VIRGO
处女座 -
LIBRA
天秤座 -
SCORPIO
天蝎座 -
SAGITTARIUS
射手座 -
CAPRICORN
摩羯座 -
AQUARIUS
水瓶座 -
PISCES
双鱼座
-
-
Method Details
-
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
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 nameNullPointerException- if the argument is null
-
get
按宫位获取星座- Parameters:
code- 编码- Returns:
- this
-
get
按日期获取星座- Parameters:
date- 日期- Returns:
- this
-
get
按月日获取星座- Parameters:
month- 月份day- 日期- Returns:
- this
-
get
按月日获取星座- Parameters:
monthDay- 月份- Returns:
- this
-
getName
通过生日计算星座- Parameters:
date- 出生日期- Returns:
- 星座名
-
getName
通过生日计算星座- Parameters:
calendar- 出生日期- Returns:
- 星座名
-
getName
通过生日计算星座- Parameters:
month- 月,从0开始计数day- 天- Returns:
- 星座名
-
getName
通过生日计算星座- Parameters:
month- 月,从0开始计数,见Month.getValue()day- 天- Returns:
- 星座名
-
get
获取枚举属性信息- Parameters:
fieldName- 属性名称- Returns:
- the string[]
-
getName
- Returns:
- 对应的名称
-
getCode
public long getCode()- Returns:
- 单位对应的编码
-
getName
- Returns:
- 对应的名称
-