static List<CronEntry> buildCronEntries(List<String> tokens) { List<CronEntry> result = new ArrayList<CronEntry>(); CronEntry minutes = new CronEntry("Minutes", tokens.get(MINUTES), 0, 60); minutes.currentWhen = calculateValues(minutes); result.add(minutes); CronEntry hours = new CronEntry("Hours", tokens.get(HOURS), 0, 24); hours.currentWhen = calculateValues(hours); result.add(hours); CronEntry dayOfMonth = new CronEntry("DayOfMonth", tokens.get(DAY_OF_MONTH), 1, 32); dayOfMonth.currentWhen = calculateValues(dayOfMonth); result.add(dayOfMonth); CronEntry month = new CronEntry("Month", tokens.get(MONTH), 1, 12); month.currentWhen = calculateValues(month); result.add(month); CronEntry dayOfWeek = new CronEntry("DayOfWeek", tokens.get(DAY_OF_WEEK), 0, 6); dayOfWeek.currentWhen = calculateValues(dayOfWeek); result.add(dayOfWeek); return result; }
static int getNext(final CronEntry entry, final int current, final Calendar working) throws MessageFormatException { int result = 0; if (entry.currentWhen == null) { entry.currentWhen = calculateValues(entry); } List<Integer> list = entry.currentWhen; int next = -1; for (Integer i : list) { if (i.intValue() > current) { next = i.intValue(); break; } } if (next != -1) { result = next - current; } else { int first = list.get(0).intValue(); int fixedEnd = entry.end; //months have different max values if("DayOfMonth".equals(entry.name)) { fixedEnd = working.getActualMaximum(Calendar.DAY_OF_MONTH)+1; } result = fixedEnd + first - entry.start - current; // Account for difference of one vs zero based indices. if (entry.name.equals("DayOfWeek") || entry.name.equals("Month")) { result++; } } return result; }
String numerator = getNumerator(entry.token); CronEntry ce = new CronEntry(entry.name, numerator, entry.start, entry.end); List<Integer> list = calculateValues(ce); for (Integer i : list) { if (i.intValue() % denominator == 0) { String str = tokenizer.nextToken(); CronEntry ce = new CronEntry(entry.name, str, entry.start, entry.end); List<Integer> list = calculateValues(ce); result.addAll(list);
static List<CronEntry> buildCronEntries(List<String> tokens) { List<CronEntry> result = new ArrayList<CronEntry>(); CronEntry minutes = new CronEntry("Minutes", tokens.get(MINUTES), 0, 60); minutes.currentWhen = calculateValues(minutes); result.add(minutes); CronEntry hours = new CronEntry("Hours", tokens.get(HOURS), 0, 24); hours.currentWhen = calculateValues(hours); result.add(hours); CronEntry dayOfMonth = new CronEntry("DayOfMonth", tokens.get(DAY_OF_MONTH), 1, 32); dayOfMonth.currentWhen = calculateValues(dayOfMonth); result.add(dayOfMonth); CronEntry month = new CronEntry("Month", tokens.get(MONTH), 1, 12); month.currentWhen = calculateValues(month); result.add(month); CronEntry dayOfWeek = new CronEntry("DayOfWeek", tokens.get(DAY_OF_WEEK), 0, 6); dayOfWeek.currentWhen = calculateValues(dayOfWeek); result.add(dayOfWeek); return result; }
static List<CronEntry> buildCronEntries(List<String> tokens) { List<CronEntry> result = new ArrayList<CronEntry>(); CronEntry minutes = new CronEntry("Minutes", tokens.get(MINUTES), 0, 60); minutes.currentWhen = calculateValues(minutes); result.add(minutes); CronEntry hours = new CronEntry("Hours", tokens.get(HOURS), 0, 24); hours.currentWhen = calculateValues(hours); result.add(hours); CronEntry dayOfMonth = new CronEntry("DayOfMonth", tokens.get(DAY_OF_MONTH), 1, 32); dayOfMonth.currentWhen = calculateValues(dayOfMonth); result.add(dayOfMonth); CronEntry month = new CronEntry("Month", tokens.get(MONTH), 1, 12); month.currentWhen = calculateValues(month); result.add(month); CronEntry dayOfWeek = new CronEntry("DayOfWeek", tokens.get(DAY_OF_WEEK), 0, 6); dayOfWeek.currentWhen = calculateValues(dayOfWeek); result.add(dayOfWeek); return result; }
static int getNext(final CronEntry entry, final int current, final Calendar working) throws MessageFormatException { int result = 0; if (entry.currentWhen == null) { entry.currentWhen = calculateValues(entry); } List<Integer> list = entry.currentWhen; int next = -1; for (Integer i : list) { if (i.intValue() > current) { next = i.intValue(); break; } } if (next != -1) { result = next - current; } else { int first = list.get(0).intValue(); int fixedEnd = entry.end; //months have different max values if("DayOfMonth".equals(entry.name)) { fixedEnd = working.getActualMaximum(Calendar.DAY_OF_MONTH)+1; } result = fixedEnd + first - entry.start - current; // Account for difference of one vs zero based indices. if (entry.name.equals("DayOfWeek") || entry.name.equals("Month")) { result++; } } return result; }
static int getNext(final CronEntry entry, final int current) throws MessageFormatException { int result = 0; if (entry.currentWhen == null) { entry.currentWhen = calculateValues(entry); } List<Integer> list = entry.currentWhen; int next = -1; for (Integer i : list) { if (i.intValue() > current) { next = i.intValue(); break; } } if (next != -1) { result = next - current; } else { int first = list.get(0).intValue(); result = entry.end + first - entry.start - current; // Account for difference of one vs zero based indices. if (entry.name.equals("DayOfWeek") || entry.name.equals("Month")) { result++; } } return result; }
static List<CronEntry> buildCronEntries(List<String> tokens) { List<CronEntry> result = new ArrayList<CronEntry>(); CronEntry minutes = new CronEntry("Minutes", tokens.get(MINUTES), 0, 60); minutes.currentWhen = calculateValues(minutes); result.add(minutes); CronEntry hours = new CronEntry("Hours", tokens.get(HOURS), 0, 24); hours.currentWhen = calculateValues(hours); result.add(hours); CronEntry dayOfMonth = new CronEntry("DayOfMonth", tokens.get(DAY_OF_MONTH), 1, 31); dayOfMonth.currentWhen = calculateValues(dayOfMonth); result.add(dayOfMonth); CronEntry month = new CronEntry("Month", tokens.get(MONTH), 1, 12); month.currentWhen = calculateValues(month); result.add(month); CronEntry dayOfWeek = new CronEntry("DayOfWeek", tokens.get(DAY_OF_WEEK), 0, 6); dayOfWeek.currentWhen = calculateValues(dayOfWeek); result.add(dayOfWeek); return result; }
static List<CronEntry> buildCronEntries(List<String> tokens) { List<CronEntry> result = new ArrayList<CronEntry>(); CronEntry minutes = new CronEntry("Minutes", tokens.get(MINUTES), 0, 60); minutes.currentWhen = calculateValues(minutes); result.add(minutes); CronEntry hours = new CronEntry("Hours", tokens.get(HOURS), 0, 24); hours.currentWhen = calculateValues(hours); result.add(hours); CronEntry dayOfMonth = new CronEntry("DayOfMonth", tokens.get(DAY_OF_MONTH), 1, 32); dayOfMonth.currentWhen = calculateValues(dayOfMonth); result.add(dayOfMonth); CronEntry month = new CronEntry("Month", tokens.get(MONTH), 1, 12); month.currentWhen = calculateValues(month); result.add(month); CronEntry dayOfWeek = new CronEntry("DayOfWeek", tokens.get(DAY_OF_WEEK), 0, 6); dayOfWeek.currentWhen = calculateValues(dayOfWeek); result.add(dayOfWeek); return result; }
static int getNext(final CronEntry entry, final int current, final Calendar working) throws MessageFormatException { int result = 0; if (entry.currentWhen == null) { entry.currentWhen = calculateValues(entry); } List<Integer> list = entry.currentWhen; int next = -1; for (Integer i : list) { if (i.intValue() > current) { next = i.intValue(); break; } } if (next != -1) { result = next - current; } else { int first = list.get(0).intValue(); int fixedEnd = entry.end; //months have different max values if("DayOfMonth".equals(entry.name)) { fixedEnd = working.getActualMaximum(Calendar.DAY_OF_MONTH)+1; } result = fixedEnd + first - entry.start - current; // Account for difference of one vs zero based indices. if (entry.name.equals("DayOfWeek") || entry.name.equals("Month")) { result++; } } return result; }
static int getNext(final CronEntry entry, final int current, final Calendar working) throws MessageFormatException { int result = 0; if (entry.currentWhen == null) { entry.currentWhen = calculateValues(entry); } List<Integer> list = entry.currentWhen; int next = -1; for (Integer i : list) { if (i.intValue() > current) { next = i.intValue(); break; } } if (next != -1) { result = next - current; } else { int first = list.get(0).intValue(); int fixedEnd = entry.end; //months have different max values if("DayOfMonth".equals(entry.name)) { fixedEnd = working.getActualMaximum(Calendar.DAY_OF_MONTH)+1; } result = fixedEnd + first - entry.start - current; // Account for difference of one vs zero based indices. if (entry.name.equals("DayOfWeek") || entry.name.equals("Month")) { result++; } } return result; }
String numerator = getNumerator(entry.token); CronEntry ce = new CronEntry(entry.name, numerator, entry.start, entry.end); List<Integer> list = calculateValues(ce); for (Integer i : list) { if (i.intValue() % denominator == 0) { String str = tokenizer.nextToken(); CronEntry ce = new CronEntry(entry.name, str, entry.start, entry.end); List<Integer> list = calculateValues(ce); result.addAll(list);
String numerator = getNumerator(entry.token); CronEntry ce = new CronEntry(entry.name, numerator, entry.start, entry.end); List<Integer> list = calculateValues(ce); for (Integer i : list) { if (i.intValue() % denominator == 0) { String str = tokenizer.nextToken(); CronEntry ce = new CronEntry(entry.name, str, entry.start, entry.end); List<Integer> list = calculateValues(ce); result.addAll(list);
String numerator = getNumerator(entry.token); CronEntry ce = new CronEntry(entry.name, numerator, entry.start, entry.end); List<Integer> list = calculateValues(ce); for (Integer i : list) { if (i.intValue() % denominator == 0) { String str = tokenizer.nextToken(); CronEntry ce = new CronEntry(entry.name, str, entry.start, entry.end); List<Integer> list = calculateValues(ce); result.addAll(list);
String numerator = getNumerator(entry.token); CronEntry ce = new CronEntry(entry.name, numerator, entry.start, entry.end); List<Integer> list = calculateValues(ce); for (Integer i : list) { if (i.intValue() % denominator == 0) { String str = tokenizer.nextToken(); CronEntry ce = new CronEntry(entry.name, str, entry.start, entry.end); List<Integer> list = calculateValues(ce); result.addAll(list);