-
Notifications
You must be signed in to change notification settings - Fork 200
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Wang Silang] iP #214
base: master
Are you sure you want to change the base?
[Wang Silang] iP #214
Changes from all commits
6169785
d047c4e
b1f3481
e45b36b
fbf03b0
9ac72cf
90cbc52
4eee682
21815d8
21238c7
d5393f2
55e06c9
d98e800
a9eebd0
7688011
c240a47
fde76d5
da82fc2
d9e6240
e202337
806f874
4b7e1b8
d703de1
399c136
d914533
b8552f4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,171 @@ | ||
# User Guide | ||
# Duke: Your Personal Agenda Assistant 📑 | ||
|
||
## Features | ||
Duke is a Java personal agenda keeper. He is smart enough to assist in your daily activity planning. Below are his functionalities: | ||
|
||
### Feature-ABC | ||
1. [Add Task](#add) | ||
1. [Todo](#t) | ||
2. [Event](#e) | ||
3. [Deadline](#d) | ||
2. [Mark/Unmark Task](#mum) | ||
1. [Mark Task](#mt) | ||
2. [Unmark Task](#u) | ||
3. [Delete Task](#dt) | ||
4. [List Task](#lt) | ||
5. [Find Task](#ft) | ||
6. [Exit](#end) | ||
-------------------------------------------------------------------- | ||
# NOTE: | ||
* Follow the input format as mentioned below to avoid errors. | ||
-------------------------------------------------------------------- | ||
|
||
Description of the feature. | ||
# 1. Add Task <a name = "add"></a> | ||
|
||
### Feature-XYZ | ||
You can add 3 types of tasks, Todos, Events and Deadlines. | ||
|
||
Description of the feature. | ||
## 1.1. Todo <a name = "t"></a> | ||
* COMMAND: todo {task} | ||
|
||
## Usage | ||
|
||
### `Keyword` - Describe action | ||
Input: | ||
|
||
Describe the action and its outcome. | ||
```todo return book``` | ||
|
||
Example of usage: | ||
Output: | ||
``` | ||
As per requested Sire, this task has been added to your calendar. | ||
[T][ ] return book | ||
You now have 7 items left | ||
``` | ||
|
||
|
||
## 1.2. Event <a name = "e"></a> | ||
* COMMAND: event {task} \from {string} \to {string} | ||
|
||
Input: | ||
|
||
```event meeting with friend /from 4pm /to 6pm``` | ||
|
||
Output: | ||
``` | ||
As per requested Sire, this task has been added to your calendar. | ||
[E][ ] meeting with friend (from: 4pm to: 6pm) | ||
You now have 8 items left | ||
``` | ||
|
||
## 1.3. Deadline <a name = "d"></a> | ||
* Command: deadline {task} \by {string} | ||
|
||
Input: | ||
|
||
```deadline finish CS2113 assignment/by Sunday``` | ||
|
||
Output: | ||
``` | ||
As per requested Sire, this task has been added to your calendar. | ||
[D][ ] finish CS2113 assignmen (by: Sunday) | ||
You now have 9 items left | ||
``` | ||
|
||
|
||
# 2. Mark/Unmark Task <a name = "mum"></a> | ||
|
||
Mark the task at the index keyed in by users as done, or unmark it as unfinished. | ||
For index of all current tasks, please see [List Task](#lt). | ||
|
||
## 2.1. Mark Task <a name="mt"></a> | ||
* COMMAND: mark {enter task_index} | ||
|
||
Input: | ||
|
||
```mark 1``` | ||
|
||
Output: | ||
|
||
``` | ||
Sir, your task has been marked as completed. | ||
[T][X] Finish CS2113 iP | ||
``` | ||
|
||
## 2.2. Unmark Task <a name="u"></a> | ||
* COMMAND: unmark {enter task_index} | ||
|
||
Input: | ||
|
||
```unmark 2``` | ||
|
||
Output: | ||
|
||
``` | ||
Sir, your task has been unmarked as requested. | ||
[T][ ] sleep | ||
``` | ||
|
||
# 3. Delete Task <a name = "dt"></a> | ||
|
||
Delete task at keyed in index as follows: | ||
|
||
* COMMAND: delete {enter task_index} | ||
|
||
Input: | ||
|
||
```delete 1``` | ||
|
||
Output: | ||
|
||
``` | ||
Sire, I have removed this task from your schedule | ||
[T][X] Finish CS2113 iP | ||
You now have 8 items left | ||
``` | ||
|
||
# 4. List Task <a name = "lt"></a> | ||
|
||
List all tasks in the list as follows: | ||
|
||
* COMMAND: list | ||
|
||
Input: | ||
|
||
```list``` | ||
|
||
`keyword (optional arguments)` | ||
Output: | ||
|
||
Expected outcome: | ||
``` | ||
Your current list of items as requested, sir. | ||
1.[T][ ] sleep | ||
2.[E][ ] project meeting (from: Mon 2pm to: 4pm) | ||
3.[T][ ] return book | ||
4.[E][ ] meeting with friend (from: 4pm to: 6pm) | ||
``` | ||
|
||
# 5. Find Task <a name = "ft"></a> | ||
|
||
Find the desired tasks by keying in a term they contain as follows: | ||
|
||
Description of the outcome. | ||
* COMMAND: find {keyword} | ||
|
||
Input: | ||
|
||
```find friend``` | ||
|
||
Output: | ||
``` | ||
expected output | ||
Here are the matching items Sire: | ||
[E][ ] meeting with friend (from: 4pm to: 6pm) | ||
``` | ||
|
||
|
||
# 6. Exit <a name = "end"></a> | ||
|
||
Exit the program as follows: | ||
|
||
Input: | ||
|
||
```bye``` | ||
|
||
Output: | ||
``` | ||
Glad I could be of help! | ||
``` | ||
|
||
# End of user guide |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
package Duke; | ||
|
||
public class Duke { | ||
private Ui ui; | ||
private Storage storage; | ||
private TaskList tasklist; | ||
private Parser parser; | ||
private final int PARSERINDEX = 1; | ||
|
||
public Duke(String filePath) { | ||
ui = new Ui(); | ||
storage = new Storage(); | ||
tasklist = new TaskList(filePath); | ||
parser = new Parser(); | ||
} | ||
|
||
public void run() { | ||
ui.greet(); | ||
while (parser.getIsRunning()) { | ||
String commandToBeParsed = ui.readCommand(); | ||
String commandParsed = parser.parseCommand(commandToBeParsed); | ||
if (commandParsed.startsWith("B")) { // bye from user, terminate program | ||
parser.setIsRunning(false); | ||
} else if (commandParsed.startsWith("L")) { // print list | ||
tasklist.printCurrentList(); | ||
} else if (commandParsed.startsWith("F")) { // find tasks in list | ||
tasklist.printTasksFound(commandParsed.substring(PARSERINDEX)); | ||
} else if (commandParsed.startsWith("M")) { // mark task | ||
tasklist.mark(commandParsed.substring(PARSERINDEX)); | ||
} else if (commandParsed.startsWith("U")) { // unmark task | ||
tasklist.unmark(commandParsed.substring(PARSERINDEX)); | ||
} else if (commandParsed.startsWith("D")) { // delete task | ||
tasklist.delete(commandParsed.substring(PARSERINDEX)); | ||
} else if (commandParsed.startsWith("XNC")) { // null command error | ||
ui.printErrorMessage("Sire, I am not trained to understand gibberish."); | ||
} else { // task keyed in by users | ||
tasklist.addTask(commandParsed.substring(PARSERINDEX)); | ||
} | ||
} | ||
ui.bye(); | ||
} | ||
|
||
public static void main(String[] args) { | ||
new Duke("dukeData.txt").run(); | ||
} | ||
} | ||
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
package Duke.Exception; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Names representing packages should be in all lower case. Look at Java coding standards for more details. |
||
|
||
public class EmptyDeadlineException extends Exception { | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
package Duke.Exception; | ||
|
||
public class EmptyEventsException extends Exception { | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
package Duke.Exception; | ||
|
||
public class EmptyToDoException extends Exception { | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
package Duke.Exception; | ||
|
||
public class NullCommandException extends Exception { | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good job refactoring the code!