if (!point.equals(new Date(TimeSpan.MAX_VALUE))) { newElem.addElement((ScheduleElement)new ScheduleElementImpl(point,new Date(TimeSpan.MAX_VALUE))); } if (newElem.size() == 0) return x; else return ldmf.newSchedule(newElem.elements()); }
  public Schedule timeInverse(Schedule x, PlanningFactory ldmf) {    Vector newElem = new Vector();    Date point = new Date(0);    Enumeration enum = x.getAllScheduleElements();    // As I understand it this is getting a enum from an ordered set and is therefore ordered    while (enum.hasMoreElements()) {      ScheduleElement se = (ScheduleElement)enum.nextElement();      if (point.before(se.getStartDate())) {	newElem.addElement((ScheduleElement)new ScheduleElementImpl(point,se.getStartDate()));      }      point = se.getEndDate();    }