use of com.cronutils.model.field.constraint.FieldConstraintsBuilder in project cron-utils by jmrozanec.
the class BetweenDayOfWeekValueGenerator method generateCandidatesNotIncludingIntervalExtremes.
@Override
protected List<Integer> generateCandidatesNotIncludingIntervalExtremes(final int start, final int end) {
final List<Integer> values = new ArrayList<>();
for (Integer dayOfWeek : dowValidValues) {
// Build a CronField representing a single day of the week
final FieldConstraintsBuilder fcb = FieldConstraintsBuilder.instance().forField(CronFieldName.DAY_OF_WEEK);
final CronParserField parser = new CronParserField(CronFieldName.DAY_OF_WEEK, fcb.createConstraintsInstance());
final CronField cronField = parser.parse(dayOfWeek.toString());
// now a generator for matching days
final OnDayOfWeekValueGenerator odow = new OnDayOfWeekValueGenerator(cronField, year, month, mondayDoWValue);
// get the list of matching days
final List<Integer> candidatesList = odow.generateCandidates(start, end);
// add them to the master list
if (candidatesList != null) {
values.addAll(candidatesList);
}
}
Collections.sort(values);
return values;
}
Aggregations