public Calendar getNextTimeout(Calendar currentCal) { return getNextTimeout(currentCal, true); }
public Calendar getNextTimeout() { return getNextTimeout(new GregorianCalendar(this.timezone), true); }
private void setFirstTimeout() { Calendar currentCal = new GregorianCalendar(this.timezone); Date start = this.scheduleExpression.getStart(); if (start != null) { currentCal.setTime(start); } else { resetTimeToFirstValues(currentCal); } this.firstTimeout = getNextTimeout(currentCal, false); }
@Override protected Date calculateNextTimeout(TimerImpl timer) { // The next timeout for the calendar timer will have to be computed using the // current "nextExpiration" Date currentTimeout = timer.getNextExpiration(); if (currentTimeout == null) { return null; } Calendar cal = new GregorianCalendar(); cal.setTime(currentTimeout); // now compute the next timeout date Calendar nextTimeout = ((CalendarTimer) timer).getCalendarTimeout().getNextTimeout(cal); if (nextTimeout != null) { return nextTimeout.getTime(); } return null; }
Calendar nextTimeout = this.calendarTimeout.getNextTimeout(); if (nextTimeout != null) { this.nextExpiration = nextTimeout.getTime();
public Calendar getNextTimeout() { Calendar now = new GregorianCalendar(this.timezone); now.setTime(new Date()); return this.getNextTimeout(now); }
@Override protected Date calculateNextTimeout() { // The next timeout for the calendar timer will have to be computed using the // current "nextExpiration" Date currentTimeout = this.getTimer().getNextExpiration(); if (currentTimeout == null) { return null; } Calendar cal = new GregorianCalendar(); cal.setTime(currentTimeout); // now compute the next timeout date Calendar nextTimeout = this.getTimer().getCalendarTimeout().getNextTimeout(cal); if (nextTimeout != null) { return nextTimeout.getTime(); } return null; }
Calendar nextTimeout = this.calendarTimeout.getNextTimeout(); if (nextTimeout != null) { this.nextExpiration = nextTimeout.getTime();