Esempio n. 1
0
  public List<ProjectEvent> getLatestProjectEvents(int min) {
    List<ProjectEvent> events = getProjectEvents();
    Collections.sort(events, ProjectEvent.DATE_AND_TIME_COMPARATOR);

    DateAndTime deadline = new DateAndTime(Date.today().prevDay(), Time.now());
    List<ProjectEvent> ret = new ArrayList<ProjectEvent>();
    int count = 0;
    for (ProjectEvent event : events) {
      ret.add(event);
      count++;
      DateAndTime dateAndTime = event.getDateAndTime();
      if (count > min && dateAndTime.isBefore(deadline)) break;
    }
    return ret;
  }
 public MaxTemperatureProfilSwitchPoint getSwitchPointForNow() {
   return getSwitchPoint(Time.now());
 }