forked from AY2324S1-CS2103T-W11-3/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
1 parent
2bbe328
commit 6eac6c5
Showing
5 changed files
with
155 additions
and
2 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,33 @@ | ||
@startuml | ||
skin rose | ||
skinparam ActivityFontSize 15 | ||
skinparam ArrowFontSize 12 | ||
skinparam defaultTextAlignment center | ||
|
||
start | ||
:User executes find command; | ||
:Parse the input keywords; | ||
|
||
'Since the beta syntax does not support placing the condition outside the | ||
'diamond we place it as the true branch instead. | ||
|
||
if () then ([input is invalid]) | ||
:Show corresponding error message; | ||
else ([else]) | ||
:Separate the keywords into categories | ||
(name, tag, instrument, and genre); | ||
while () is ([else]) | ||
:Go to the next category; | ||
if () then ([the category is empty]) | ||
:Skip this category; | ||
else ([else]) | ||
:Filter the musicians who | ||
match ANY of the keywords | ||
in this category; | ||
endif | ||
endwhile ([all categories are checked]) | ||
:Return the musicians who pass ALL filters; | ||
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,91 @@ | ||
@startuml | ||
!include style.puml | ||
skinparam ArrowFontStyle plain | ||
|
||
box Logic LOGIC_COLOR_T1 | ||
participant ":AddressBookParser" as AddressBookParser LOGIC_COLOR | ||
participant ":FindCommandParser" as FindCommandParser LOGIC_COLOR | ||
participant "f:FindCommand" as FindCommand LOGIC_COLOR | ||
participant ":CommandResult" as CommandResult LOGIC_COLOR | ||
end box | ||
|
||
box Model MODEL_COLOR_T1 | ||
participant ":Model" as Model MODEL_COLOR | ||
participant ":NCKP" as NameContainsKeywordsPredicate MODEL_COLOR | ||
participant ":IMP" as InstrumentMatchesPredicate MODEL_COLOR | ||
participant ":GMP" as GenreMatchesPredicate MODEL_COLOR | ||
end box | ||
|
||
[-> AddressBookParser : parseCommand\n("find n/John i/piano i/guitar g/jazz") | ||
activate AddressBookParser | ||
|
||
create FindCommandParser | ||
AddressBookParser -> FindCommandParser | ||
activate FindCommandParser | ||
|
||
FindCommandParser --> AddressBookParser | ||
deactivate FindCommandParser | ||
|
||
AddressBookParser -> FindCommandParser : parse\n("n/John i/piano i/guitar g/jazz") | ||
activate FindCommandParser | ||
|
||
create NameContainsKeywordsPredicate | ||
FindCommandParser -> NameContainsKeywordsPredicate : NameContainsKeywordsPredicate(List.of("John")) | ||
activate NameContainsKeywordsPredicate | ||
|
||
NameContainsKeywordsPredicate --> FindCommandParser | ||
deactivate NameContainsKeywordsPredicate | ||
|
||
create InstrumentMatchesPredicate | ||
FindCommandParser -> InstrumentMatchesPredicate : InstrumentMatchesPredicate(List.of("piano", "guitar")) | ||
activate InstrumentMatchesPredicate | ||
|
||
InstrumentMatchesPredicate --> FindCommandParser | ||
deactivate InstrumentMatchesPredicate | ||
|
||
create GenreMatchesPredicate | ||
FindCommandParser -> GenreMatchesPredicate : GenreMatchesPredicate(List.of("jazz")) | ||
activate GenreMatchesPredicate | ||
|
||
GenreMatchesPredicate --> FindCommandParser | ||
deactivate GenreMatchesPredicate | ||
|
||
create FindCommand | ||
FindCommandParser -> FindCommand : pass the set of predicates | ||
activate FindCommand | ||
|
||
FindCommand --> FindCommandParser : f | ||
deactivate FindCommand | ||
|
||
FindCommandParser --> AddressBookParser : f | ||
deactivate FindCommandParser | ||
'Hidden arrow to position the destroy marker below the end of the activation bar. | ||
FindCommandParser -[hidden]-> AddressBookParser | ||
destroy FindCommandParser | ||
|
||
[<-- AddressBookParser : f | ||
deactivate AddressBookParser | ||
|
||
[-> FindCommand : execute() | ||
activate FindCommand | ||
|
||
FindCommand -> Model : updateFilteredMusicianList\n(combinedPredicates) | ||
activate Model | ||
|
||
'Hidden arrow to increase the length of the activation bar. | ||
Model -[hidden]-> Model | ||
|
||
Model --> FindCommand | ||
deactivate Model | ||
|
||
create CommandResult | ||
FindCommand -> CommandResult | ||
activate CommandResult | ||
|
||
CommandResult --> FindCommand | ||
deactivate CommandResult | ||
|
||
[<-- FindCommand : result | ||
deactivate FindCommand | ||
|
||
@enduml |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.