Skip to content

Commit dbec446

Browse files
committed
Finalize code
1 parent 0b4c2df commit dbec446

20 files changed

Lines changed: 60 additions & 57 deletions

data/Duke.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +0,0 @@
1-
1@@X@@a 2103 individual project
2-
3@@ @@Chinese New Year@@Feb 11 2021

data/Statistics.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Task history:
2+
1
3+
[T][ ] project
4+
2
5+
[T][ ] project

src/main/java/duke/command/AddCommand.java

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ public class AddCommand extends Command {
1717
* Creates a AddCommand object for execution.
1818
*
1919
* @param instruction user instruction.
20-
* @param task task name of the user in String.
20+
* @param task content of the user task.
2121
* @param date date of the user task to be done.
2222
*/
2323
public AddCommand(String instruction, String task, String date) {
@@ -35,10 +35,12 @@ public AddCommand(String instruction, String task, String date) {
3535
/**
3636
* This method handles todo instruction and creates a Todo task.
3737
*
38-
* @param task name of the user task.
38+
* @param task content of the user task.
3939
*/
4040
private static String handleToDo(String task) {
4141
Todo todo = new Todo(task);
42+
43+
// Update the task list and statistics with the new task.
4244
TaskList.addTask(todo);
4345
Statistics.updateStatistics(todo);
4446
return Ui.createAddResponse(todo);
@@ -47,10 +49,12 @@ private static String handleToDo(String task) {
4749
/**
4850
* This method handles deadline instruction and creates a Deadline task.
4951
*
50-
* @param task name of the user task.
52+
* @param task content of the user task.
5153
*/
5254
private static String handleDeadline(String task, String date) {
5355
Deadline deadlines = new Deadline(task, date);
56+
57+
// Update the task list and statistics with the new task.
5458
TaskList.addTask(deadlines);
5559
Statistics.updateStatistics(deadlines);
5660
return Ui.createAddResponse(deadlines);
@@ -59,10 +63,12 @@ private static String handleDeadline(String task, String date) {
5963
/**
6064
* This method handles event instruction and creates a Event task.
6165
*
62-
* @param task name of the user task.
66+
* @param task content of the user task.
6367
*/
6468
private static String handleEvent(String task, String date) {
6569
Event event = new Event(task, date);
70+
71+
// Update the task list and statistics with the new task.
6672
TaskList.addTask(event);
6773
Statistics.updateStatistics(event);
6874
return Ui.createAddResponse(event);

src/main/java/duke/command/Command.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ public abstract class Command {
1616
* Creates a command with user instruction, task, date and a function to execute the instruction.
1717
*
1818
* @param instruction user instruction.
19-
* @param task user task.
19+
* @param task content of user task.
2020
* @param date date of the task.
2121
* @param func the function takes a command to execute and returns a response String.
2222
*/

src/main/java/duke/command/DeleteCommand.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,12 @@
11
package duke.command;
22

3-
4-
53
import duke.task.TaskList;
64
import duke.ui.ErrorBox;
75
import duke.ui.Ui;
86

9-
107
/**
118
* Sub-class of command that only represents and executes a delete instruction of a user.
129
*/
13-
1410
public class DeleteCommand extends Command {
1511
private static final String NO_DATE = "";
1612

src/main/java/duke/command/DoneCommand.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
package duke.command;
22

3-
43
import duke.task.TaskList;
54
import duke.ui.ErrorBox;
65
import duke.ui.Ui;
76

8-
97
/**
108
* Sub-class of Command that represents and executes the done instruction of user.
119
*/
@@ -14,7 +12,7 @@ public class DoneCommand extends Command {
1412

1513
/**
1614
* Creates a DoneCommand object with the given task.
17-
* @param task user task.
15+
* @param task content of user task.
1816
*/
1917
public DoneCommand(String task) {
2018
super("done", task, NO_DATE, false, command -> handleDone(task));

src/main/java/duke/command/ErrorCommand.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
package duke.command;
22

3-
43
import duke.ui.Ui;
54

65
/**

src/main/java/duke/command/ExitCommand.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
package duke.command;
22

3-
43
import duke.ui.Ui;
54

65
/**

src/main/java/duke/command/ListCommand.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
package duke.command;
22

3-
4-
53
import duke.task.TaskList;
64

75
/**

src/main/java/duke/exceptions/DukeException.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
package duke.exceptions;
22

3-
4-
5-
63
/**
74
* A class that stores all the possible display of errorsException in Duke.
85
*/

0 commit comments

Comments
 (0)