forked from nus-cs2103-AY2122S1/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 #130 from TaoJun99/branch-removeall
Add feature to remove all completed assignments
- Loading branch information
Showing
26 changed files
with
498 additions
and
145 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
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,16 @@ | ||
@startuml | ||
start | ||
:User executes clean command; | ||
|
||
'Since the beta syntax does not support placing the condition outside the | ||
'diamond we place it as the true branch instead. | ||
:Get all persons | ||
stored in the model; | ||
:Get assignment lists | ||
of all persons; | ||
:Delete assignment | ||
if completed; | ||
|
||
|
||
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,47 @@ | ||
@startuml | ||
!include style.puml | ||
|
||
box Logic LOGIC_COLOR_T1 | ||
participant ":LogicManager" as LogicManager LOGIC_COLOR | ||
participant ":AddressBookParser" as AddressBookParser LOGIC_COLOR | ||
participant "r:CleanAssignmentCommand" as CleanAssignmentCommand LOGIC_COLOR | ||
end box | ||
|
||
box Model MODEL_COLOR_T1 | ||
participant ":Model" as Model MODEL_COLOR | ||
end box | ||
|
||
|
||
[-> LogicManager : execute(clean) | ||
activate LogicManager | ||
|
||
LogicManager -> AddressBookParser : parseCommand(clean) | ||
activate AddressBookParser | ||
|
||
create CleanAssignmentCommand | ||
AddressBookParser -> CleanAssignmentCommand | ||
activate CleanAssignmentCommand | ||
|
||
CleanAssignmentCommand --> AddressBookParser | ||
deactivate CleanAssignmentCommand | ||
|
||
AddressBookParser --> LogicManager : u | ||
deactivate AddressBookParser | ||
|
||
LogicManager -> CleanAssignmentCommand : execute() | ||
activate CleanAssignmentCommand | ||
|
||
CleanAssignmentCommand -> Model : cleanAssignments() | ||
activate Model | ||
|
||
Model --> CleanAssignmentCommand | ||
deactivate Model | ||
|
||
CleanAssignmentCommand --> LogicManager : result | ||
deactivate CleanAssignmentCommand | ||
CleanAssignmentCommand -[hidden]-> LogicManager : result | ||
destroy CleanAssignmentCommand | ||
|
||
[<--LogicManager | ||
deactivate LogicManager | ||
@enduml |
File renamed without changes.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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.
File renamed without changes
Binary file not shown.
Binary file not shown.
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
22 changes: 22 additions & 0 deletions
22
src/main/java/seedu/address/logic/commands/CleanAssignmentCommand.java
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,22 @@ | ||
package seedu.address.logic.commands; | ||
|
||
import seedu.address.model.Model; | ||
|
||
import static java.util.Objects.requireNonNull; | ||
|
||
/** | ||
* Removes all completed assignments for all persons in the addressbook. | ||
*/ | ||
public class CleanAssignmentCommand extends Command { | ||
|
||
public static final String COMMAND_WORD = "clean"; | ||
public static final String MESSAGE_SUCCESS = "Completed assignments removed for all persons!"; | ||
|
||
@Override | ||
public CommandResult execute(Model model) { | ||
requireNonNull(model); | ||
model.cleanAssignments(); | ||
return new CommandResult(MESSAGE_SUCCESS); | ||
} | ||
|
||
} |
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
Oops, something went wrong.