@Test public void testGetWhen() { }
public Date getWhen() { String s = cfg.get ("start")+":00:00"; int hh = Integer.parseInt(s.substring (0, 2)); int mm = Integer.parseInt(s.substring (3, 5)); int ss = Integer.parseInt(s.substring (6, 8)); Date now = new Date(); Calendar cal = new GregorianCalendar(); cal.setTime (now); cal.set (Calendar.HOUR_OF_DAY, hh); cal.set (Calendar.MINUTE, mm); cal.set (Calendar.SECOND, ss); Date when = cal.getTime(); if (when.before(now)) when = new Date(when.getTime() + 24*60*60*1000); return when; }
DailyTaskAdaptor extends QBeanSupport implements Runnable { public Date getWhen() { String s = cfg.get ("start")+":00:00"; int hh = Integer.parseInt(s.substring (0, 2)); int mm = Integer.parseInt(s.substring (3, 5)); int ss = Integer.parseInt(s.substring (6, 8)); Date now = new Date(); Calendar cal = new GregorianCalendar(); cal.setTime (now); cal.set (Calendar.HOUR_OF_DAY, hh); cal.set (Calendar.MINUTE, mm); cal.set (Calendar.SECOND, ss); Date when = cal.getTime(); if (when.before(now)) when = new Date(when.getTime() + 24*60*60*1000); return when; } }
DailyTaskAdaptor extends QBeanSupport implements Runnable { public Date getWhen() { String s = cfg.get ("start")+":00:00"; int hh = Integer.parseInt(s.substring (0, 2)); int mm = Integer.parseInt(s.substring (3, 5)); int ss = Integer.parseInt(s.substring (6, 8)); Date now = new Date(); Calendar cal = new GregorianCalendar(); cal.setTime (now); cal.set (Calendar.HOUR_OF_DAY, hh); cal.set (Calendar.MINUTE, mm); cal.set (Calendar.SECOND, ss); Date when = cal.getTime(); if (when.before(now)) when = new Date(when.getTime() + 24*60*60*1000); return when; } DailyTaskAdaptor(); }
DailyTaskAdaptor extends QBeanSupport implements Runnable { public Date getWhen() { String s = cfg.get ("start")+":00:00"; int hh = Integer.parseInt(s.substring (0, 2)); int mm = Integer.parseInt(s.substring (3, 5)); int ss = Integer.parseInt(s.substring (6, 8)); Date now = new Date(); Calendar cal = new GregorianCalendar(); cal.setTime (now); cal.set (Calendar.HOUR_OF_DAY, hh); cal.set (Calendar.MINUTE, mm); cal.set (Calendar.SECOND, ss); Date when = cal.getTime(); if (when.before(now)) when = new Date(when.getTime() + 24*60*60*1000); return when; } DailyTaskAdaptor(); void run(); Date getWhen(); }
DailyTaskAdaptor extends QBeanSupport implements Runnable { public Date getWhen() { String s = cfg.get ("start")+":00:00"; int hh = Integer.parseInt(s.substring (0, 2)); int mm = Integer.parseInt(s.substring (3, 5)); int ss = Integer.parseInt(s.substring (6, 8)); Date now = new Date(); Calendar cal = new GregorianCalendar(); cal.setTime (now); cal.set (Calendar.HOUR_OF_DAY, hh); cal.set (Calendar.MINUTE, mm); cal.set (Calendar.SECOND, ss); Date when = cal.getTime(); if (when.before(now)) when = new Date(when.getTime() + 24*60*60*1000); return when; } DailyTaskAdaptor(); void run(); Date getWhen();  }