forked from nus-cs2103-AY2324S2/tp
-
Notifications
You must be signed in to change notification settings - Fork 4
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
8 changed files
with
651 additions
and
150 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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,24 @@ | ||
@startuml | ||
!include style.puml | ||
skinparam objectFontColor white | ||
|
||
object "<u>:AddCommand</u>" as AddCommand LOGIC_COLOR | ||
object "<u>:AddCommandParser</u>" as AddCommandParser LOGIC_COLOR | ||
object "<u>:AddressBookParser</u>" as AddressBookParser LOGIC_COLOR | ||
object "<u>:Model</u>" as Model MODEL_COLOR | ||
object "<u>:CommandResult</u>" as CommandResult LOGIC_COLOR | ||
object "<u>toAdd:Person</u>" as Person LOGIC_COLOR | ||
object "<u>:ArgumentMultimap</u>" as ArgumentMultimap LOGIC_COLOR | ||
object "<u>:ParserUtil</u>" as ParserUtil LOGIC_COLOR | ||
|
||
AddressBookParser --> AddCommandParser : calls | ||
AddressBookParser --> AddCommand | ||
AddCommandParser -> AddCommand | ||
AddCommandParser --> ArgumentMultimap : instantiates | ||
ParserUtil --> ArgumentMultimap : parses | ||
AddCommand --> Person | ||
AddCommand --> Model | ||
AddCommand -right-> CommandResult : outputs | ||
Model -right-> Person : adds | ||
Model --> Person : set client to display as | ||
@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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
@startuml | ||
!include style.puml | ||
skinparam ArrowFontStyle plain | ||
|
||
box Logic LOGIC_COLOR_T1 | ||
participant ":LogicManager" as LogicManager LOGIC_COLOR | ||
participant ":AddressBookParser" as AddressBookParser LOGIC_COLOR | ||
participant "a:AddCommand" as AddCommand LOGIC_COLOR | ||
participant ":CommandResult" as CommandResult LOGIC_COLOR | ||
end box | ||
|
||
box Model MODEL_COLOR_T1 | ||
participant ":Model" as Model MODEL_COLOR | ||
end box | ||
[-> LogicManager : execute(...) | ||
activate LogicManager | ||
|
||
LogicManager -> AddressBookParser : parseCommand(...) | ||
activate AddressBookParser | ||
|
||
create AddCommand | ||
AddressBookParser -> AddCommand : AddCommand(...) | ||
activate AddCommand | ||
|
||
AddCommand --> AddressBookParser | ||
deactivate AddCommand | ||
|
||
AddressBookParser --> LogicManager : a | ||
deactivate AddressBookParser | ||
|
||
LogicManager -> AddCommand : execute() | ||
activate AddCommand | ||
|
||
AddCommand -> Model : addPerson(toAdd) | ||
activate Model | ||
|
||
Model --> AddCommand | ||
deactivate Model | ||
|
||
AddCommand -> Model : setDisplayClient(toAdd) | ||
activate Model | ||
|
||
Model --> AddCommand | ||
deactivate Model | ||
|
||
create CommandResult | ||
AddCommand --> CommandResult | ||
activate CommandResult | ||
|
||
CommandResult --> AddCommand | ||
deactivate CommandResult | ||
|
||
AddCommand --> LogicManager : result | ||
deactivate AddCommand | ||
AddCommand -[hidden]-> LogicManager : result | ||
destroy AddCommand | ||
|
||
[<--LogicManager | ||
deactivate LogicManager | ||
@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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
@startuml | ||
'https://plantuml.com/activity-diagram-beta | ||
|
||
start | ||
:User enters AddPolicyCommand with a specified index and parameters; | ||
:AddressBookParser parses the command; | ||
:AddPolicyCommandParser parses the arguments provided; | ||
if () then ([command is valid]) | ||
:New AddPolicyCommand instance is created; | ||
:Policy object is created with the specified parameters; | ||
if () then ([PolicyID already exists]) | ||
:AddPolicyCommand throws exception; | ||
else ([PolicyID does not exist]) | ||
:Policy object is added to client specified by the index; | ||
:The existing client in the client list is replaced with the updated client; | ||
endif | ||
else ([command is invalid]) | ||
:Parser throws exception; | ||
endif | ||
if () then ([no error thrown]) | ||
:Display updated PolicyList; | ||
else ([error thrown]) | ||
:Display error message; | ||
endif | ||
stop | ||
|
||
@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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
@startuml | ||
!include style.puml | ||
skinparam objectFontColor white | ||
|
||
object "<u>:DeletePolicyCommand</u>" as DeletePolicyCommand LOGIC_COLOR | ||
object "<u>:DeletePolicyCommandParser</u>" as DeletePolicyCommandParser LOGIC_COLOR | ||
object "<u>:AddressBookParser</u>" as AddressBookParser LOGIC_COLOR | ||
object "<u>:Model</u>" as Model MODEL_COLOR | ||
object "<u>:CommandResult</u>" as CommandResult LOGIC_COLOR | ||
object "<u>policyDeletedPerson:Person" as Person1 LOGIC_COLOR | ||
object "<u>personToDeletePolicy:Person" as Person2 LOGIC_COLOR | ||
object "<u>:ArgumentMultimap" as ArgumentMultimap LOGIC_COLOR | ||
object "<u>:ParserUtil" as ParserUtil LOGIC_COLOR | ||
|
||
AddressBookParser --> DeletePolicyCommandParser : calls | ||
AddressBookParser --> DeletePolicyCommand | ||
DeletePolicyCommandParser -> DeletePolicyCommand | ||
DeletePolicyCommandParser --> ArgumentMultimap : instantiates | ||
ParserUtil --> ArgumentMultimap : parses | ||
DeletePolicyCommand --> Person1 | ||
DeletePolicyCommand --> Person2 | ||
DeletePolicyCommand --> Model | ||
DeletePolicyCommand -right-> CommandResult : outputs | ||
Model --> Person2 : Removes | ||
Model --> Person1 : Updates | ||
@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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
@startuml | ||
!include style.puml | ||
skinparam ArrowFontStyle plain | ||
|
||
box Logic LOGIC_COLOR_T1 | ||
participant ":LogicManager" as LogicManager LOGIC_COLOR | ||
participant ":AddressBookParser" as AddressBookParser LOGIC_COLOR | ||
participant "d:DeletePolicyCommand" as DeletePolicyCommand LOGIC_COLOR | ||
participant ":CommandResult" as CommandResult LOGIC_COLOR | ||
end box | ||
|
||
box Model MODEL_COLOR_T1 | ||
participant ":Model" as Model MODEL_COLOR | ||
end box | ||
[-> LogicManager : execute("deletepolicy 1 i/1") | ||
activate LogicManager | ||
|
||
LogicManager -> AddressBookParser : parseCommand("deletepolicy 1 i/1") | ||
activate AddressBookParser | ||
|
||
create DeletePolicyCommand | ||
AddressBookParser -> DeletePolicyCommand : DeletePolicyCommand(1, "1") | ||
activate DeletePolicyCommand | ||
|
||
DeletePolicyCommand --> AddressBookParser | ||
deactivate DeletePolicyCommand | ||
|
||
AddressBookParser --> LogicManager : d | ||
deactivate AddressBookParser | ||
|
||
LogicManager -> DeletePolicyCommand : execute() | ||
activate DeletePolicyCommand | ||
|
||
DeletePolicyCommand -> Model : setPerson(personToDeletePolicy, policyDeletedPerson) | ||
activate Model | ||
|
||
Model --> DeletePolicyCommand | ||
deactivate Model | ||
|
||
DeletePolicyCommand -> Model : setDisplayClient(policyDeletedPerson) | ||
activate Model | ||
|
||
Model --> DeletePolicyCommand | ||
deactivate Model | ||
|
||
create CommandResult | ||
DeletePolicyCommand --> CommandResult | ||
activate CommandResult | ||
|
||
CommandResult --> DeletePolicyCommand | ||
deactivate CommandResult | ||
|
||
DeletePolicyCommand --> LogicManager : result | ||
deactivate DeletePolicyCommand | ||
DeletePolicyCommand -[hidden]-> LogicManager : result | ||
destroy DeletePolicyCommand | ||
|
||
[<--LogicManager | ||
deactivate LogicManager | ||
@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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
@startuml | ||
!include style.puml | ||
skinparam objectFontColor white | ||
|
||
object "<u>:SortCommand</u>" as SortCommand LOGIC_COLOR | ||
object "<u>:SortCommandParser</u>" as SortCommandParser LOGIC_COLOR | ||
object "<u>:AddressBookParser</u>" as AddressBookParser LOGIC_COLOR | ||
object "<u>:Model</u>" as Model MODEL_COLOR | ||
object "<u>:CommandResult</u>" as CommandResult LOGIC_COLOR | ||
object "<u>sortCriteria:SortCriteria</u>" as SortCriteria LOGIC_COLOR | ||
object "<u>sortOrder:SortOrder</u>" as SortOrder LOGIC_COLOR | ||
object "<u>:Comparator<Person></u>" as Comparator LOGIC_COLOR | ||
object "<u>:ArgumentMultimap</u>" as ArgumentMultimap LOGIC_COLOR | ||
object "<u>:ParserUtil</u>" as ParserUtil LOGIC_COLOR | ||
|
||
AddressBookParser --> SortCommandParser : calls | ||
AddressBookParser --> SortCommand | ||
SortCommandParser -> SortCommand | ||
SortCommandParser --> ArgumentMultimap : instantiates | ||
ParserUtil --> ArgumentMultimap : parses | ||
SortCommand --> Model | ||
SortCommand ---> SortCriteria : contains | ||
SortCommand ---> SortOrder : contains | ||
SortCommand --> Comparator : creates | ||
SortCommand -right-> CommandResult : outputs | ||
Comparator --> SortCriteria : uses | ||
Comparator --> SortOrder : uses | ||
Model --> Comparator : updates comparator to sort persons | ||
@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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
@startuml | ||
!include style.puml | ||
skinparam ArrowFontStyle plain | ||
|
||
box Logic LOGIC_COLOR_T1 | ||
participant ":LogicManager" as LogicManager LOGIC_COLOR | ||
participant ":AddressBookParser" as AddressBookParser LOGIC_COLOR | ||
participant "a:AddCommand" as AddCommand LOGIC_COLOR | ||
participant ":CommandResult" as CommandResult LOGIC_COLOR | ||
end box | ||
|
||
box Model MODEL_COLOR_T1 | ||
participant ":Model" as Model MODEL_COLOR | ||
participant "<<class>>\nPersonComparator" as PersonComparator MODEL_COLOR | ||
end box | ||
|
||
[-> LogicManager : execute(...) | ||
activate LogicManager | ||
|
||
LogicManager -> AddressBookParser : parseCommand(...) | ||
activate AddressBookParser | ||
|
||
create AddCommand | ||
AddressBookParser -> AddCommand : AddCommand(...) | ||
activate AddCommand | ||
|
||
AddCommand --> AddressBookParser | ||
deactivate AddCommand | ||
|
||
AddressBookParser --> LogicManager : a | ||
deactivate AddressBookParser | ||
|
||
LogicManager -> AddCommand : execute() | ||
activate AddCommand | ||
|
||
AddCommand -> PersonComparator : getComparator(sortCriteria, sortOrder) | ||
activate PersonComparator | ||
|
||
PersonComparator --> AddCommand : comparator | ||
deactivate PersonComparator | ||
|
||
AddCommand -> Model : updateSortPersonComparator(comparator) | ||
activate Model | ||
|
||
Model --> AddCommand | ||
deactivate Model | ||
|
||
AddCommand -> Model : setDisplayClientAsFirstInSortedFilteredPersonList() | ||
activate Model | ||
|
||
Model --> AddCommand | ||
deactivate Model | ||
|
||
create CommandResult | ||
AddCommand --> CommandResult | ||
activate CommandResult | ||
|
||
CommandResult --> AddCommand | ||
deactivate CommandResult | ||
|
||
AddCommand --> LogicManager : result | ||
deactivate AddCommand | ||
AddCommand -[hidden]-> LogicManager : result | ||
destroy AddCommand | ||
|
||
[<--LogicManager | ||
deactivate LogicManager | ||
@enduml |