forked from nus-cs2113-AY2021S1/tp
-
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 pull request nus-cs2113-AY2021S1#42 from tammykoh/master
Feature 4: List
- Loading branch information
Showing
3 changed files
with
89 additions
and
25 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,36 @@ | ||
//package seedu.duke.command; | ||
package seedu.duke.command; | ||
|
||
//import seedu.duke.storage.Storage; | ||
//import seedu.duke.task.TaskList; | ||
//import seedu.duke.ui.Ui; | ||
//import seedu.duke.exception.DukeException; | ||
import seedu.duke.exception.DukeException; | ||
import seedu.duke.ui.Ui; | ||
import seedu.duke.user.User; | ||
import seedu.duke.user.UserList; | ||
|
||
import java.util.ArrayList; | ||
|
||
/** | ||
* Prints a list of all tasks to the user. | ||
*/ | ||
//public class ListCommand extends Command { | ||
public class ListCommand extends Command { | ||
|
||
//public ListCommand() { | ||
//super(null); | ||
//} | ||
public ListCommand(String input) { | ||
super(input); | ||
} | ||
|
||
//@Override | ||
//public void execute(TaskList tasks, Ui ui/*, Storage storage*/) { | ||
//ui.printList(tasks); | ||
//} | ||
//} | ||
@Override | ||
public void execute(UserList users, Ui ui, User nowUser/*, Storage storage*/) throws DukeException { | ||
String day = input.substring(1); | ||
if (day.equals("all")) { | ||
ui.printList(users, nowUser, "mon"); | ||
ui.printList(users, nowUser, "tue"); | ||
ui.printList(users, nowUser, "wed"); | ||
ui.printList(users, nowUser, "thu"); | ||
ui.printList(users, nowUser, "fri"); | ||
ui.printList(users, nowUser, "sat"); | ||
ui.printList(users, nowUser, "sun"); | ||
} else { | ||
ui.printList(users, nowUser, day); | ||
} | ||
} | ||
} |
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