package create; import java.util.Collection; import resources.instructor.InstructorDB; import resources.course.CourseDB; import resources.room.RoomDB; import admin.GlobalConstraints; import preferences.CourseOverlap; /** * The object class Schedule has all the fields to build a schedule. When * constructed the schedule consists of a name, which the schedule will be * saved under, a term and year that the Schedule will take place, and a * collection of course sections. The schedule also has a copy of the unmodified * room, instructor, and course databases. * * @author cdreszer */ public abstract class Schedule { public String name; public Term term; public int year; public boolean published; public CourseDB courses; public RoomDB rooms; public InstructorDB instructors; public Collection
sections; public GlobalConstraints constraints; public CourseOverlap overlap; /** * Constructs a new schedule from the given name, term * year, resources databases (Instructor, Course, Room), * and global constraints. * * @return Schedule - the newly generated schedule * pre: // // The Course, Instructor, and Room databases must not be empty. // (!instructors.instructors.isEmpty() && !courses.courses.isEmpty() && !rooms.rooms.isEmpty()); post: // // // */ public abstract Schedule generateSchedule(String name, Term term, int year, CourseDB courses, InstructorDB instructors, RoomDB rooms, GlobalConstraints constraints, CourseOverlap overlap); /** * Inserts a Section into the Schedule. * pre: // // There is no section in the input db with the same class // number as the schedule to be added. // !exists (Section other; sections.contains(other); section.classNumber == other.classNumber); post: // // A section is in the output db if and only if it is the section // to be added or it is in the input db. // forall (Section other; sections'.contains(section) iff other.equals(section) || sections.contains(other)); */ public abstract void insertSection(Section section); /** * Removes the specified Section from the Schedule. * pre: // // The given Section is in sections. // sections.contains(section); post: // // A section is in the output db if and only if it is not the existing // section to be removed and it is in the input db. // forall (Section other; sections'.contains(other) iff !other.equals(section) && sections.contains(other)); */ public abstract void removeSection(Section section); }