Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
6169785
Level 0: adding greetLine and exitLine
wangsilangchange-hash Jan 27, 2023
d047c4e
Level 1: Adding echo function
wangsilangchange-hash Jan 27, 2023
b1f3481
Level 1,2: Rectify mistake in echo, where "bye" will also be echoed. …
wangsilangchange-hash Jan 27, 2023
e45b36b
Level 3: Complete level 3, add in printCurrentList function.
wangsilangchange-hash Jan 27, 2023
fbf03b0
Level 4 complete
wangsilangchange-hash Feb 3, 2023
9ac72cf
Level 5 complete
wangsilangchange-hash Feb 9, 2023
90cbc52
A-Packages
wangsilangchange-hash Feb 9, 2023
4eee682
Level 6 Complete
wangsilangchange-hash Feb 15, 2023
21815d8
Revert "Level 6 Complete"
wangsilangchange-hash Feb 15, 2023
21238c7
Revert "Revert "Level 6 Complete""
wangsilangchange-hash Feb 15, 2023
d5393f2
Fixing going back to master
wangsilangchange-hash Feb 17, 2023
55e06c9
Merge branch 'master' into branch-Level-6
wangsilangchange-hash Feb 17, 2023
d98e800
Level 7 complete
wangsilangchange-hash Feb 17, 2023
a9eebd0
A-Jar
wangsilangchange-hash Feb 17, 2023
7688011
A-MoreOOP
wangsilangchange-hash Mar 3, 2023
c240a47
Level-9, A-JavaDoc
wangsilangchange-hash Mar 3, 2023
fde76d5
Create user guide for Duke
JangusRoundstone Mar 3, 2023
da82fc2
Merge commit 'fde76d508d756f10c50396b0d6398fed4f2da62d' into branch-L…
wangsilangchange-hash Mar 3, 2023
d9e6240
Merge pull request #1 from JangusRoundstone/branch-Level-7
JangusRoundstone Mar 5, 2023
e202337
branch-Level-9
wangsilangchange-hash Mar 5, 2023
806f874
branch-A-JavaDoc
wangsilangchange-hash Mar 5, 2023
4b7e1b8
Merge pull request #2 from JangusRoundstone/branch-A-JavaDoc
JangusRoundstone Mar 5, 2023
d703de1
Merge tag 'branch-Level-9'
wangsilangchange-hash Mar 5, 2023
399c136
Published UG
wangsilangchange-hash Mar 5, 2023
d914533
Merge branch 'master' into branch-Level-9
wangsilangchange-hash Mar 5, 2023
b8552f4
Merge pull request #3 from JangusRoundstone/branch-Level-9
JangusRoundstone Mar 5, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,8 @@ Prerequisites: JDK 11, update Intellij to the most recent version.
| | | | | | | |/ / _ \
| |_| | |_| | < __/
|____/ \__,_|_|\_\___|


```

wang silang
170 changes: 156 additions & 14 deletions docs/README.md
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
61 changes: 61 additions & 0 deletions src/.idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 0 additions & 10 deletions src/main/java/Duke.java

This file was deleted.

46 changes: 46 additions & 0 deletions src/main/java/Duke/Duke.java
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();
}
}

Copy link
Copy Markdown

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!

4 changes: 4 additions & 0 deletions src/main/java/Duke/Exception/EmptyDeadlineException.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
package Duke.Exception;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The 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 {
}
4 changes: 4 additions & 0 deletions src/main/java/Duke/Exception/EmptyEventsException.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
package Duke.Exception;

public class EmptyEventsException extends Exception {
}
4 changes: 4 additions & 0 deletions src/main/java/Duke/Exception/EmptyToDoException.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
package Duke.Exception;

public class EmptyToDoException extends Exception {
}
4 changes: 4 additions & 0 deletions src/main/java/Duke/Exception/NullCommandException.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
package Duke.Exception;

public class NullCommandException extends Exception {
}
Loading