CronPattern support L

This commit is contained in:
Looly
2020-04-25 19:23:42 +08:00
parent e568b7896b
commit 63732834ac
3 changed files with 30 additions and 2 deletions

View File

@@ -13,7 +13,13 @@ public class SimpleValueParser implements ValueParser {
protected int min;
/** 最大值(包括) */
protected int max;
/**
* 构造
*
* @param min 最小值(包括)
* @param max 最大值(包括)
*/
public SimpleValueParser(int min, int max) {
if(min > max){
this.min = max;
@@ -26,6 +32,11 @@ public class SimpleValueParser implements ValueParser {
@Override
public int parse(String value) throws CronException {
if("L".equalsIgnoreCase(value)){
// L表示最大值
return max;
}
int i;
try {
i = Integer.parseInt(value);