From f625274daca149daa86ac7718c38d5318bf2cea9 Mon Sep 17 00:00:00 2001 From: Cy Date: Mon, 12 Oct 2020 16:43:16 +0800 Subject: [PATCH 1/4] Add and delete student --- .../seedu/address/commons/core/Messages.java | 5 +- .../logic/commands/AddStudentCommand.java | 57 +++++++++++++++ .../logic/commands/DeleteStudentCommand.java | 69 +++++++++++++++++++ .../logic/parser/AddStudentCommandParser.java | 50 ++++++++++++++ .../parser/DeleteStudentCommandParser.java | 50 ++++++++++++++ .../address/logic/parser/SerenityParser.java | 8 +++ src/main/java/seedu/address/model/Model.java | 14 +++- .../seedu/address/model/ModelManager.java | 29 +++++++- .../java/seedu/address/model/group/Group.java | 55 +++++++++++++-- .../logic/commands/AddCommandTest.java | 10 +++ .../logic/commands/AddGrpCommandTest.java | 11 +++ 11 files changed, 345 insertions(+), 13 deletions(-) create mode 100644 src/main/java/seedu/address/logic/commands/AddStudentCommand.java create mode 100644 src/main/java/seedu/address/logic/commands/DeleteStudentCommand.java create mode 100644 src/main/java/seedu/address/logic/parser/AddStudentCommandParser.java create mode 100644 src/main/java/seedu/address/logic/parser/DeleteStudentCommandParser.java diff --git a/src/main/java/seedu/address/commons/core/Messages.java b/src/main/java/seedu/address/commons/core/Messages.java index 0b303c2b293..3a127c16435 100644 --- a/src/main/java/seedu/address/commons/core/Messages.java +++ b/src/main/java/seedu/address/commons/core/Messages.java @@ -12,8 +12,9 @@ public class Messages { // Serenity messages public static final String MESSAGE_GROUP_LISTED_OVERVIEW = "You are in tutorial group %1$s."; - public static final String MESSAGE_GROUP_EMPTY = "no such group!"; + public static final String MESSAGE_GROUP_EMPTY = "No such group!"; public static final String MESSAGE_LESSON_LISTED_OVERVIEW = "You are in tutorial group %1$s, lesson %2$s."; - public static final String MESSAGE_LESSON_EMPTY = "no such lesson!"; + public static final String MESSAGE_LESSON_EMPTY = "No such lesson!"; + public static final String MESSAGE_STUDENT_EMPTY = "No such student!"; } diff --git a/src/main/java/seedu/address/logic/commands/AddStudentCommand.java b/src/main/java/seedu/address/logic/commands/AddStudentCommand.java new file mode 100644 index 00000000000..1a1221e572b --- /dev/null +++ b/src/main/java/seedu/address/logic/commands/AddStudentCommand.java @@ -0,0 +1,57 @@ +package seedu.address.logic.commands; + +import static seedu.address.commons.core.Messages.MESSAGE_GROUP_EMPTY; +import static seedu.address.commons.util.CollectionUtil.requireAllNonNull; +import static seedu.address.logic.parser.CliSyntax.PREFIX_GRP; +import static seedu.address.logic.parser.CliSyntax.PREFIX_ID; +import static seedu.address.logic.parser.CliSyntax.PREFIX_STUDENT; + +import seedu.address.logic.commands.exceptions.CommandException; +import seedu.address.model.Model; +import seedu.address.model.group.GrpContainsKeywordPredicate; +import seedu.address.model.group.Student; + +public class AddStudentCommand extends Command { + + public static final String COMMAND_WORD = "addstudent"; + public static final String MESSAGE_USAGE = COMMAND_WORD + + ": Adds a new Student to a specified tutorial group. \n" + + "Parameters: " + + PREFIX_GRP + "GRP " + + PREFIX_STUDENT + "NAME " + + PREFIX_ID + "Student ID \n" + + "Example: " + COMMAND_WORD + " " + PREFIX_GRP + "G04" + + " " + PREFIX_STUDENT + "Ryan" + " " + PREFIX_ID + "e1234567"; + + public static final String MESSAGE_SUCCESS = "You added %s (%s) to tutorial group %s"; + + private final String studentName; + private final String studentId; + private final GrpContainsKeywordPredicate predicate; + + /** + * Creates an AddStudentCommand to add the specified {@code Student} + * @param studentName + * @param studentId + * @param predicate + */ + public AddStudentCommand(String studentName, String studentId, GrpContainsKeywordPredicate predicate) { + requireAllNonNull(studentName, studentId, predicate); + this.studentName = studentName; + this.studentId = studentId; + this.predicate = predicate; + } + + @Override + public CommandResult execute(Model model) throws CommandException { + Student student = new Student(studentName, studentId); + model.addStudentToGroup(student, predicate); + if (model.getFilteredGroupList().isEmpty()) { + //no such group exists + return new CommandResult(MESSAGE_GROUP_EMPTY); + } else { + return new CommandResult( + String.format(MESSAGE_SUCCESS, studentName, studentId, model.getFilteredGroupList().get(0).getName())); + } + } +} diff --git a/src/main/java/seedu/address/logic/commands/DeleteStudentCommand.java b/src/main/java/seedu/address/logic/commands/DeleteStudentCommand.java new file mode 100644 index 00000000000..c4d7dbbbec0 --- /dev/null +++ b/src/main/java/seedu/address/logic/commands/DeleteStudentCommand.java @@ -0,0 +1,69 @@ +package seedu.address.logic.commands; + +import static seedu.address.commons.core.Messages.MESSAGE_GROUP_EMPTY; +import static seedu.address.commons.core.Messages.MESSAGE_STUDENT_EMPTY; +import static seedu.address.commons.util.CollectionUtil.requireAllNonNull; +import static seedu.address.logic.parser.CliSyntax.PREFIX_GRP; +import static seedu.address.logic.parser.CliSyntax.PREFIX_ID; +import static seedu.address.logic.parser.CliSyntax.PREFIX_STUDENT; + +import javafx.collections.ObservableList; +import seedu.address.logic.commands.exceptions.CommandException; +import seedu.address.model.Model; +import seedu.address.model.group.Group; +import seedu.address.model.group.GrpContainsKeywordPredicate; +import seedu.address.model.group.Student; + +public class DeleteStudentCommand extends Command { + + public static final String COMMAND_WORD = "delstudent"; + public static final String MESSAGE_USAGE = COMMAND_WORD + + ": Removes a new Student from a specified tutorial group. \n" + + "Parameters: " + + PREFIX_GRP + "GRP " + + PREFIX_STUDENT + "NAME " + + PREFIX_ID + "Student ID \n" + + "Example: " + COMMAND_WORD + " " + PREFIX_GRP + "G04" + " " + PREFIX_STUDENT + "Ryan" + " " + PREFIX_ID + + "e1234567"; + + public static final String MESSAGE_SUCCESS = "You removed %s (%s) from tutorial group %s"; + + private final String studentName; + private final String studentId; + private final GrpContainsKeywordPredicate predicate; + + /** + * Creates a DeleteStudentCommand to remove the specified {@code Student} + * @param studentName Name of Student + * @param studentId Id of Student + * @param predicate Group predicate + */ + public DeleteStudentCommand(String studentName, String studentId, GrpContainsKeywordPredicate predicate) { + requireAllNonNull(studentName, studentId, predicate); + this.studentName = studentName; + this.studentId = studentId; + this.predicate = predicate; + } + + + @Override + public CommandResult execute(Model model) throws CommandException { + Student student = new Student(studentName, studentId); + model.updateFilteredGroupList(predicate); + ObservableList groups = model.getFilteredGroupList(); + if (groups.isEmpty()) { + //no such group + return new CommandResult(MESSAGE_GROUP_EMPTY); + } + if (!groups.get(0).getStudents().contains(student)) { + //student does not exist + return new CommandResult(MESSAGE_STUDENT_EMPTY); + } else { + model.removeStudentFromGroup(student, predicate); + model.updateFilteredGroupList(predicate); + return new CommandResult( + String.format(MESSAGE_SUCCESS, studentName, studentId, model.getFilteredGroupList().get(0).getName())); + } + } + +} diff --git a/src/main/java/seedu/address/logic/parser/AddStudentCommandParser.java b/src/main/java/seedu/address/logic/parser/AddStudentCommandParser.java new file mode 100644 index 00000000000..311a818d7e1 --- /dev/null +++ b/src/main/java/seedu/address/logic/parser/AddStudentCommandParser.java @@ -0,0 +1,50 @@ +package seedu.address.logic.parser; + +import static seedu.address.commons.core.Messages.MESSAGE_INVALID_COMMAND_FORMAT; +import static seedu.address.logic.parser.CliSyntax.PREFIX_GRP; +import static seedu.address.logic.parser.CliSyntax.PREFIX_ID; +import static seedu.address.logic.parser.CliSyntax.PREFIX_STUDENT; + +import java.util.stream.Stream; + +import seedu.address.logic.commands.AddStudentCommand; +import seedu.address.logic.parser.exceptions.ParseException; +import seedu.address.model.group.GrpContainsKeywordPredicate; + +public class AddStudentCommandParser implements Parser { + + private final ParseException addStudentCommandParserException = new ParseException( + String.format(MESSAGE_INVALID_COMMAND_FORMAT, AddStudentCommand.MESSAGE_USAGE)); + + @Override + public AddStudentCommand parse(String args) throws ParseException { + ArgumentMultimap argMultimap = ArgumentTokenizer.tokenize(args, PREFIX_GRP, PREFIX_STUDENT, PREFIX_ID); + + if (!arePrefixesPresent(argMultimap, PREFIX_GRP, PREFIX_STUDENT, PREFIX_ID) || !argMultimap.getPreamble() + .isEmpty()) { + throw addStudentCommandParserException; + } + + String[] grpKeywordArray = argMultimap.getValue(PREFIX_GRP).get().split("\\s+"); + String[] studentNameArray = argMultimap.getValue(PREFIX_STUDENT).get().split("\\s+"); + String[] studentIdArray = argMultimap.getValue(PREFIX_ID).get().split("\\s+"); + + //if id or group keyword is more than 1, or if student name has more than 10 letters, throw exception + boolean matchesGrp = grpKeywordArray.length == 1; + boolean matchesId = studentIdArray.length == 1 && studentIdArray[0].length() == 8; + boolean matchesStudentName = studentNameArray.length <= 10; + if (!matchesGrp || !matchesId || !matchesStudentName) { + throw addStudentCommandParserException; + } + + String studentName = String.join(" ", studentNameArray); + String studentId = studentIdArray[0]; + String grpName = grpKeywordArray[0]; + + return new AddStudentCommand(studentName, studentId, new GrpContainsKeywordPredicate(grpName)); + } + + private static boolean arePrefixesPresent(ArgumentMultimap argumentMultimap, Prefix... prefixes) { + return Stream.of(prefixes).allMatch(prefix -> argumentMultimap.getValue(prefix).isPresent()); + } +} diff --git a/src/main/java/seedu/address/logic/parser/DeleteStudentCommandParser.java b/src/main/java/seedu/address/logic/parser/DeleteStudentCommandParser.java new file mode 100644 index 00000000000..81cdbdb5f60 --- /dev/null +++ b/src/main/java/seedu/address/logic/parser/DeleteStudentCommandParser.java @@ -0,0 +1,50 @@ +package seedu.address.logic.parser; + +import static seedu.address.commons.core.Messages.MESSAGE_INVALID_COMMAND_FORMAT; +import static seedu.address.logic.parser.CliSyntax.PREFIX_GRP; +import static seedu.address.logic.parser.CliSyntax.PREFIX_ID; +import static seedu.address.logic.parser.CliSyntax.PREFIX_STUDENT; + +import java.util.stream.Stream; + +import seedu.address.logic.commands.DeleteStudentCommand; +import seedu.address.logic.parser.exceptions.ParseException; +import seedu.address.model.group.GrpContainsKeywordPredicate; + +public class DeleteStudentCommandParser implements Parser { + + private final ParseException deleteStudentCommandParserException = new ParseException( + String.format(MESSAGE_INVALID_COMMAND_FORMAT, DeleteStudentCommand.MESSAGE_USAGE)); + + @Override + public DeleteStudentCommand parse(String args) throws ParseException { + ArgumentMultimap argMultimap = ArgumentTokenizer.tokenize(args, PREFIX_GRP, PREFIX_STUDENT, PREFIX_ID); + + if (!arePrefixesPresent(argMultimap, PREFIX_GRP, PREFIX_STUDENT, PREFIX_ID) || !argMultimap.getPreamble() + .isEmpty()) { + throw deleteStudentCommandParserException; + } + + String[] grpKeywordArray = argMultimap.getValue(PREFIX_GRP).get().split("\\s+"); + String[] studentNameArray = argMultimap.getValue(PREFIX_STUDENT).get().split("\\s+"); + String[] studentIdArray = argMultimap.getValue(PREFIX_ID).get().split("\\s+"); + + //if id or group keyword is more than 1, or if student name has more than 10 letters, throw exception + boolean matchesGrp = grpKeywordArray.length == 1; + boolean matchesId = studentIdArray.length == 1 && studentIdArray[0].length() == 8; + boolean matchesStudentName = studentNameArray.length <= 10; + if (!matchesGrp || !matchesId || !matchesStudentName) { + throw deleteStudentCommandParserException; + } + + String studentName = String.join(" ", studentNameArray); + String studentId = studentIdArray[0]; + String grpName = grpKeywordArray[0]; + + return new DeleteStudentCommand(studentName, studentId, new GrpContainsKeywordPredicate(grpName)); + } + + private static boolean arePrefixesPresent(ArgumentMultimap argumentMultimap, Prefix... prefixes) { + return Stream.of(prefixes).allMatch(prefix -> argumentMultimap.getValue(prefix).isPresent()); + } +} diff --git a/src/main/java/seedu/address/logic/parser/SerenityParser.java b/src/main/java/seedu/address/logic/parser/SerenityParser.java index 224942429f8..2c585e053c6 100644 --- a/src/main/java/seedu/address/logic/parser/SerenityParser.java +++ b/src/main/java/seedu/address/logic/parser/SerenityParser.java @@ -8,9 +8,11 @@ import seedu.address.logic.commands.AddCommand; import seedu.address.logic.commands.AddGrpCommand; +import seedu.address.logic.commands.AddStudentCommand; import seedu.address.logic.commands.ClearCommand; import seedu.address.logic.commands.Command; import seedu.address.logic.commands.DeleteCommand; +import seedu.address.logic.commands.DeleteStudentCommand; import seedu.address.logic.commands.EditCommand; import seedu.address.logic.commands.ExitCommand; import seedu.address.logic.commands.FindCommand; @@ -55,6 +57,12 @@ public Command parseCommand(String userInput) throws ParseException { case AddGrpCommand.COMMAND_WORD: return new AddGrpCommandParser().parse(arguments); + case AddStudentCommand.COMMAND_WORD: + return new AddStudentCommandParser().parse(arguments); + + case DeleteStudentCommand.COMMAND_WORD: + return new DeleteStudentCommandParser().parse(arguments); + case ViewGrpCommand.COMMAND_WORD: return new ViewGrpCommandParser().parse(arguments); diff --git a/src/main/java/seedu/address/model/Model.java b/src/main/java/seedu/address/model/Model.java index 24fcfd1dc3e..b717a9c5100 100644 --- a/src/main/java/seedu/address/model/Model.java +++ b/src/main/java/seedu/address/model/Model.java @@ -20,7 +20,6 @@ public interface Model { * {@code Predicate} that always evaluate to true */ Predicate PREDICATE_SHOW_ALL_PERSONS = unused -> true; - Predicate PREDICATE_SHOW_ALL_STUDENTS = unused -> true; /** * Replaces user prefs data with the data in {@code userPrefs}. @@ -128,6 +127,16 @@ public interface Model { */ void addGroup(Group group); + /** + * Adds a Student to a Group + */ + void addStudentToGroup(Student student, Predicate predicate); + + /** + * Removes a Student from a Group. + */ + void removeStudentFromGroup(Student student, Predicate predicate); + /** * Updates the filter of the filtered group list to filter by the given {@code predicate}. * @@ -158,7 +167,7 @@ public interface Model { void updateStudentInfoList(); /** - * Returns an unmodifiable view of the filtered group list. + * Returns an unmodifiable view of the filtered group list. >>>>>>> fac4dba56f526135ac3b78523ad40748ca5214b9 */ ObservableList getFilteredGroupList(); @@ -181,5 +190,4 @@ public interface Model { * Returns an unmodifiable view of the student info list */ ObservableList getStudentInfoList(); - } diff --git a/src/main/java/seedu/address/model/ModelManager.java b/src/main/java/seedu/address/model/ModelManager.java index 153e663247d..c8e574898ec 100644 --- a/src/main/java/seedu/address/model/ModelManager.java +++ b/src/main/java/seedu/address/model/ModelManager.java @@ -42,13 +42,13 @@ public class ModelManager implements Model { * Initializes a ModelManager with the given addressBook, userPrefs and serenity. */ public ModelManager(ReadOnlyAddressBook addressBook, ReadOnlyUserPrefs userPrefs, - ReadOnlySerenity serenity) { + ReadOnlySerenity serenity) { super(); requireAllNonNull(addressBook, userPrefs, serenity); logger.fine("Initializing with address book: " + addressBook - + " and user prefs " + userPrefs - + " and serenity " + serenity); + + " and user prefs " + userPrefs + + " and serenity " + serenity); this.addressBook = new AddressBook(addressBook); this.userPrefs = new UserPrefs(userPrefs); @@ -192,6 +192,29 @@ public void addGroup(Group group) { serenity.addGroup(group); } + @Override + public void addStudentToGroup(Student student, Predicate predicate) { + requireAllNonNull(student, predicate); + updateFilteredGroupList(predicate); + if (!filteredGroups.isEmpty()) { + students.add(student); + Group currentGroup = filteredGroups.get(0); + currentGroup.addStudentToGroup(student); + } + } + + @Override + public void removeStudentFromGroup(Student student, Predicate predicate) { + requireAllNonNull(student, predicate); + updateFilteredGroupList(predicate); + UniqueStudentList students = filteredGroups.get(0).getStudents(); + if (!filteredGroups.isEmpty() && students.contains(student)) { + students.remove(student); + Group currentGroup = filteredGroups.get(0); + currentGroup.removeStudentFromGroup(student); + } + } + @Override public void updateFilteredGroupList(Predicate predicate) { requireAllNonNull(predicate); diff --git a/src/main/java/seedu/address/model/group/Group.java b/src/main/java/seedu/address/model/group/Group.java index 3be2454c926..93e0182248c 100644 --- a/src/main/java/seedu/address/model/group/Group.java +++ b/src/main/java/seedu/address/model/group/Group.java @@ -21,9 +21,8 @@ public class Group { private String name; // Data fields - //private Set students; - private UniqueStudentList students; - private UniqueLessonList lessons; + private final UniqueStudentList students; + private final UniqueLessonList lessons; /** * Constructs a {@code Group} @@ -64,8 +63,8 @@ public Group(String name, UniqueStudentList students) { * @param lessons A list of tutorial classes. */ - public Group(String name, UniqueStudentList students, UniqueLessonList classes) { - requireAllNonNull(name, students, classes); + public Group(String name, UniqueStudentList students, UniqueLessonList lessons) { + requireAllNonNull(name, students, lessons); this.name = name; this.students = students; this.lessons = lessons; @@ -101,6 +100,51 @@ public int compare(Lesson o1, Lesson o2) { return lessons; } + /** + * Adds a Student to a Group + * + * @param student Student to be added + */ + public void addStudentToGroup(Student student) { + addToStudentList(student); + addToStudentListInLessons(student); + } + + /** + * Removes a Student from the Group. + * + * @param student Student to be added + */ + public void removeStudentFromGroup(Student student) { + removeStudentFromStudentListInLessons(student); + } + + + private void addToStudentList(Student student) { + students.add(student); + } + + + private void addToStudentListInLessons(Student student) { + for (Lesson lesson : lessons) { + StudentInfo newStudent = new StudentInfo(student); + UniqueStudentInfoList studentInfos = lesson.getStudentsInfo(); + studentInfos.add(newStudent); + Lesson updatedLesson = new Lesson(lesson.getName(), studentInfos); + lessons.setLesson(lesson, updatedLesson); + } + } + + private void removeStudentFromStudentListInLessons(Student student) { + for (Lesson lesson : lessons) { + StudentInfo newStudent = new StudentInfo(student); + UniqueStudentInfoList studentInfos = lesson.getStudentsInfo(); + studentInfos.remove(newStudent); + Lesson updatedLesson = new Lesson(lesson.getName(), studentInfos); + lessons.setLesson(lesson, updatedLesson); + } + } + /** * Returns true if both groups of the same name have at least one other identity field that is the same. This * defines a weaker notion of equality between two groups. @@ -147,4 +191,5 @@ public String toString() { return String.format("Group %s", name); } + } diff --git a/src/test/java/seedu/address/logic/commands/AddCommandTest.java b/src/test/java/seedu/address/logic/commands/AddCommandTest.java index d922474046e..93cf6850b3a 100644 --- a/src/test/java/seedu/address/logic/commands/AddCommandTest.java +++ b/src/test/java/seedu/address/logic/commands/AddCommandTest.java @@ -169,6 +169,16 @@ public void setSerenity(ReadOnlySerenity serenity) { throw new AssertionError("This method should not be called."); } + @Override + public void addStudentToGroup(Student student, Predicate predicate) { + throw new AssertionError("This method should not be called."); + } + + @Override + public void removeStudentFromGroup(Student student, Predicate predicate) { + throw new AssertionError("This method should not be called."); + } + @Override public ReadOnlySerenity getSerenity() { throw new AssertionError("This method should not be called."); diff --git a/src/test/java/seedu/address/logic/commands/AddGrpCommandTest.java b/src/test/java/seedu/address/logic/commands/AddGrpCommandTest.java index 52918c2b520..85b34504475 100644 --- a/src/test/java/seedu/address/logic/commands/AddGrpCommandTest.java +++ b/src/test/java/seedu/address/logic/commands/AddGrpCommandTest.java @@ -215,6 +215,17 @@ public ObservableList getFilteredGroupList() { throw new AssertionError("This method should not be called."); } + @Override + public void addStudentToGroup(Student student, Predicate predicate) { + throw new AssertionError("This method should not be called."); + } + + @Override + public void removeStudentFromGroup(Student student, Predicate predicate) { + throw new AssertionError("This method should not be called."); + } + + @Override public ObservableList getStudentList() { throw new AssertionError("This method should not be called."); From 9d973e6bc8b4872e15cbb7174c646d56f183246e Mon Sep 17 00:00:00 2001 From: Cy Date: Mon, 12 Oct 2020 17:34:21 +0800 Subject: [PATCH 2/4] Fix merge conflict --- .../java/seedu/address/logic/commands/DelGrpCommand.java | 7 ++----- src/main/java/seedu/address/model/group/Group.java | 5 +---- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/src/main/java/seedu/address/logic/commands/DelGrpCommand.java b/src/main/java/seedu/address/logic/commands/DelGrpCommand.java index 7cfffb336c7..c6111e0470a 100644 --- a/src/main/java/seedu/address/logic/commands/DelGrpCommand.java +++ b/src/main/java/seedu/address/logic/commands/DelGrpCommand.java @@ -33,21 +33,18 @@ public DelGrpCommand(GrpContainsKeywordPredicate grpPredicate) { public CommandResult execute(Model model) throws CommandException { requireNonNull(model); - Group toDel = new Group(); - - boolean hasGroup = false; + Group toDel = null; if (!model.getSerenity().getGroupList().isEmpty()) { for (Group group : model.getSerenity().getGroupList()) { if (group.getName().equals(grpPredicate.getKeyword())) { toDel = group; - hasGroup = true; break; } } } - if (!hasGroup) { + if (toDel == null) { throw new CommandException(Messages.MESSAGE_GROUP_EMPTY); } diff --git a/src/main/java/seedu/address/model/group/Group.java b/src/main/java/seedu/address/model/group/Group.java index 8ada5334812..22dccb2a1d0 100644 --- a/src/main/java/seedu/address/model/group/Group.java +++ b/src/main/java/seedu/address/model/group/Group.java @@ -24,9 +24,6 @@ public class Group { private final UniqueStudentList students; private final UniqueLessonList lessons; - // Empty constructor - public Group() {} - /** * Constructs a {@code Group} * @@ -70,7 +67,7 @@ public Group(String name, UniqueStudentList students, UniqueLessonList lessons) requireAllNonNull(name, students, lessons); this.name = name; this.students = students; - this.lessons = this.lessons; + this.lessons = lessons; } public String getName() { From 10b3ade0ebc37455264f867212e0e91d6bbf4ead Mon Sep 17 00:00:00 2001 From: Cy Date: Mon, 12 Oct 2020 17:35:15 +0800 Subject: [PATCH 3/4] Fix checkstyle --- src/main/java/seedu/address/logic/parser/SerenityParser.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/seedu/address/logic/parser/SerenityParser.java b/src/main/java/seedu/address/logic/parser/SerenityParser.java index 38dbc7f15f8..27416787eac 100644 --- a/src/main/java/seedu/address/logic/parser/SerenityParser.java +++ b/src/main/java/seedu/address/logic/parser/SerenityParser.java @@ -8,8 +8,8 @@ import seedu.address.logic.commands.AddCommand; import seedu.address.logic.commands.AddGrpCommand; -import seedu.address.logic.commands.AddStudentCommand; import seedu.address.logic.commands.AddQnCommand; +import seedu.address.logic.commands.AddStudentCommand; import seedu.address.logic.commands.ClearCommand; import seedu.address.logic.commands.Command; import seedu.address.logic.commands.DelGrpCommand; From c29cdf8ea3756bed8c56c6d07ffb7a72b8d19035 Mon Sep 17 00:00:00 2001 From: Cy Date: Mon, 12 Oct 2020 18:11:12 +0800 Subject: [PATCH 4/4] Fix merge conflicts --- .../java/seedu/address/logic/parser/SerenityParser.java | 8 ++------ src/main/java/seedu/address/model/group/Group.java | 5 +---- 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/src/main/java/seedu/address/logic/parser/SerenityParser.java b/src/main/java/seedu/address/logic/parser/SerenityParser.java index f086c599b97..5c748671c18 100644 --- a/src/main/java/seedu/address/logic/parser/SerenityParser.java +++ b/src/main/java/seedu/address/logic/parser/SerenityParser.java @@ -10,8 +10,8 @@ import seedu.address.logic.commands.AddGrpCommand; import seedu.address.logic.commands.AddLsnCommand; import seedu.address.logic.commands.AddQnCommand; -import seedu.address.logic.commands.AddStudentCommand; import seedu.address.logic.commands.AddScoreCommand; +import seedu.address.logic.commands.AddStudentCommand; import seedu.address.logic.commands.ClearCommand; import seedu.address.logic.commands.Command; import seedu.address.logic.commands.DelGrpCommand; @@ -63,22 +63,18 @@ public Command parseCommand(String userInput) throws ParseException { case AddGrpCommand.COMMAND_WORD: return new AddGrpCommandParser().parse(arguments); -<<<<<<< HEAD - case AddStudentCommand.COMMAND_WORD: return new AddStudentCommandParser().parse(arguments); case DeleteStudentCommand.COMMAND_WORD: return new DeleteStudentCommandParser().parse(arguments); -======= + case AddLsnCommand.COMMAND_WORD: return new AddLsnCommandParser().parse(arguments); ->>>>>>> upstream/master case DelGrpCommand.COMMAND_WORD: return new DelGrpCommandParser().parse(arguments); - case ViewGrpCommand.COMMAND_WORD: return new ViewGrpCommandParser().parse(arguments); diff --git a/src/main/java/seedu/address/model/group/Group.java b/src/main/java/seedu/address/model/group/Group.java index 072479cc292..2c2bf5b0330 100644 --- a/src/main/java/seedu/address/model/group/Group.java +++ b/src/main/java/seedu/address/model/group/Group.java @@ -21,10 +21,7 @@ public class Group { private final String name; // Data fields -<<<<<<< HEAD -======= - //private Set students; ->>>>>>> upstream/master + private final UniqueStudentList students; private final UniqueLessonList lessons;