Skip to content

Commit 5e3010d

Browse files
Merge pull request #336 from UncleGrandpa925/implement-additional-features-v1.4
Add some javadocs and move arePrefixPresent of AddCommands to ParserUtil
2 parents 9c98289 + 6c14fc5 commit 5e3010d

35 files changed

+101
-115
lines changed

src/main/java/trackitnus/logic/Logic.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -111,28 +111,28 @@ public interface Logic {
111111
/**
112112
* @param module The module to get index of
113113
* @return The index of the module in the list of all modules
114-
* @throws CommandException
114+
* @throws CommandException If an error occurs during execution
115115
*/
116116
Index getModuleIndex(Module module) throws CommandException;
117117

118118
/**
119119
* @param code The module code to get index of
120120
* @return The index of the module with the specified code in the list of all modules
121-
* @throws CommandException
121+
* @throws CommandException If an error occurs during execution
122122
*/
123123
Index getModuleIndex(Code code) throws CommandException;
124124

125125
/**
126126
* @param task The task to get index of.
127127
* @return The index of the task in list of all tasks.
128-
* @throws CommandException
128+
* @throws CommandException If an error occurs during execution
129129
*/
130130
Index getTaskIndex(Task task) throws CommandException;
131131

132132
/**
133133
* @param lesson The lesson to get index of.
134134
* @return The index of the lesson in list of all lessons.
135-
* @throws CommandException
135+
* @throws CommandException If an error occurs during execution
136136
*/
137137
Index getLessonIndex(Lesson lesson) throws CommandException;
138138

src/main/java/trackitnus/logic/LogicManager.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,6 @@ public void clearAllList() {
9595
model.clearAllList();
9696
}
9797

98-
//--------------------------------START of V1.3's new functions--------------------------------
99-
10098
@Override
10199
public ObservableList<Lesson> getDayUpcomingLessons(LocalDate date) {
102100
return model.getDayUpcomingLessons(date);
@@ -152,8 +150,6 @@ public Index getTaskIndex(Task task) throws CommandException {
152150
return model.getTaskIndex(task);
153151
}
154152

155-
//--------------------------------END of V1.3's new functions--------------------------------
156-
157153
@Override
158154
public Path getTrackIterFilePath() {
159155
return model.getTrackIterFilePath();

src/main/java/trackitnus/logic/commands/CommandResult.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,9 @@ public CommandResult(String feedbackToUser) {
6262

6363
/**
6464
* Constructs a CommandResult to handle the event if a module is being edited
65-
* @param feedbackToUser of module being edited
66-
* @param editedModule the module it is being edited to
65+
*
66+
* @param feedbackToUser of module being edited
67+
* @param editedModule the module it is being edited to
6768
* @param preEditedModule the module prior to being edited
6869
*/
6970
public CommandResult(String feedbackToUser, Module editedModule, Module preEditedModule) {
@@ -72,8 +73,6 @@ public CommandResult(String feedbackToUser, Module editedModule, Module preEdite
7273

7374
/**
7475
* Constructs a CommandResult to handle the event of a module being deleted
75-
* @param feedbackToUser
76-
* @param nameOfDeletedModule
7776
*/
7877
public CommandResult(String feedbackToUser, String nameOfDeletedModule) {
7978
this(feedbackToUser, false, false, null, null, nameOfDeletedModule);

src/main/java/trackitnus/logic/commands/contact/DeleteContactCommand.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ public final class DeleteContactCommand extends Command {
2626

2727
private final Index targetIndex;
2828

29+
/**
30+
* Creates an DeleteContactCommand to delete the Contact with the specified Index
31+
*/
2932
public DeleteContactCommand(Index targetIndex) {
3033
this.targetIndex = targetIndex;
3134
}

src/main/java/trackitnus/logic/commands/lesson/DeleteLessonCommand.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public final class DeleteLessonCommand extends Command {
2828
/**
2929
* Creates a DeleteLessonCommand to delete the specified {@code Lesson}
3030
*
31-
* @param index
31+
* @param index index of the lesson to delete in the current FilteredLessonList
3232
*/
3333
public DeleteLessonCommand(Index index) {
3434
this.targetIndex = index;

src/main/java/trackitnus/logic/commands/lesson/EditLessonCommand.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ public final class EditLessonCommand extends Command {
4949
/**
5050
* Creates a EditLessonCommand to edit the specified {@code Lesson}
5151
*
52-
* @param index
53-
* @param editLessonDescriptor
52+
* @param index index of the lesson to edit in the current FilteredLessonList
53+
* @param editLessonDescriptor the descriptor of the new lesson
5454
*/
5555
public EditLessonCommand(Index index, EditLessonDescriptor editLessonDescriptor) {
5656
requireNonNull(index);
@@ -61,8 +61,8 @@ public EditLessonCommand(Index index, EditLessonDescriptor editLessonDescriptor)
6161
}
6262

6363
/**
64-
* Creates and returns a {@code Contact} with the details of {@code contactToEdit}
65-
* edited with {@code editContactDescriptor}.
64+
* Creates and returns a {@code Lesson} with the details of {@code lessonToEdit}
65+
* edited with {@code editLessonDescriptor}.
6666
*/
6767
private static Lesson createEditedLesson(Lesson lessonToEdit, EditLessonDescriptor editLessonDescriptor) {
6868
assert lessonToEdit != null;
@@ -126,8 +126,8 @@ public boolean equals(Object other) {
126126
}
127127

128128
/**
129-
* Stores the details to edit the contact with. Each non-empty field value will replace the
130-
* corresponding field value of the contact.
129+
* Stores the details to edit the lesson with. Each non-empty field value will replace the
130+
* corresponding field value of the lesson.
131131
*/
132132
public static final class EditLessonDescriptor {
133133
private Code code;

src/main/java/trackitnus/logic/commands/module/AddModuleCommand.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public final class AddModuleCommand extends Command {
2727
private final Module toAdd;
2828

2929
/**
30-
* Creates an AddModule to add the specified {@code Module}
30+
* Creates an AddModuleCommand to add the specified {@code Module}
3131
*/
3232
public AddModuleCommand(Module module) {
3333
requireNonNull(module);

src/main/java/trackitnus/logic/commands/module/DeleteModuleCommand.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,11 @@ public final class DeleteModuleCommand extends Command {
2727

2828
private final Code targetCode;
2929

30+
/**
31+
* Creates an DeleteModuleCommand to delete the Module
32+
*
33+
* @param targetCode the code of the module to delete
34+
*/
3035
public DeleteModuleCommand(Code targetCode) {
3136
this.targetCode = targetCode;
3237
}

src/main/java/trackitnus/logic/commands/module/EditModuleCommand.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public EditModuleCommand(Code code, EditModuleDescriptor editModuleDescriptor) {
5454
}
5555

5656
/**
57-
* Creates and returns a {@code Model} with the details of {@code moduleToEdit}
57+
* Creates and returns a {@code Module} with the details of {@code moduleToEdit}
5858
* edited with {@code editModuleDescriptor}.
5959
*/
6060
private static Module createEditedModule(Module moduleToEdit,
@@ -99,6 +99,7 @@ public CommandResult execute(Model model) throws CommandException {
9999
model.setLesson(lesson, updatedLesson);
100100
}
101101

102+
// edit all the related contacts
102103
List<Contact> contactsToEdit = new ArrayList<>(model.getModuleContacts(code));
103104
for (Contact contact : contactsToEdit) {
104105
Contact updatedContact = contact.setTag(new Tag(code.toString()), new Tag(updatedCode.toString()));

src/main/java/trackitnus/logic/commands/task/AddTaskCommand.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public final class AddTaskCommand extends Command {
3333
private final Task toAdd;
3434

3535
/**
36-
* Creates an AddContactCommand to add the specified {@code Contact}
36+
* Creates an AddTaskCommand to add the specified {@code Task}
3737
*/
3838
public AddTaskCommand(Task task) {
3939
requireNonNull(task);

0 commit comments

Comments
 (0)