ScheduleType.TOTAL_INVENTORY);
PlanScheduleType.TOTAL_INVENTORY);
    public int updateContentSchedule(Inventory inventory) {	ScheduledContentPG scp = inventory.getScheduledContentPG();	Schedule sched = scp.getSchedule();	QuantityScheduleElement qse;	Vector new_elements = new Vector();	if (level_ == null) {            determineInventoryLevels();        }	if (level_ == null) {	    GLMDebug.DEBUG("InventoryBG", "UpdateContentSchedule(), No DueOuts or DueIns, resetting schedule.");	    clearContentSchedule(inventory);	}	else {	    int days = level_.length;//  	    GLMDebug.DEBUG("InventoryBG", "UpdateContentSchedule(), Creating new Schedule for "+AssetUtils.assetDesc(inventory));	    for (int i=0; i < days; i++) {		// start time is eigher today or time 1st request was received + number of planning days		long start = TimeUtils.addNDaysTime(getStartTime(), i);		// end time is a millisecond before start time of next day		long end = TimeUtils.addNDaysTime(getStartTime(), (i+1));		try {                  qse = ScheduleUtils.buildQuantityScheduleElement(level_[i], start, end);                } catch (IllegalArgumentException iae) {                  iae.printStackTrace();                  continue;                }//  		GLMDebug.DEBUG("InventoryBG", "UpdateContentSchedule(), Start:"+TimeUtils.dateString(start)+//  			       ", End:"+TimeUtils.dateString(end)+", Qty: "+level_[i]);		new_elements.add(qse);	    }	}	Schedule new_schedule = ALPFactory.newQuantitySchedule(new_elements.elements(), 							       ScheduleType.TOTAL_INVENTORY);	if (ScheduleUtils.isOffendingSchedule(new_schedule)) {	    GLMDebug.ERROR("InventoryBG", "UpdateContentSchedule(),  CREATED BAD SCHEDULE "); 	    printQuantityScheduleTimes(new_schedule);	}	((NewScheduledContentPG)scp).setSchedule(new_schedule);	return 0;    }