forked from nus-cs2113-AY2425S1/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 branch 'master' of github.com:AY2425S1-CS2113-W13-4/tp into Zih…
…an-DG-1 * 'master' of github.com:AY2425S1-CS2113-W13-4/tp: Add DeleteComponentCommand UML png Add DeleteComponentCommand UML Update DG for AddGradeCommand and DeleteGradeCommand Add AddComponentCommand UML png Add AddComponentCommand UML Make minor edits to UG
- Loading branch information
Showing
11 changed files
with
174 additions
and
17 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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,50 @@ | ||
@startuml | ||
!include Style.puml | ||
group sd AddComponentCommand | ||
participant ":AddComponentCommand" as C LOGIC_COLOR_3 | ||
participant ":AppState" as A LOGIC_COLOR_2 | ||
participant ":HashMap<String, String>" as H LOGIC_COLOR_7 | ||
participant ":CommandResult" as R LOGIC_COLOR_8 | ||
|
||
[-> C | ||
C -> H : get("c/") | ||
activate H | ||
C <-- H : componentName | ||
deactivate H | ||
C -> H : get("w/") | ||
activate H | ||
C <-- H : weightageNumber | ||
deactivate H | ||
C -> H : get("m/") | ||
activate H | ||
C <-- H : maxScoreNumber | ||
deactivate H | ||
|
||
opt componentName or weightageNumber or maxScoreNumber is null | ||
[<-- C : throw IllegalValueException | ||
end | ||
|
||
C -> C : convertWeightageToValidDouble(weightageNumber) | ||
activate C | ||
C --> C : weightageNumber | ||
deactivate C | ||
|
||
C -> C : convertMaxScoreToValidDouble(maxScore) | ||
activate C | ||
C --> C : maxScore | ||
deactivate C | ||
|
||
C -> A : addComponent(new Component(componentName, maxScore, weightage)) | ||
activate A | ||
C <-- A | ||
deactivate A | ||
|
||
create R | ||
C -> R : new CommandResult | ||
activate R | ||
C <-- R : CommandResult | ||
deactivate R | ||
|
||
[<-- C : CommandResult | ||
end | ||
@enduml |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,46 @@ | ||
@startuml | ||
!include Style.puml | ||
group sd DeleteComponentCommand | ||
participant ":DeleteComponentCommand" as C LOGIC_COLOR_3 | ||
participant ":AppState" as A LOGIC_COLOR_2 | ||
participant ":HashMap<String, String>" as H LOGIC_COLOR_7 | ||
participant ":ComponentList" as CL LOGIC_COLOR_6 | ||
participant ":CommandResult" as R LOGIC_COLOR_8 | ||
|
||
[-> C | ||
|
||
C -> H : get("n/") | ||
activate H | ||
C <-- H : componentName | ||
deactivate H | ||
|
||
opt componentName is null | ||
[<-- C : throw IllegalValueException | ||
end | ||
|
||
C -> A : findComponent(componentName) | ||
activate A | ||
A --> C : componentsToDelete | ||
deactivate A | ||
|
||
alt componentsToDelete.size() == 0 | ||
<-- C : throw ComponentNotFoundException | ||
else componentsToDelete.size() > 1 | ||
<-- C : throw DuplicateComponentException | ||
end | ||
|
||
C -> A : deleteComponent(componentsToDelete.getComponentArrayList().get(0)) | ||
activate A | ||
C <-- A | ||
deactivate A | ||
|
||
create R | ||
C -> R : new CommandResult | ||
activate R | ||
C <-- R : CommandResult | ||
deactivate R | ||
|
||
|
||
[<-- C : CommandResult | ||
end | ||
@enduml |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 @@ | ||
'@@author yeekian | ||
@startuml | ||
!include Style.puml | ||
group sd DeleteGradeCommand | ||
participant ":DeleteGradeCommand" as C LOGIC_COLOR_3 | ||
participant ":AppState" as A LOGIC_COLOR_2 | ||
participant ":HashMap<String, String>" as H LOGIC_COLOR_7 | ||
participant ":CommandResult" as R LOGIC_COLOR_8 | ||
|
||
[->C | ||
activate C | ||
C -> H : get("i/") | ||
activate H | ||
C <-- H : matricNumber | ||
deactivate H | ||
|
||
C -> H : get("c/") | ||
activate H | ||
C <-- H : componentDescription | ||
deactivate H | ||
|
||
opt matricNumber or componentDescription is null | ||
[<--C : throw IllegalValueException | ||
end | ||
|
||
C -> C : findComponentFromComponents | ||
activate C | ||
C -> A : findComponent(componentDescription) | ||
activate A | ||
C <-- A : componentFilteredList | ||
deactivate A | ||
C --> C : component | ||
deactivate C | ||
|
||
|
||
C -> A : findStudentByMatricNumber(matricNumber) | ||
activate A | ||
C <-- A : studentFilteredList | ||
deactivate A | ||
|
||
C -> A : deleteGrade(matricNumber, componentDescription) | ||
activate A | ||
C <-- A | ||
deactivate A | ||
|
||
create R | ||
C -> R : new CommandResult | ||
activate R | ||
C <-- R : CommandResult | ||
deactivate R | ||
|
||
[<-- C : CommandResult | ||
deactivate C | ||
|
||
end | ||
|
||
|
||
@enduml |