Iterator due_outs; for (int i=0; i < dueOutList.size(); i++) { due_outs = ((ArrayList)dueOutList.get(i)).iterator(); while (due_outs.hasNext()) { Task task = (Task)due_outs.next(); if (task.getVerb().equals(Constants.Verb.WITHDRAW)) { tmpWdraw.add(task); } else { if (!tmpProjWdraw.contains(task)) { tmpProjWdraw.add(task); } } }
Iterator due_outs; for (int i = 0; i < dueOutList.size(); i++) { due_outs = ((ArrayList) dueOutList.get(i)).iterator(); while (due_outs.hasNext()) { Task task = (Task) due_outs.next(); if (task.getVerb().equals(Constants.Verb.WITHDRAW)) { tmpWdraw.add(task); } else { if (!tmpProjWdraw.contains(task)) { tmpProjWdraw.add(task); } } } } projWithdrawList = tmpProjWdraw; withdrawList = tmpWdraw;  Iterator projResupplyIt = refillProjections.iterator(); while (projResupplyIt.hasNext()) { Task task = (Task) projResupplyIt.next(); if (!tmpProjResupply.contains(task)) { tmpProjResupply.add(task); } }  projSupplyList = tmpProjResupply; supplyList = (ArrayList) refillRequisitions.clone();    ArrayList tmpActualDemandTasksList = new ArrayList(); for (int i = 0; i < dueOutList.size(); i++) { tmpActualDemandTasksList.add(getActualDemandTasks(i)); } actualDemandTasksList = tmpActualDemandTasksList;  Vector list = new Vector(); long start = convertBucketToTime(0); for (int i = 0; i < criticalLevelsArray.length; i++) { if (criticalLevelsArray[i] >= 0.0) { list.add(ScheduleUtils.buildQuantityScheduleElement(criticalLevelsArray[i], start, start + MSEC_PER_BUCKET)); } start += MSEC_PER_BUCKET; } bufferedCriticalLevels = GLMFactory.newQuantitySchedule(list.elements(), PlanScheduleType.OTHER); start = convertBucketToTime(0); list.clear(); for (int i = 0; i < targetLevelsList.size(); i++) { Double targetLevel = (Double) targetLevelsList.get(i); if (targetLevel != null) { list.add(ScheduleUtils.buildQuantityScheduleElement(targetLevel.doubleValue(), start, start + MSEC_PER_BUCKET)); } start += MSEC_PER_BUCKET; } bufferedTargetLevels = GLMFactory.newQuantitySchedule(list.elements(), PlanScheduleType.OTHER);   start = convertBucketToTime(0); list.clear(); for (int i = 0; i < inventoryLevelsArray.length; i++) { list.add(ScheduleUtils.buildQuantityScheduleElement(inventoryLevelsArray[i], start, start + MSEC_PER_BUCKET)); start += MSEC_PER_BUCKET; } bufferedInventoryLevels = GLMFactory.newQuantitySchedule(list.elements(), PlanScheduleType.OTHER); NewScheduledContentPG scp = (NewScheduledContentPG) inventory.getScheduledContentPG(); scp.setSchedule(bufferedInventoryLevels);
  public void takeSnapshot(Inventory inventory) {    ArrayList tmpProjWdraw = new ArrayList();    ArrayList tmpWdraw = new ArrayList();    ArrayList tmpProjResupply = new ArrayList();    Iterator due_outs;    for (int i=0; i < dueOutList.size(); i++) {      due_outs = ((ArrayList)dueOutList.get(i)).iterator();      while (due_outs.hasNext()) {	Task task = (Task)due_outs.next();	if (task.getVerb().equals(Constants.Verb.WITHDRAW)) {	  tmpWdraw.add(task);	} else { // PROJECTWITHDRAW	  if (!tmpProjWdraw.contains(task)) {	    tmpProjWdraw.add(task);	  }	}      }    }    projWithdrawList =tmpProjWdraw;    withdrawList = tmpWdraw;        Iterator projResupplyIt = refillProjections.iterator();    while(projResupplyIt.hasNext()) {	Task task = (Task) projResupplyIt.next();	if(!tmpProjResupply.contains(task)) {	    tmpProjResupply.add(task);	}    }    projSupplyList = tmpProjResupply;    supplyList = (ArrayList)refillRequisitions.clone();    // MWD took this out when converted list to a schedule.    //    bufferedTargetLevels = (ArrayList)targetLevelsList.clone();    ArrayList tmpActualDemandTasksList = new ArrayList();    for (int i=0; i < dueOutList.size(); i++) {      tmpActualDemandTasksList.add(getActualDemandTasks(i));    }    actualDemandTasksList = tmpActualDemandTasksList;    Vector list = new Vector();    long start = convertBucketToTime(0);    for (int i=0; i < criticalLevelsArray.length; i++) {	if(criticalLevelsArray[i] >= 0.0) {	    list.add(ScheduleUtils.buildQuantityScheduleElement(criticalLevelsArray[i],								start, start+MSEC_PER_BUCKET));	}	start += MSEC_PER_BUCKET;    }    bufferedCriticalLevels = GLMFactory.newQuantitySchedule(list.elements(), 							    PlanScheduleType.OTHER);    start = convertBucketToTime(0);    list.clear();    for (int i=0; i < targetLevelsList.size(); i++) {	Double targetLevel = (Double)targetLevelsList.get(i);	if(targetLevel != null) {	    list.add(ScheduleUtils.buildQuantityScheduleElement(targetLevel.doubleValue(),start,start+MSEC_PER_BUCKET));	}	start += MSEC_PER_BUCKET;    }    bufferedTargetLevels = GLMFactory.newQuantitySchedule(list.elements(),							    PlanScheduleType.OTHER);        start = convertBucketToTime(0);    list.clear();    for (int i=0; i < inventoryLevelsArray.length; i++) {	    list.add(ScheduleUtils.buildQuantityScheduleElement(inventoryLevelsArray[i],								start, start+MSEC_PER_BUCKET));      start += MSEC_PER_BUCKET;    }    bufferedInventoryLevels = GLMFactory.newQuantitySchedule(list.elements(), 							    PlanScheduleType.OTHER);    NewScheduledContentPG scp = (NewScheduledContentPG)inventory.getScheduledContentPG();    scp.setSchedule(bufferedInventoryLevels);  }