/** * Computes the nearest past timestamp that matched this cron tab. * <p> * More precisely, given the time 't', computes another smallest time x such that: * * <ul> * <li>x <= t (inclusive) * <li>x matches this crontab * </ul> * * <p> * Note that if t already matches this cron, it's returned as is. */ public Calendar floor(long t) { Calendar cal = new GregorianCalendar(Locale.US); cal.setTimeInMillis(t); return floor(cal); }
@Restricted(NoExternalUse.class) // just for form validation public @CheckForNull Calendar previous() { Calendar nearest = null; for (CronTab tab : tabs) { Calendar scheduled = tab.floor(tab.getTimeZone() == null ? Calendar.getInstance() : Calendar.getInstance(tab.getTimeZone())); if (nearest == null || nearest.before(scheduled)) { nearest = scheduled; } } return nearest; }
int next = f.floor(this,cur); if (cur==next) continue; // this field is already in a good shape. move on to next
/** * Computes the nearest past timestamp that matched this cron tab. <p> More * precisely, given the time 't', computes another smallest time x such * that: * * <ul> <li>x <= t (inclusive) <li>x matches this crontab </ul> * * <p> Note that if t already matches this cron, it's returned as is. */ public Calendar floor(long t) { Calendar cal = new GregorianCalendar(Locale.US); cal.setTimeInMillis(t); return floor(cal); }
/** * Computes the nearest past timestamp that matched this cron tab. * <p> * More precisely, given the time 't', computes another smallest time x such that: * * <ul> * <li>x <= t (inclusive) * <li>x matches this crontab * </ul> * * <p> * Note that if t already matches this cron, it's returned as is. */ public Calendar floor(long t) { Calendar cal = new GregorianCalendar(Locale.US); cal.setTimeInMillis(t); return floor(cal); }
/** * Computes the nearest past timestamp that matched this cron tab. * <p> * More precisely, given the time 't', computes another smallest time x such that: * * <ul> * <li>x <= t (inclusive) * <li>x matches this crontab * </ul> * * <p> * Note that if t already matches this cron, it's returned as is. */ public Calendar floor(long t) { Calendar cal = new GregorianCalendar(Locale.US); cal.setTimeInMillis(t); return floor(cal); }
/** * Computes the nearest past timestamp that matched this cron tab. * <p> * More precisely, given the time 't', computes another smallest time x such that: * * <ul> * <li>x <= t (inclusive) * <li>x matches this crontab * </ul> * * <p> * Note that if t already matches this cron, it's returned as is. */ public Calendar floor(long t) { Calendar cal = new GregorianCalendar(Locale.US); cal.setTimeInMillis(t); return floor(cal); }
/** * Computes the nearest past timestamp that matched this cron tab. * <p> * More precisely, given the time 't', computes another smallest time x such that: * * <ul> * <li>x <= t (inclusive) * <li>x matches this crontab * </ul> * * <p> * Note that if t already matches this cron, it's returned as is. */ public Calendar floor(long t) { Calendar cal = new GregorianCalendar(Locale.US); cal.setTimeInMillis(t); return floor(cal); }
@Restricted(NoExternalUse.class) // just for form validation public @CheckForNull Calendar previous() { Calendar nearest = null; for (CronTab tab : tabs) { Calendar scheduled = tab.floor(tab.getTimeZone() == null ? Calendar.getInstance() : Calendar.getInstance(tab.getTimeZone())); if (nearest == null || nearest.before(scheduled)) { nearest = scheduled; } } return nearest; }
int next = f.floor(this,cur); if (cur==next) continue; // this field is already in a good shape. move on to next
for (CalendarField f : CalendarField.ADJUST_ORDER) { int cur = f.valueOf(cal); int next = f.floor(this,cur); if (cur==next) continue; // this field is already in a good shape. move on to next
for (CalendarField f : CalendarField.ADJUST_ORDER) { int cur = f.valueOf(cal); int next = f.floor(this, cur); if (cur == next) { continue; // this field is already in a good shape. move on to next
for (CalendarField f : CalendarField.ADJUST_ORDER) { int cur = f.valueOf(cal); int next = f.floor(this,cur); if (cur==next) continue; // this field is already in a good shape. move on to next
for (CalendarField f : CalendarField.ADJUST_ORDER) { int cur = f.valueOf(cal); int next = f.floor(this,cur); if (cur==next) continue; // this field is already in a good shape. move on to next