Map<String, Teacher> teacherMap = new HashMap<String, Teacher>();
List<Course> courseList = new ArrayList<Course>(courseListSize);
readEmptyLine();
readConstantLine("COURSES:");
for (int i = 0; i < courseListSize; i++) {
Course course = new Course();
course.setId((long) i);
// Courses: <CourseID> <Teacher> <# Lectures> <MinWorkingDays> <# Students>
String line = bufferedReader.readLine();
String[] lineTokens = splitBySpacesOrTabs(line, 5);
course.setCode(lineTokens[0]);
course.setTeacher(findOrCreateTeacher(teacherMap, lineTokens[1]));
course.setLectureSize(Integer.parseInt(lineTokens[2]));
course.setMinWorkingDaySize(Integer.parseInt(lineTokens[3]));
course.setCurriculumList(new ArrayList<Curriculum>());
course.setStudentSize(Integer.parseInt(lineTokens[4]));
courseList.add(course);
courseMap.put(course.getCode(), course);
}
schedule.setCourseList(courseList);
List<Teacher> teacherList = new ArrayList<Teacher>(teacherMap.values());
schedule.setTeacherList(teacherList);
return courseMap;