protected static long doUpdateCurrentMonth(Calendar working, CronEntry month) throws MessageFormatException { int currentMonth = working.get(Calendar.MONTH) + 1; if (!isCurrent(month, currentMonth)) { int nextMonth = getNext(month, currentMonth, working); working.add(Calendar.MONTH, nextMonth); // Reset to start of month. resetToStartOfDay(working, 1); return working.getTimeInMillis(); } return 0L; }
protected static long doUpdateCurrentDay(Calendar working, CronEntry dayOfMonth, CronEntry dayOfWeek) throws MessageFormatException { int currentDayOfWeek = working.get(Calendar.DAY_OF_WEEK) - 1; int currentDayOfMonth = working.get(Calendar.DAY_OF_MONTH); // Simplest case, both are unrestricted or both match today otherwise // result must be the closer of the two if both are set, or the next // match to the one that is. if (!isCurrent(dayOfWeek, currentDayOfWeek) || !isCurrent(dayOfMonth, currentDayOfMonth) ) { int nextWeekDay = Integer.MAX_VALUE; int nextCalendarDay = Integer.MAX_VALUE; if (!isCurrent(dayOfWeek, currentDayOfWeek)) { nextWeekDay = getNext(dayOfWeek, currentDayOfWeek, working); } if (!isCurrent(dayOfMonth, currentDayOfMonth)) { nextCalendarDay = getNext(dayOfMonth, currentDayOfMonth, working); } if( nextWeekDay < nextCalendarDay ) { working.add(Calendar.DAY_OF_WEEK, nextWeekDay); } else { working.add(Calendar.DAY_OF_MONTH, nextCalendarDay); } // Since the day changed, we restart the clock at the start of the day // so that the next time will either be at 12am + value of hours and // minutes pattern. resetToStartOfDay(working, working.get(Calendar.DAY_OF_MONTH)); return working.getTimeInMillis(); } return 0L; }
if (!isCurrent(minutes, currentMinutes)) { int nextMinutes = getNext(minutes, currentMinutes, working); working.add(Calendar.MINUTE, nextMinutes); if (!isCurrent(hours, currentHours)) { int nextHour = getNext(hours, currentHours, working); working.add(Calendar.HOUR_OF_DAY, nextHour); if (!isCurrent(hours, currentHours)) { int nextHour = getNext(hours, currentHours, working); working.add(Calendar.HOUR_OF_DAY, nextHour); if (!isCurrent(minutes, currentMinutes)) { int nextMinutes = getNext(minutes, currentMinutes, working); working.add(Calendar.MINUTE, nextMinutes);
protected static long doUpdateCurrentMonth(Calendar working, CronEntry month) throws MessageFormatException { int currentMonth = working.get(Calendar.MONTH) + 1; if (!isCurrent(month, currentMonth)) { int nextMonth = getNext(month, currentMonth, working); working.add(Calendar.MONTH, nextMonth); // Reset to start of month. resetToStartOfDay(working, 1); return working.getTimeInMillis(); } return 0L; }
protected static long doUpdateCurrentMonth(Calendar working, CronEntry month) throws MessageFormatException { int currentMonth = working.get(Calendar.MONTH) + 1; if (!isCurrent(month, currentMonth)) { int nextMonth = getNext(month, currentMonth, working); working.add(Calendar.MONTH, nextMonth); // Reset to start of month. resetToStartOfDay(working, 1); return working.getTimeInMillis(); } return 0L; }
protected static long doUpdateCurrentMonth(Calendar working, CronEntry month) throws MessageFormatException { int currentMonth = working.get(Calendar.MONTH) + 1; if (!isCurrent(month, currentMonth)) { int nextMonth = getNext(month, currentMonth); working.add(Calendar.MONTH, nextMonth); // Reset to start of month. resetToStartOfDay(working, 1); return working.getTimeInMillis(); } return 0L; }
protected static long doUpdateCurrentMonth(Calendar working, CronEntry month) throws MessageFormatException { int currentMonth = working.get(Calendar.MONTH) + 1; if (!isCurrent(month, currentMonth)) { int nextMonth = getNext(month, currentMonth, working); working.add(Calendar.MONTH, nextMonth); // Reset to start of month. resetToStartOfDay(working, 1); return working.getTimeInMillis(); } return 0L; }
protected static long doUpdateCurrentDay(Calendar working, CronEntry dayOfMonth, CronEntry dayOfWeek) throws MessageFormatException { int currentDayOfWeek = working.get(Calendar.DAY_OF_WEEK) - 1; int currentDayOfMonth = working.get(Calendar.DAY_OF_MONTH); // Simplest case, both are unrestricted or both match today otherwise // result must be the closer of the two if both are set, or the next // match to the one that is. if (!isCurrent(dayOfWeek, currentDayOfWeek) || !isCurrent(dayOfMonth, currentDayOfMonth) ) { int nextWeekDay = Integer.MAX_VALUE; int nextCalendarDay = Integer.MAX_VALUE; if (!isCurrent(dayOfWeek, currentDayOfWeek)) { nextWeekDay = getNext(dayOfWeek, currentDayOfWeek, working); } if (!isCurrent(dayOfMonth, currentDayOfMonth)) { nextCalendarDay = getNext(dayOfMonth, currentDayOfMonth, working); } if( nextWeekDay < nextCalendarDay ) { working.add(Calendar.DAY_OF_WEEK, nextWeekDay); } else { working.add(Calendar.DAY_OF_MONTH, nextCalendarDay); } // Since the day changed, we restart the clock at the start of the day // so that the next time will either be at 12am + value of hours and // minutes pattern. resetToStartOfDay(working, working.get(Calendar.DAY_OF_MONTH)); return working.getTimeInMillis(); } return 0L; }
protected static long doUpdateCurrentDay(Calendar working, CronEntry dayOfMonth, CronEntry dayOfWeek) throws MessageFormatException { int currentDayOfWeek = working.get(Calendar.DAY_OF_WEEK) - 1; int currentDayOfMonth = working.get(Calendar.DAY_OF_MONTH); // Simplest case, both are unrestricted or both match today otherwise // result must be the closer of the two if both are set, or the next // match to the one that is. if (!isCurrent(dayOfWeek, currentDayOfWeek) || !isCurrent(dayOfMonth, currentDayOfMonth) ) { int nextWeekDay = Integer.MAX_VALUE; int nextCalendarDay = Integer.MAX_VALUE; if (!isCurrent(dayOfWeek, currentDayOfWeek)) { nextWeekDay = getNext(dayOfWeek, currentDayOfWeek, working); } if (!isCurrent(dayOfMonth, currentDayOfMonth)) { nextCalendarDay = getNext(dayOfMonth, currentDayOfMonth, working); } if( nextWeekDay < nextCalendarDay ) { working.add(Calendar.DAY_OF_WEEK, nextWeekDay); } else { working.add(Calendar.DAY_OF_MONTH, nextCalendarDay); } // Since the day changed, we restart the clock at the start of the day // so that the next time will either be at 12am + value of hours and // minutes pattern. resetToStartOfDay(working, working.get(Calendar.DAY_OF_MONTH)); return working.getTimeInMillis(); } return 0L; }
protected static long doUpdateCurrentDay(Calendar working, CronEntry dayOfMonth, CronEntry dayOfWeek) throws MessageFormatException { int currentDayOfWeek = working.get(Calendar.DAY_OF_WEEK) - 1; int currentDayOfMonth = working.get(Calendar.DAY_OF_MONTH); // Simplest case, both are unrestricted or both match today otherwise // result must be the closer of the two if both are set, or the next // match to the one that is. if (!isCurrent(dayOfWeek, currentDayOfWeek) || !isCurrent(dayOfMonth, currentDayOfMonth) ) { int nextWeekDay = Integer.MAX_VALUE; int nextCalendarDay = Integer.MAX_VALUE; if (!isCurrent(dayOfWeek, currentDayOfWeek)) { nextWeekDay = getNext(dayOfWeek, currentDayOfWeek, working); } if (!isCurrent(dayOfMonth, currentDayOfMonth)) { nextCalendarDay = getNext(dayOfMonth, currentDayOfMonth, working); } if( nextWeekDay < nextCalendarDay ) { working.add(Calendar.DAY_OF_WEEK, nextWeekDay); } else { working.add(Calendar.DAY_OF_MONTH, nextCalendarDay); } // Since the day changed, we restart the clock at the start of the day // so that the next time will either be at 12am + value of hours and // minutes pattern. resetToStartOfDay(working, working.get(Calendar.DAY_OF_MONTH)); return working.getTimeInMillis(); } return 0L; }
protected static long doUpdateCurrentDay(Calendar working, CronEntry dayOfMonth, CronEntry dayOfWeek) throws MessageFormatException { int currentDayOfWeek = working.get(Calendar.DAY_OF_WEEK) - 1; int currentDayOfMonth = working.get(Calendar.DAY_OF_MONTH); // Simplest case, both are unrestricted or both match today otherwise // result must be the closer of the two if both are set, or the next // match to the one that is. if (!isCurrent(dayOfWeek, currentDayOfWeek) || !isCurrent(dayOfMonth, currentDayOfMonth) ) { int nextWeekDay = Integer.MAX_VALUE; int nextCalendarDay = Integer.MAX_VALUE; if (!isCurrent(dayOfWeek, currentDayOfWeek)) { nextWeekDay = getNext(dayOfWeek, currentDayOfWeek); } if (!isCurrent(dayOfMonth, currentDayOfMonth)) { nextCalendarDay = getNext(dayOfMonth, currentDayOfMonth); } if( nextWeekDay < nextCalendarDay ) { working.add(Calendar.DAY_OF_WEEK, nextWeekDay); } else { working.add(Calendar.DAY_OF_MONTH, nextCalendarDay); } // Since the day changed, we restart the clock at the start of the day // so that the next time will either be at 12am + value of hours and // minutes pattern. resetToStartOfDay(working, working.get(Calendar.DAY_OF_MONTH)); return working.getTimeInMillis(); } return 0L; }
if (!isCurrent(minutes, currentMinutes)) { int nextMinutes = getNext(minutes, currentMinutes, working); working.add(Calendar.MINUTE, nextMinutes); if (!isCurrent(hours, currentHours)) { int nextHour = getNext(hours, currentHours, working); working.add(Calendar.HOUR_OF_DAY, nextHour); if (!isCurrent(hours, currentHours)) { int nextHour = getNext(hours, currentHours, working); working.add(Calendar.HOUR_OF_DAY, nextHour); if (!isCurrent(minutes, currentMinutes)) { int nextMinutes = getNext(minutes, currentMinutes, working); working.add(Calendar.MINUTE, nextMinutes);
if (!isCurrent(minutes, currentMinutes)) { int nextMinutes = getNext(minutes, currentMinutes); working.add(Calendar.MINUTE, nextMinutes); if (!isCurrent(hours, currentHours)) { int nextHour = getNext(hours, currentHours); working.add(Calendar.HOUR_OF_DAY, nextHour); if (!isCurrent(hours, currentHours)) { int nextHour = getNext(hours, currentHours); working.add(Calendar.HOUR_OF_DAY, nextHour); if (!isCurrent(minutes, currentMinutes)) { int nextMinutes = getNext(minutes, currentMinutes); working.add(Calendar.MINUTE, nextMinutes);
if (!isCurrent(minutes, currentMinutes)) { int nextMinutes = getNext(minutes, currentMinutes, working); working.add(Calendar.MINUTE, nextMinutes); if (!isCurrent(hours, currentHours)) { int nextHour = getNext(hours, currentHours, working); working.add(Calendar.HOUR_OF_DAY, nextHour); if (!isCurrent(hours, currentHours)) { int nextHour = getNext(hours, currentHours, working); working.add(Calendar.HOUR_OF_DAY, nextHour); if (!isCurrent(minutes, currentMinutes)) { int nextMinutes = getNext(minutes, currentMinutes, working); working.add(Calendar.MINUTE, nextMinutes);
if (!isCurrent(minutes, currentMinutes)) { int nextMinutes = getNext(minutes, currentMinutes, working); working.add(Calendar.MINUTE, nextMinutes); if (!isCurrent(hours, currentHours)) { int nextHour = getNext(hours, currentHours, working); working.add(Calendar.HOUR_OF_DAY, nextHour); if (!isCurrent(hours, currentHours)) { int nextHour = getNext(hours, currentHours, working); working.add(Calendar.HOUR_OF_DAY, nextHour); if (!isCurrent(minutes, currentMinutes)) { int nextMinutes = getNext(minutes, currentMinutes, working); working.add(Calendar.MINUTE, nextMinutes);