forked from nus-cs2103-AY2324S1/tp
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #231 from songfangyl/branch-Update-DevGuide
Update DG on Find Feature
- Loading branch information
Showing
6 changed files
with
228 additions
and
10 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 |
---|---|---|
|
@@ -205,7 +205,7 @@ Examples: | |
|
||
**Format:** | ||
|
||
Format: `find <prefix [keyword]...> [<prefix [keywords]...>]...` | ||
Format: `find <prefix> [keyword]... [<prefix> [keywords]]...` | ||
|
||
**Description:** | ||
|
||
|
@@ -504,7 +504,7 @@ command box. | |
| **Delete** | `delete <index>` <hr> `delete 3` | | ||
| **Edit** | `edit <index> [n/<name>] [p/<phone number>] [e/<email>] [a/<address>] ` <hr> `edit 2 n/James Lee e/[email protected]` | | ||
| **List** | `list` <hr> | | ||
| **Find** | `find <prefix [keyword]...> [<prefix [keywords]...>]...` <hr> `find n/song i/` | | ||
| **Find** | `find <prefix> [keyword]... [<prefix> [keywords]]...` <hr> `find n/song i/` | | ||
| **Tag** | `tag <index> [at/<tag to add>]... [dt/<tag to delete>]...` <hr> `tag 1 at/tall dt/short at/male` | | ||
| **Insurance** | `insurance <index> [ai/<insurance to add>]... [di/<insurance to delete>]...` <hr> `insurance 2 ai/AIA insurance di/Great Eastern Insurance` | | ||
| **Remark** | `remark <index> [remark]` <hr> `remark 2 some remarks` | | ||
|
35 changes: 35 additions & 0 deletions
35
docs/diagrams/find-feature/ExecuteFindCommandSequenceDiagram.puml
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,35 @@ | ||
@startuml | ||
!include ../style.puml | ||
|
||
box Logic LOGIC_COLOR_T1 | ||
participant ": FindCommand" as command LOGIC_COLOR | ||
participant ": CommandResult" as result LOGIC_COLOR | ||
end box | ||
|
||
box Model MODEL_COLOR_T1 | ||
participant "m: Model" as model MODEL_COLOR | ||
end box | ||
|
||
[-> command : execute(m) | ||
||| | ||
command -> model : m.updateFilterPersonList(personPredicate) | ||
||| | ||
command -> model : m.getFilteredPersonList().size() | ||
return size | ||
||| | ||
create result | ||
command -> result : new CommandResult(size) | ||
activate result | ||
return result | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
[<-- command : result | ||
@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,58 @@ | ||
@startuml | ||
!include ../style.puml | ||
skinparam ArrowFontStyle plain | ||
|
||
box Logic LOGIC_COLOR_T1 | ||
participant ": LogicManager" as manager LOGIC_COLOR | ||
participant ": AddressBookParser" as parser LOGIC_COLOR | ||
participant ": FindCommandParser" as findParser LOGIC_COLOR | ||
participant ": FindCommand" as command LOGIC_COLOR | ||
participant ": CommandResult" as result LOGIC_COLOR | ||
end box | ||
|
||
box Model MODEL_COLOR_T1 | ||
participant "m: Model" as model MODEL_COLOR | ||
end box | ||
|
||
[-> manager : execute("find n/Song \nr/vegetarian") | ||
activate manager | ||
|
||
manager -> parser : parseCommand("find n/Song \nr/vegetarian") | ||
activate parser | ||
|
||
create findParser | ||
parser -> findParser | ||
activate findParser | ||
return | ||
||| | ||
parser -> findParser : parse("n/Song \nr/vegetarian") | ||
activate findParser | ||
|
||
create command | ||
findParser -> command | ||
activate command | ||
return | ||
|
||
return | ||
findParser -[hidden]-> parser | ||
destroy findParser | ||
|
||
return | ||
|
||
manager -> command : execute(m) | ||
activate command | ||
command -> model : updateFilteredPersonList(Predicate) | ||
activate model | ||
return | ||
||| | ||
|
||
create result | ||
command -> result | ||
activate result | ||
return result | ||
|
||
return result | ||
return result | ||
|
||
|
||
@enduml |
51 changes: 51 additions & 0 deletions
51
docs/diagrams/find-feature/ParseFindCommandSequenceDiagram.puml
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,51 @@ | ||
@startuml | ||
!include ../style.puml | ||
|
||
box Logic LOGIC_COLOR_T1 | ||
participant ": FindCommandParser" as parser LOGIC_COLOR | ||
participant ": ParserUtil" as keywordParser LOGIC_COLOR | ||
participant ": FindCommand" as command LOGIC_COLOR | ||
end box | ||
|
||
box Model MODEL_COLOR_T1 | ||
participant "n: NameContains\nKeywordsPredicate" as namePredicate MODEL_COLOR | ||
participant "r: RemarkContains\nKeywordsPredicate" as remarkPredicate MODEL_COLOR | ||
participant "p: PersonContains\nKeywordsPredicate" as personPredicate MODEL_COLOR | ||
end box | ||
|
||
|
||
[-> parser : parse("n/Song \nr/vegetarian") | ||
||| | ||
|
||
parser -> keywordParser : parseNameKeyword("Song") | ||
activate keywordParser | ||
create namePredicate | ||
keywordParser -> namePredicate | ||
activate namePredicate | ||
return n | ||
return n | ||
||| | ||
|
||
parser -> keywordParser : parseRemarkKeyword("vegetarian") | ||
activate keywordParser | ||
create remarkPredicate | ||
||| | ||
keywordParser -> remarkPredicate | ||
activate remarkPredicate | ||
return r | ||
return r | ||
||| | ||
create personPredicate | ||
parser -> personPredicate : new PersonContainsKeywordsPredicate(n, r) | ||
||| | ||
activate personPredicate | ||
return p | ||
|
||
create command | ||
parser -> command : new FindCommand(p) | ||
activate command | ||
||| | ||
return command | ||
|
||
[<--parser : 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
@startuml | ||
!include ../style.puml | ||
skinparam arrowThickness 1.1 | ||
skinparam arrowColor MODEL_COLOR | ||
skinparam classBackgroundColor MODEL_COLOR | ||
|
||
class "<<interface>>\nPredicate" as Predicate | ||
class XYZContainsKeywordsPredicate | ||
class PersonContainsKeywordsPredicate | ||
class FindComand | ||
note left of XYZContainsKeywordsPredicate | ||
XYZContainsKeywordsPredicate = | ||
AddressContainsKeywordsPredicate, | ||
NameContainsKeywordsPredicate, etc. | ||
end note | ||
|
||
XYZContainsKeywordsPredicate ..|> Predicate | ||
PersonContainsKeywordsPredicate --> "*" Predicate : test > | ||
FindComand --> "1" PersonContainsKeywordsPredicate : contains > | ||
|
||
@enduml |