package Info; import Grades.*; /** * Represents a user class. */ public abstract class UserClass{ /** * Contains the basic information for this user class. */ public BasicInfo basicInfo; /** * The roster of students in the user class. */ public Roster roster; /** * The gradebook of the user class. */ public GradeBook gradeBook; /** * changeInfo adds information to this.basicInfo, replacing any * previously entered information. */ public abstract void changeInfo(BasicInfo newInfo); /** * addStudent updates the class roster with the new student. */ /*@ requires // // There must be a class roster. // (roster != null) && // // Student must at least have a first name. // (newStudent.firstName != null) && (newStudent.firstName.length() > 0); ensures // // If the preconditions are met, the class will be updated with the new student. // (\forall Student aStudent; (roster.students.contains(aStudent)) <==> aStudent.equals(newStudent) || \old(roster.students).contains(aStudent)); @*/ public abstract void addStudent(Student newStudent); /** * Deletes the given Student from the given Roster. */ /*@ requires // // The passed Student to be deleted is a Student in the input Roster. // ((\exists Student aStudent ; roster.students.contains(aStudent) ; aStudent.equals(toRemove))); ensures // // If preconditions are met, a user class is in the output classes if and only // if it is not the existing class to be deleted or it is in the input classes. // (\forall Student aStudent ; (roster.students.contains(aStudent)) <==> !aStudent.equals(toRemove) && \old(roster.students).contains(aStudent)); @*/ public abstract void removeStudent(Student toRemove); }