Package org.aoju.bus.core.lang
Enum Class Fields.Month
- All Implemented Interfaces:
Serializable,Comparable<Fields.Month>,Constable
- Enclosing class:
Fields
月份枚举 与Calendar中的月份int值对应
- See Also:
-
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 Fields.MonthgetByCode(int code) 根据code查询月份名称枚举static StringgetFullNameCnByCode(int code) 根据code查询月份中文全称static StringgetFullNameEnByCode(int code) 根据code查询月份英文全称intgetKey()intgetLastDay(boolean isLeapYear) 获取此月份最后一天的值,不支持的月份(例如UNDECIMBER)返回-1static intgetLastDay(int month, boolean isLeapYear) 获得指定月的最后一天static StringgetShortNameCnByCode(int code) 根据code查询月份中文static StringgetShortNameEnByCode(int code) 根据code查询月份英文简称static Fields.MonthReturns the enum constant of this class with the specified name.static Fields.Month[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
Jan
一月 -
Feb
二月 -
Mar
三月 -
Apr
四月 -
May
五月 -
Jun
六月 -
Jul
七月 -
Aug
八月 -
Sep
九月 -
Oct
十月 -
Nov
十一月 -
Dec
十二月 -
Und
十三月,仅用于农历
-
-
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
-
getByCode
-
getShortNameEnByCode
根据code查询月份英文简称- Parameters:
code- code- Returns:
- String
-
getFullNameEnByCode
根据code查询月份英文全称- Parameters:
code- code- Returns:
- String
-
getFullNameCnByCode
根据code查询月份中文全称- Parameters:
code- code- Returns:
- String
-
getShortNameCnByCode
根据code查询月份中文- Parameters:
code- code- Returns:
- String
-
getLastDay
public static int getLastDay(int month, boolean isLeapYear) 获得指定月的最后一天- Parameters:
month- 月份isLeapYear- 是否为闰年,闰年只对二月有影响- Returns:
- 最后一天,可能为28,29,30,31
-
getLastDay
public int getLastDay(boolean isLeapYear) 获取此月份最后一天的值,不支持的月份(例如UNDECIMBER)返回-1- Parameters:
isLeapYear- 是否闰年- Returns:
- 此月份最后一天的值
-
getKey
public int getKey() -
getEnName
-
getCnName
-
getShortName
-