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.
Add Stats implementation and diagrams
- Loading branch information
1 parent
001019b
commit 5ff11fb
Showing
7 changed files
with
195 additions
and
8 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,41 @@ | ||
@startuml | ||
!include style.puml | ||
|
||
skinparam ArrowFontStyle plain | ||
|
||
mainframe **sd** get availability statistics | ||
|
||
participant "a:StatsAvailCommand" as StatsAvailCommand LOGIC_COLOR | ||
|
||
StatsAvailCommand -> StatsAvailCommand : getAvailableFosterers(list) | ||
activate StatsAvailCommand | ||
StatsAvailCommand --> StatsAvailCommand : availableFosterers | ||
deactivate StatsAvailCommand | ||
|
||
StatsAvailCommand -> StatsAvailCommand : getAbleDogCount(availableFosterers) | ||
activate StatsAvailCommand | ||
StatsAvailCommand --> StatsAvailCommand : ableDogCount | ||
deactivate StatsAvailCommand | ||
|
||
StatsAvailCommand -> StatsAvailCommand : getAbleCatCount(availableFosterers) | ||
activate StatsAvailCommand | ||
StatsAvailCommand --> StatsAvailCommand : ableCatCount | ||
deactivate StatsAvailCommand | ||
|
||
StatsAvailCommand -> StatsAvailCommand : calculatePercentage(availableCount, total) | ||
activate StatsAvailCommand | ||
StatsAvailCommand --> StatsAvailCommand | ||
deactivate StatsAvailCommand | ||
|
||
StatsAvailCommand -> StatsAvailCommand : calculatePercentage(ableDogCount, availableCount) | ||
activate StatsAvailCommand | ||
StatsAvailCommand --> StatsAvailCommand | ||
deactivate StatsAvailCommand | ||
|
||
StatsAvailCommand -> StatsAvailCommand : calculatePercentage(ableCatCount, availableCount) | ||
activate StatsAvailCommand | ||
StatsAvailCommand --> StatsAvailCommand | ||
deactivate StatsAvailCommand | ||
||| | ||
|
||
@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,74 @@ | ||
@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 ":StatsCommandParser" as StatsCommandParser LOGIC_COLOR | ||
participant "a:StatsAvailCommand" as StatsAvailCommand 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("stats avail") | ||
activate LogicManager | ||
|
||
LogicManager -> AddressBookParser : parseCommand("stats avail") | ||
activate AddressBookParser | ||
|
||
create StatsCommandParser | ||
AddressBookParser -> StatsCommandParser | ||
activate StatsCommandParser | ||
|
||
StatsCommandParser --> AddressBookParser | ||
deactivate StatsCommandParser | ||
|
||
AddressBookParser -> StatsCommandParser : parse("avail") | ||
activate StatsCommandParser | ||
|
||
create StatsAvailCommand | ||
StatsCommandParser -> StatsAvailCommand | ||
activate StatsAvailCommand | ||
|
||
StatsAvailCommand --> StatsCommandParser : a | ||
deactivate StatsAvailCommand | ||
|
||
StatsCommandParser --> AddressBookParser : a | ||
deactivate StatsCommandParser | ||
'Hidden arrow to position the destroy marker below the end of the activation bar. | ||
StatsCommandParser -[hidden]-> AddressBookParser | ||
destroy StatsCommandParser | ||
|
||
AddressBookParser --> LogicManager : a | ||
deactivate AddressBookParser | ||
|
||
LogicManager -> StatsAvailCommand : execute() | ||
activate StatsAvailCommand | ||
|
||
StatsAvailCommand -> Model : getFilteredPersonList() | ||
activate Model | ||
|
||
Model --> StatsAvailCommand : list | ||
deactivate Model | ||
|
||
ref over StatsAvailCommand | ||
get availability statistics | ||
end ref | ||
|
||
create CommandResult | ||
StatsAvailCommand -> CommandResult | ||
activate CommandResult | ||
|
||
CommandResult --> StatsAvailCommand | ||
deactivate CommandResult | ||
|
||
StatsAvailCommand --> LogicManager : result | ||
deactivate StatsAvailCommand | ||
|
||
[<--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,15 @@ | ||
@startuml | ||
!include style.puml | ||
skinparam arrowThickness 1.1 | ||
skinparam arrowColor LOGIC_COLOR | ||
skinparam classBackgroundColor LOGIC_COLOR | ||
|
||
Class StatsCommand | ||
Class "{abstract}\nCommand" as Command | ||
|
||
StatsCommand -up-|> Command | ||
StatsAvailCommand -up-|> StatsCommand | ||
StatsCurrentCommand -up-|> StatsCommand | ||
StatsHousingCommand -up-|> StatsCommand | ||
|
||
@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.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.