if (debug) reportTime ("\t\tWrote resources in ", start);
  private String textForSchedule () {    Task[] tasks = data.getTasks();    StringBuffer text = new StringBuffer (tasks.length * 200);    text.append ("<?xml version='1.0'?>\n<SCHEDULE>\n");    boolean isEndTime = data.getEndTime() != Integer.MAX_VALUE;    int maxTime = isEndTime ? data.getEndTime() : data.getStartTime();    for (int i = 0; i < tasks.length; i++) {      Assignment assign = tasks[i].getAssignment();      if (assign != null) {        assign.setColor (specs.getColor (tasks[i]));        assign.setText (specs.taskText (tasks[i]));        text.append (assign).append ("\n");        if ((! isEndTime) && (maxTime < assign.getEndTime()))          maxTime = assign.getEndTime();      }    }    Resource[] resources = data.getResources();    for (int i = 0; i < resources.length; i++) {      TimeBlock[] activities = resources[i].getActivities();      for (int j = 0; j < activities.length; j++)        if (updateActivity (activities[j], maxTime))          text.append            (activities[j].activityString (resources[i])).append ("\n");      MultitaskAssignment[] multi = resources[i].getMultitaskAssignments();      for (int j = 0; j < multi.length; j++)        if (updateActivity (multi[j], maxTime)) {          multi[j].setColor (specs.getColor (multi[j].getTasks()));          multi[j].setText (specs.groupedText (multi[j].getTasks()));          text.append (multi[j]).append ("\n");        }    }    text.append ("</SCHEDULE>\n");    return text.toString();  }