NewQuantityScheduleElement qse = new QuantityScheduleElementImpl(startTime, endTime, quantity); schedule.addScheduleElement(qse);
NewQuantityScheduleElement qse = new QuantityScheduleElementImpl(startTime, endTime, quantity); schedule.addScheduleElement(qse); } else { int[] ats = ar.getAspectTypes(); int qtyInd = getIndexForType(ats, AspectType.QUANTITY); int startInd = getIndexForType(ats, AspectType.START_TIME); int endInd = getIndexForType(ats, AspectType.END_TIME); Enumeration phasedResults = ar.getPhasedResults(); while (phasedResults.hasMoreElements()) { double[] results = (double[]) phasedResults.nextElement(); double phasedQuantity = (double) results[qtyInd]; long phasedEndTime = (long) results[endInd]; long phasedStartTime; if (startInd == -1) { phasedStartTime = phasedEndTime -1; } else { phasedStartTime = (long) results[startInd]; } NewQuantityScheduleElement pqse = new QuantityScheduleElementImpl(phasedStartTime, phasedEndTime, phasedQuantity); schedule.addScheduleElement(pqse); } }
  private Schedule getSuccessfulElements(Collection list) {    if (list == null)      return null;    ScheduleImpl schedule = new ScheduleImpl();    schedule.setScheduleElementType(QuantityScheduleElementImpl.class);    Iterator i = list.iterator();    while (i.hasNext()) {      Task task = (Task) i.next();      if (task == null)        continue;      PlanElement pe = task.getPlanElement();      if (pe == null)        continue;      AllocationResult ar = pe.getReportedResult();      if (ar != null && ar.isSuccess()) {        long endTime = TaskUtils.getEndTime(task);         long startTime = getStartTime(task, endTime, false);        double quantity = TaskUtils.getDailyQuantity(task);                NewQuantityScheduleElement qse = new QuantityScheduleElementImpl(startTime,                                                                         endTime,                                                                         quantity);        schedule.addScheduleElement(qse);      }    }    return schedule;  }