-
Notifications
You must be signed in to change notification settings - Fork 115
/
Copy pathCronExpressionEx.java
107 lines (83 loc) · 2.22 KB
/
CronExpressionEx.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
package wjw.cron.ex;
import java.text.ParseException;
import java.util.Set;
import java.util.StringTokenizer;
/**
*
* @author Administrator
*/
public class CronExpressionEx extends CronExpression {
private static final long serialVersionUID = 1L;
public static final Integer ALL_SPEC = Integer.valueOf(ALL_SPEC_INT);
public static final int NO_SPEC_INT = 98; // '?'
private String secondsExp;
private String minutesExp;
private String hoursExp;
private String daysOfMonthExp;
private String monthsExp;
private String daysOfWeekExp;
public CronExpressionEx(String cronExpression) throws ParseException {
super(cronExpression);
StringTokenizer exprsTok = new StringTokenizer(cronExpression, " \t", false);
secondsExp = exprsTok.nextToken().trim();
minutesExp = exprsTok.nextToken().trim();
hoursExp = exprsTok.nextToken().trim();
daysOfMonthExp = exprsTok.nextToken().trim();
monthsExp = exprsTok.nextToken().trim();
daysOfWeekExp = exprsTok.nextToken().trim();
}
public Set getSecondsSet() {
return seconds;
}
public String getSecondsField() {
return getExpressionSetSummary(seconds);
}
public Set getMinutesSet() {
return minutes;
}
public String getMinutesField() {
return getExpressionSetSummary(minutes);
}
public Set getHoursSet() {
return hours;
}
public String getHoursField() {
return getExpressionSetSummary(hours);
}
public Set getDaysOfMonthSet() {
return daysOfMonth;
}
public String getDaysOfMonthField() {
return getExpressionSetSummary(daysOfMonth);
}
public Set getMonthsSet() {
return months;
}
public String getMonthsField() {
return getExpressionSetSummary(months);
}
public Set getDaysOfWeekSet() {
return daysOfWeek;
}
public String getDaysOfWeekField() {
return getExpressionSetSummary(daysOfWeek);
}
public String getSecondsExp() {
return secondsExp;
}
public String getMinutesExp() {
return minutesExp;
}
public String getHoursExp() {
return hoursExp;
}
public String getDaysOfMonthExp() {
return daysOfMonthExp;
}
public String getMonthsExp() {
return monthsExp;
}
public String getDaysOfWeekExp() {
return daysOfWeekExp;
}
}