package course; import java.util.Collection; import java.util.List; /** * This class represents a course that is taught by an instructor * This class relates to the Test Management rquirements page in section 2.4, * as it organizes tests and sections based on which course they belong to, as well * as deploying the tests to be taken by a particular course. */ public abstract class Course { String courseID; Collection
sections; List tests; public Course(String id) { } /** * Adds a new section for this course post: // there must be a new section in this course // i.e. section collection size must be one more than before (sections.size()+1 == sections'.size()); */ public abstract void addNewSection(); /** * Removes a new section from this course pre: // section S must be in the collection (sections.contains(s)); post: // section S must not be in the collection // the collection size must be one less than before (!sections'.contains(s)) && (sections'.size() == sections.size()-1); */ public abstract void removeSection(Section s); /** * Adds a test for this course pre: // test t must not be in the list of tests (!tests.contains(t)); post: // test t must be in the list // the list size must be one more than before (tests'.contains(t)) && (tests'.size() == tests.size()+1); */ public abstract void addTest(Test t); }