block.setup = ma.getStartTime(); block.wrapup = ma.getEndTime();
  public Block getFixedBlock (Task task, int start, int end,                              boolean grouped, boolean ignorePrePost,                              SchedulingSpecs specs) {    Block block = new Block();    block.start = start;    block.end = end;    block.setup = start;    block.wrapup = end;    if (ignorePrePost)      return block;    if (grouped) {      Iterator iter = schedule.iterator();      while (iter.hasNext()) {        Object o = iter.next();        if (! (o instanceof MultitaskAssignment))          continue;        MultitaskAssignment ma = (MultitaskAssignment) o;        if ((start >= ma.getTaskStartTime()) &&            (end <= ma.getTaskEndTime()) &&            specs.areGroupable (task, ma.getTasks()[0])) {          block.groupedAssignment = ma;          return block;        }      }    }    TimeBlock curr = null, prev = null;    Iterator iter = schedule.iterator();    while (iter.hasNext()) {      curr = (TimeBlock) iter.next();      if (curr.getStartTime() < start) {        prev = curr;        curr = null;      }    }    if ((prev == null) || (! (prev instanceof Assignment)))      block.setup = start - specs.setupDuration (task, null, this);    else {      Assignment a = (Assignment) prev;      block.setup = start - specs.setupDuration (task, a.getTask(), this);      block.preWrapup = a.getEndTime() +        specs.wrapupDuration (a.getTask(), task, this);      block.preAssignment = a;    }    if ((curr == null) || (! (curr instanceof Assignment)))      block.wrapup = end + specs.wrapupDuration (task, null, this);    else {      Assignment a = (Assignment) curr;      block.wrapup = end + specs.wrapupDuration (task, a.getTask(), this);      block.postSetup = a.getStartTime() -        specs.setupDuration (a.getTask(), task, this);      block.postAssignment = a;    }    return block;  }