Skip to content

Commit

Permalink
v6.5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
839128 committed Mar 24, 2022
1 parent b457079 commit 3158216
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ public int getMax() {
@Override
public ValueMatcher parseAsValueMatcher(String value) {
if (isMatchAllStr(value)) {
//兼容Quartz的"?"表达式,不会出现互斥情况,与"*"作用相同
// 兼容Quartz的"?"表达式,不会出现互斥情况,与"*"作用相同
return new AlwaysTrueValueMatcher();
}

Expand Down Expand Up @@ -216,12 +216,12 @@ private List<Integer> parseRange(String value, int step) {

// 全部匹配形式
if (value.length() <= 2) {
//根据步进的第一个数字确定起始时间,类似于 12/3则从12(秒、分等)开始
// 根据步进的第一个数字确定起始时间,类似于 12/3则从12(秒、分等)开始
int minValue = getMin();
if (false == isMatchAllStr(value)) {
minValue = Math.max(minValue, parse(value));
} else {
//在全匹配模式下,如果步进不存在,表示步进为1
// 在全匹配模式下,如果步进不存在,表示步进为1
if (step < 1) {
step = 1;
}
Expand All @@ -231,23 +231,23 @@ private List<Integer> parseRange(String value, int step) {
if (minValue > maxValue) {
throw new CrontabException("Invalid value {} > {}", minValue, maxValue);
}
//有步进
// 有步进
for (int i = minValue; i <= maxValue; i += step) {
results.add(i);
}
} else {
//固定时间
// 固定时间
results.add(minValue);
}
return results;
}

//Range模式
// Range模式
List<String> parts = StringKit.split(value, '-');
int size = parts.size();
if (size == 1) {// 普通值
final int v1 = parse(value);
if (step > 0) {//类似 20/2的形式
if (step > 0) {// 类似 20/2的形式
MathKit.appendRange(v1, getMax(), step, results);
} else {
results.add(v1);
Expand All @@ -256,7 +256,7 @@ private List<Integer> parseRange(String value, int step) {
final int v1 = parse(parts.get(0));
final int v2 = parse(parts.get(1));
if (step < 1) {
//在range模式下,如果步进不存在,表示步进为1
// 在range模式下,如果步进不存在,表示步进为1
step = 1;
}
if (v1 < v2) {// 正常范围,例如:2-5
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public int parse(String value) throws CrontabException {

@Override
protected ValueMatcher buildValueMatcher(List<Integer> values) {
//考虑每月的天数不同,且存在闰年情况,日匹配单独使用
// 考虑每月的天数不同,且存在闰年情况,日匹配单独使用
return new DayOfMonthValueMatcher(values);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public int parse(String value) throws CrontabException {
*/
private int parseAlias(String value) throws CrontabException {
if ("L".equalsIgnoreCase(value)) {
//最后一天为星期六
// 最后一天为星期六
return ALIASES.length - 1;
}

Expand Down

0 comments on commit 3158216

Please sign in to comment.