package admin; import java.util.Collection; /** ** A InstructorDB object is generated by the ** InstructorDB generator and contains records ** relating to all the courses. ** @author isellar **/ public abstract class InstructorDB{ public Collection instructors; public InstructorDB instructorDB; /** * The add function will allow you to add an item to the current database */ /*@ requires // // The Instructor's full name is unique and not null // (i.name != null && ! (\exists Instructor instructor; instructorDB.contains(instructor); (i.name.equals(instructor.name)))) && // // The Instructor Department is not empty // As with the course database if it is necessary // to have an instructor with no department // then one should be created to represent that // (i.dept != null) && // // The Instructor's Work Time Units (WTUs) // must be a non null integer above 0 // (i.WTU != null && i.WTU > 0); ensures // // If precondition are met, then a new instructor is added // to the temporary course database. // (\forall Instructor instructor; (instructors.contains(instructor) <==> ((\old(instructors.contains(instructor))) || instructor == i) )); @*/ public abstract void add(Instructor i); /** * The remove function will allow you to remove a database entry */ /*@ requires // // The given instructor exists in the instructor database // (\exists Instructor in; instructorDB.contains(in); (in.equals(i))); ensures // // If preconditions are met, // then the instructor will be removed from the database // (\forall Instructor i_item; instructorDB.contains(i_item) <==> i_item.equals(i) && \old(instructorDB).contains(i_item)); @*/ public abstract void remove(Instructor i); public abstract boolean contains(Instructor i); }