Skip to content

Commit 1038d71

Browse files
committed
Merge remote-tracking branch 'team-tp/master' into ppp-update
2 parents 56c1cdc + 11e16ce commit 1038d71

29 files changed

Lines changed: 134 additions & 132 deletions

docs/DeveloperGuide.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ Given below is the Sequence Diagram for interactions within the `Logic` componen
105105

106106
![Interactions Inside the Logic Component for the `delete 1` Command](images/DeleteSequenceDiagram.png)
107107

108-
<div markdown="span" class="alert alert-info">:information_source: **Note:** The lifeline for `DeleteCommandParser` should end at the destroy marker (X) but due to a limitation of PlantUML, the lifeline reaches the end of diagram.
108+
<div markdown="span" class="alert alert-info">:information_source: **Note:** The lifeline for `DeletePersonCommandParser` should end at the destroy marker (X) but due to a limitation of PlantUML, the lifeline reaches the end of diagram.
109109
</div>
110110

111111

docs/diagrams/DeleteSequenceDiagram.puml

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
box Logic LOGIC_COLOR_T1
77
participant ":LogicManager" as LogicManager LOGIC_COLOR
88
participant ":MeetBuddyParser" as MeetBuddyParser LOGIC_COLOR
9-
participant ":DeleteCommandParser" as DeleteCommandParser LOGIC_COLOR
10-
participant "d:DeleteCommand" as DeleteCommand LOGIC_COLOR
9+
participant ":DeletePersonCommandParser" as DeletePersonCommandParser LOGIC_COLOR
10+
participant "d:DeletePersonCommand" as DeletePersonCommand LOGIC_COLOR
1111
participant ":CommandResult" as CommandResult LOGIC_COLOR
1212
end box
1313

@@ -21,50 +21,50 @@ activate LogicManager
2121
LogicManager -> MeetBuddyParser : parseCommand("delete 1")
2222
activate MeetBuddyParser
2323

24-
create DeleteCommandParser
25-
MeetBuddyParser -> DeleteCommandParser
26-
activate DeleteCommandParser
24+
create DeletePersonCommandParser
25+
MeetBuddyParser -> DeletePersonCommandParser
26+
activate DeletePersonCommandParser
2727

28-
DeleteCommandParser --> MeetBuddyParser
29-
deactivate DeleteCommandParser
28+
DeletePersonCommandParser --> MeetBuddyParser
29+
deactivate DeletePersonCommandParser
3030

31-
MeetBuddyParser -> DeleteCommandParser : parse("1")
32-
activate DeleteCommandParser
31+
MeetBuddyParser -> DeletePersonCommandParser : parse("1")
32+
activate DeletePersonCommandParser
3333

34-
create DeleteCommand
35-
DeleteCommandParser -> DeleteCommand
36-
activate DeleteCommand
34+
create DeletePersonCommand
35+
DeletePersonCommandParser -> DeletePersonCommand
36+
activate DeletePersonCommand
3737

38-
DeleteCommand --> DeleteCommandParser : d
39-
deactivate DeleteCommand
38+
DeletePersonCommand --> DeletePersonCommandParser : d
39+
deactivate DeletePersonCommand
4040

41-
DeleteCommandParser --> MeetBuddyParser : d
42-
deactivate DeleteCommandParser
41+
DeletePersonCommandParser --> MeetBuddyParser : d
42+
deactivate DeletePersonCommandParser
4343
'Hidden arrow to position the destroy marker below the end of the activation bar.
44-
DeleteCommandParser -[hidden]-> MeetBuddyParser
45-
destroy DeleteCommandParser
44+
DeletePersonCommandParser -[hidden]-> MeetBuddyParser
45+
destroy DeletePersonCommandParser
4646

4747
MeetBuddyParser --> LogicManager : d
4848
deactivate MeetBuddyParser
4949

50-
LogicManager -> DeleteCommand : execute()
51-
activate DeleteCommand
50+
LogicManager -> DeletePersonCommand : execute()
51+
activate DeletePersonCommand
5252

53-
DeleteCommand -> Model : deletePerson(1)
53+
DeletePersonCommand -> Model : deletePerson(1)
5454
activate Model
5555

56-
Model --> DeleteCommand
56+
Model --> DeletePersonCommand
5757
deactivate Model
5858

5959
create CommandResult
60-
DeleteCommand -> CommandResult
60+
DeletePersonCommand -> CommandResult
6161
activate CommandResult
6262

63-
CommandResult --> DeleteCommand
63+
CommandResult --> DeletePersonCommand
6464
deactivate CommandResult
6565

66-
DeleteCommand --> LogicManager : result
67-
deactivate DeleteCommand
66+
DeletePersonCommand --> LogicManager : result
67+
deactivate DeletePersonCommand
6868

6969
[<--LogicManager
7070
deactivate LogicManager
2.81 KB
Loading

src/main/java/seedu/address/model/Model.java

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
package seedu.address.model;
22

3+
import java.nio.file.Path;
4+
import java.time.LocalDate;
5+
import java.time.LocalDateTime;
6+
import java.util.Comparator;
7+
import java.util.List;
8+
import java.util.Optional;
9+
import java.util.Set;
10+
import java.util.function.Predicate;
11+
312
import javafx.beans.value.ObservableValue;
413
import javafx.collections.ObservableList;
514
import seedu.address.commons.core.GuiSettings;
@@ -15,15 +24,6 @@
1524
import seedu.address.model.person.UniquePersonList;
1625
import seedu.address.model.reminder.ReadOnlyReminderBook;
1726

18-
import java.nio.file.Path;
19-
import java.time.LocalDate;
20-
import java.time.LocalDateTime;
21-
import java.util.Comparator;
22-
import java.util.List;
23-
import java.util.Optional;
24-
import java.util.Set;
25-
import java.util.function.Predicate;
26-
2727
/**
2828
* The API of the Model component.
2929
*/
@@ -163,7 +163,7 @@ public interface Model {
163163
*/
164164
ObservableList<Meeting> getUnmodifiableMeetingList();
165165

166-
// ============= Clashing Meetings ========================================================
166+
// ============= Clashing Meetings ========================================================
167167

168168
/**
169169
* Checks if there is a clash in meeting times within the model.

src/main/java/seedu/address/model/ModelManager.java

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,18 @@
11
package seedu.address.model;
22

3+
import static java.util.Objects.requireNonNull;
4+
import static seedu.address.commons.util.CollectionUtil.requireAllNonNull;
5+
6+
import java.nio.file.Path;
7+
import java.time.LocalDate;
8+
import java.time.LocalDateTime;
9+
import java.util.Comparator;
10+
import java.util.List;
11+
import java.util.Optional;
12+
import java.util.Set;
13+
import java.util.function.Predicate;
14+
import java.util.logging.Logger;
15+
316
import javafx.beans.value.ObservableValue;
417
import javafx.collections.ObservableList;
518
import javafx.collections.transformation.FilteredList;
@@ -23,19 +36,6 @@
2336
import seedu.address.model.reminder.ReminderBook;
2437
import seedu.address.model.schedule.TimetablePrefs;
2538

26-
import java.nio.file.Path;
27-
import java.time.LocalDate;
28-
import java.time.LocalDateTime;
29-
import java.util.Comparator;
30-
import java.util.List;
31-
import java.util.Optional;
32-
import java.util.Set;
33-
import java.util.function.Predicate;
34-
import java.util.logging.Logger;
35-
36-
import static java.util.Objects.requireNonNull;
37-
import static seedu.address.commons.util.CollectionUtil.requireAllNonNull;
38-
3939
/**
4040
* Represents the in-memory model of the address book data.
4141
*/

src/main/java/seedu/address/model/connection/PersonInMeetingPredicate.java

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
import java.util.Set;
44
import java.util.function.Predicate;
55

6-
import seedu.address.model.group.Group;
76
import seedu.address.model.meeting.Meeting;
87
import seedu.address.model.person.Person;
98

@@ -20,14 +19,6 @@ public boolean test(Person person) {
2019
return personsInMeeting.stream()
2120
.anyMatch(p -> p.equals(person));
2221

23-
/* The code below is to be used only if the people in the meeting groups are to be displayed too (i.e. in v1.5) */
24-
/*Set<Group> groupsInMeeting = this.meeting.getGroups();
25-
Set<Group> groupsForPerson = person.getGroups();
26-
return groupsInMeeting.stream()
27-
.anyMatch(mGroup ->
28-
groupsForPerson.stream().anyMatch(pGroup ->
29-
pGroup.equals(mGroup))) ||
30-
personsInMeeting.stream().anyMatch(p -> p.equals(person));*/
3122
}
3223

3324
@Override

src/main/java/seedu/address/model/connection/PersonMeetingConnection.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
package seedu.address.model.connection;
22

3+
import static java.util.Objects.requireNonNull;
4+
5+
import java.util.HashMap;
6+
37
import seedu.address.model.connection.exceptions.ConnectionNoFoundException;
48
import seedu.address.model.connection.exceptions.DuplicateConnectionException;
59
import seedu.address.model.meeting.Meeting;
@@ -8,10 +12,6 @@
812
import seedu.address.model.person.UniquePersonList;
913
import seedu.address.model.person.exceptions.DuplicatePersonException;
1014

11-
import java.util.HashMap;
12-
13-
import static java.util.Objects.requireNonNull;
14-
1515
/**
1616
* Represents a connection between persons and meetings.
1717
* Uses two hashmaps to store the connections, use both meeting and person as a connection.
@@ -102,7 +102,7 @@ public void deleteSinglePersonMeetingConnection(Person person, Meeting meeting)
102102
} else {
103103
personsInMeeting.put(meeting, personList);
104104
}
105-
if( meetingList.isEmpty()) {
105+
if (meetingList.isEmpty()) {
106106
meetingsInPerson.remove(person);
107107
} else {
108108
meetingsInPerson.put(person, meetingList);

src/main/java/seedu/address/model/meeting/DateTime.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
11
package seedu.address.model.meeting;
22

33

4-
import seedu.address.logic.parser.DateTimeUtil;
4+
import static java.util.Objects.requireNonNull;
5+
import static seedu.address.commons.util.AppUtil.checkArgument;
56

67
import java.time.LocalDate;
78
import java.time.LocalDateTime;
89
import java.time.format.DateTimeFormatter;
910
import java.time.format.DateTimeParseException;
1011

11-
import static java.util.Objects.requireNonNull;
12-
import static seedu.address.commons.util.AppUtil.checkArgument;
13-
12+
import seedu.address.logic.parser.DateTimeUtil;
1413

1514
/**
1615
* Represents a Meeting's DateTime in a meeting.
@@ -88,7 +87,7 @@ public LocalDateTime toLocalDateTime() {
8887
public int compareTo(DateTime other) {
8988
if (value.isBefore(other.value)) {
9089
return -1;
91-
} else if (value.isEqual(other.value)){
90+
} else if (value.isEqual(other.value)) {
9291
return 0;
9392
}
9493
return 1;

src/main/java/seedu/address/model/meeting/Meeting.java

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
package seedu.address.model.meeting;
22

3-
import seedu.address.model.connection.PersonMeetingConnection;
4-
import seedu.address.model.group.Group;
5-
import seedu.address.model.person.Person;
6-
import seedu.address.model.person.UniquePersonList;
7-
import seedu.address.model.schedule.Schedulable;
3+
import static seedu.address.commons.util.AppUtil.checkArgument;
4+
import static seedu.address.commons.util.CollectionUtil.requireAllNonNull;
85

96
import java.time.Duration;
107
import java.time.LocalDateTime;
@@ -13,8 +10,11 @@
1310
import java.util.Objects;
1411
import java.util.Set;
1512

16-
import static seedu.address.commons.util.AppUtil.checkArgument;
17-
import static seedu.address.commons.util.CollectionUtil.requireAllNonNull;
13+
import seedu.address.model.connection.PersonMeetingConnection;
14+
import seedu.address.model.group.Group;
15+
import seedu.address.model.person.Person;
16+
import seedu.address.model.person.UniquePersonList;
17+
import seedu.address.model.schedule.Schedulable;
1818

1919

2020
/**
@@ -153,7 +153,9 @@ public boolean containsName(MeetingName name) {
153153
public boolean containsDescription(Description desc) {
154154
return description.toString().contains(desc.toString());
155155
}
156-
156+
/**
157+
* Returns whether a meeting is related to a certain person.
158+
*/
157159
public boolean containsPerson(Person person) {
158160
Set<Person> allPersons = getConnectionToPerson();
159161
return allPersons.contains(person);
@@ -162,7 +164,9 @@ public boolean containsPerson(Person person) {
162164
public boolean containsGroup(Group group) {
163165
return groups.contains(group);
164166
}
165-
167+
/**
168+
* Returns whether a meeting contains a point of time.
169+
*/
166170
public boolean containsTime(DateTime time) {
167171
boolean afterOrAtStart = time.compareTo(start) >= 0;
168172
boolean beforeOrAtEnd = time.compareTo(terminate) <= 0;

src/main/java/seedu/address/model/meeting/MeetingBook.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
package seedu.address.model.meeting;
22

33

4-
import javafx.collections.ObservableList;
5-
import seedu.address.model.connection.PersonMeetingConnection;
4+
import static java.util.Objects.requireNonNull;
65

76
import java.time.LocalDateTime;
87
import java.util.List;
98
import java.util.Optional;
109

11-
import static java.util.Objects.requireNonNull;
10+
import javafx.collections.ObservableList;
11+
import seedu.address.model.connection.PersonMeetingConnection;
1212

1313
public class MeetingBook implements ReadOnlyMeetingBook {
1414
private final UniqueMeetingList meetings;
@@ -81,7 +81,9 @@ public void setMeeting(Meeting target, Meeting editedMeeting) {
8181
requireNonNull(editedMeeting);
8282
meetings.setMeeting(target, editedMeeting);
8383
}
84-
84+
/**
85+
* Updates a meeting.
86+
*/
8587
public void updateMeeting(Meeting target, Meeting editedMeeting) {
8688
requireNonNull(editedMeeting);
8789
meetings.updateMeeting(target, editedMeeting);

0 commit comments

Comments
 (0)