public enum Part extends Enum<Part>
Enum.ordinal()
表示此部分在表达式中的位置,如0表示秒0 1 2 3 4 5 6 [SECOND] MINUTE HOUR DAY_OF_MONTH MONTH DAY_OF_WEEK [YEAR]
Enum Constant and Description |
---|
DAY_OF_MONTH |
DAY_OF_WEEK |
HOUR |
MINUTE |
MONTH |
SECOND |
YEAR |
Modifier and Type | Method and Description |
---|---|
int |
checkValue(int value)
检查单个值是否有效
|
int |
getCalendarField()
获取Calendar中对应字段项
|
int |
getMax()
获取最大值
|
int |
getMin()
获取最小值
|
static Part |
of(int i)
根据位置获取Part
|
static Part |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static Part[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final Part SECOND
public static final Part MINUTE
public static final Part HOUR
public static final Part DAY_OF_MONTH
public static final Part MONTH
public static final Part DAY_OF_WEEK
public static final Part YEAR
public static Part[] values()
for (Part c : Part.values()) System.out.println(c);
public static Part valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullpublic int getCalendarField()
public int getMin()
public int getMax()
public int checkValue(int value) throws CronException
value
- 值CronException
- 检查无效抛出此异常public static Part of(int i)
i
- 位置,从0开始Copyright © 2024. All rights reserved.