forked from nus-cs2103-AY2425S1/tp
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
84 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
@startuml DisplaySequence | ||
|
||
participant ":LogicManager" as Logic | ||
participant ":DisplayCommand" as Command | ||
participant ":Model" as Model | ||
participant ":PersonList" as PersonList | ||
|
||
alt Display by Index | ||
Logic -> Command : execute(model) | ||
activate Command | ||
|
||
Command -> Model : getFilteredPersonList() | ||
activate Model | ||
Model --> Command : filteredList | ||
deactivate Model | ||
|
||
Command -> Command : getPersonToDisplayByIndex(model, index) | ||
activate Command | ||
alt index >= list.size | ||
Command --> Logic : throw CommandException\n(invalid index) | ||
else valid index | ||
Command -> PersonList : get(index) | ||
activate PersonList | ||
PersonList --> Command : person | ||
deactivate PersonList | ||
end | ||
deactivate Command | ||
|
||
else Display by Name | ||
Logic -> Command : execute(model) | ||
activate Command | ||
|
||
Command -> Command : getPersonToDisplayByName(model, name) | ||
activate Command | ||
Command -> Model : findPersonByName(name) | ||
activate Model | ||
Model --> Command : person | ||
deactivate Model | ||
|
||
alt person == null | ||
Command --> Logic : throw CommandException\n(invalid name) | ||
end | ||
deactivate Command | ||
end | ||
|
||
Command -> Model : displayPerson(person) | ||
activate Model | ||
Model --> Command | ||
deactivate Model | ||
|
||
Command --> Logic : CommandResult | ||
deactivate Command | ||
|
||
@enduml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters