/** * *@author Kim Paterson */ package question; import java.util.Collection; public abstract class QuestionDB { /** * The list of questions contained in the */ private Collection questions; public String name; /** * Adds the input Question to the collection */ /*@ requires // // There is no Question with the same values as the // given input. // (! (\forall Question question ; question.equals(quest))) && // // The question is not null // (quest != null); ensures // // The given Question is in the question // questions.contains(quest) && (\forall QuestionItem question ; questions.contains(question) <==> questions.equals(quest) || \old(questions).contains(questions)); @*/ abstract void add(QuestionItem quest); /** * Removes the given Question from the data */ /*@ requires // // The given Question is in this.questions // (questions.contains(quest)); ensures // // A Question is in the database are if and only if // the are not equal to the input question. // (\forall Question question ; questions.contains(question) <==> !question.equals(quest) && \old(questions).contains(question)) ; @*/ abstract QuestionItem remove(QuestionItem quest); }