Enum Class Various
- All Implemented Interfaces:
Serializable,Comparable<Various>,Constable
日期各个部分的枚举 与Calendar相应值对应
- 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 ConstantsEnum ConstantDescription上午或者下午一月中的第几天周几,1表示周日,2表示周一天所在的周是这个月的第几周一年中的第几天世纪小时,用于12小时制小时,用于24小时制毫秒分钟月秒一月中第几周一年中第几周年 -
Method Summary
Modifier and TypeMethodDescriptionintgetValue()获取Calendar中对应的值static Variousof(int calendarPartIntValue) 将Calendar相关值转换为DatePart枚举对象static VariousReturns the enum constant of this class with the specified name.static Various[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
ERA
世纪- See Also:
-
YEAR
年- See Also:
-
MONTH
月- See Also:
-
WEEK_OF_YEAR
一年中第几周- See Also:
-
WEEK_OF_MONTH
一月中第几周- See Also:
-
DAY_OF_MONTH
一月中的第几天- See Also:
-
DAY_OF_YEAR
一年中的第几天- See Also:
-
DAY_OF_WEEK
周几,1表示周日,2表示周一- See Also:
-
DAY_OF_WEEK_IN_MONTH
天所在的周是这个月的第几周- See Also:
-
AM_PM
上午或者下午- See Also:
-
HOUR
小时,用于12小时制- See Also:
-
HOUR_OF_DAY
小时,用于24小时制- See Also:
-
MINUTE
分钟- See Also:
-
SECOND
秒- See Also:
-
MILLISECOND
毫秒- See Also:
-
-
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
-
of
将Calendar相关值转换为DatePart枚举对象- Parameters:
calendarPartIntValue- Calendar中关于Week的int值- Returns:
- Type
-
getValue
public int getValue()获取Calendar中对应的值- Returns:
Calendar中对应的值
-