forked from nus-cs2103-AY1920S1/duke
-
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.
Merge branch 'branch-A-CodingStandard'
# Conflicts: # src/main/java/duke/Duke.java # src/main/java/duke/parser/Parser.java # src/main/java/duke/storage/Storage.java
- Loading branch information
Showing
6 changed files
with
82 additions
and
39 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,36 @@ | ||
package duke.command; | ||
|
||
import duke.DukeException; | ||
import duke.storage.Storage; | ||
import duke.task.TaskList; | ||
import duke.ui.UserInterface; | ||
|
||
/** | ||
* Finds all tasks in the task list that matches given keyword. | ||
*/ | ||
public class FindCommand extends Command { | ||
|
||
private String keyword; | ||
|
||
/** | ||
* Creates a command to find tasks that matches this keyword. | ||
* | ||
* @param keyword keyword that is used to find tasks. | ||
*/ | ||
public FindCommand(String keyword) { | ||
this.keyword = keyword; | ||
} | ||
|
||
/** | ||
* Executes finding of matching tasks on user interface. | ||
* | ||
* @param taskList list of tasks. | ||
* @param ui user interface displaying all tasks that matches this keyword. | ||
* @param storage local storage of data. | ||
* @throws DukeException | ||
*/ | ||
@Override | ||
public void execute(TaskList taskList, UserInterface ui, Storage storage) throws DukeException { | ||
ui.showTaskList(taskList.getTaskNamesIfMatch(this.keyword)); | ||
} | ||
} |
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