diff --git a/src/main/java/duke/task/TaskList.java b/src/main/java/duke/task/TaskList.java index 1225bc9fa3..431a341d18 100644 --- a/src/main/java/duke/task/TaskList.java +++ b/src/main/java/duke/task/TaskList.java @@ -33,6 +33,7 @@ public int getSize() { /** * get the number i task + * @param i index */ public Task get(int i) { assert i >= 0 : "Getter error, pointer less than 0"; @@ -41,6 +42,9 @@ public Task get(int i) { /** * check whether is date format + * @param date String date + * @param pattern date pattern + * @return boolean of whether string match the pattern */ public boolean isDateFormat(String date, String pattern) { SimpleDateFormat dateFormat = new SimpleDateFormat(pattern); @@ -59,6 +63,7 @@ public boolean isDateFormat(String date, String pattern) { /** * add task to the list + * @param t task that being added */ public void add(Task t) { task.add(t); @@ -66,6 +71,9 @@ public void add(Task t) { /** * parser for add tasks + * @param userInput + * @param ui + * @return String that indicating the result */ public String add(String[] userInput, Ui ui) throws DukeException { String reportString = " "; @@ -111,6 +119,9 @@ public String add(String[] userInput, Ui ui) throws DukeException { /** * mark task as done + * @param inputIndex + * @param ui + * return String indicating the done option */ public String doneTask(String inputIndex, Ui ui) { try { @@ -134,6 +145,9 @@ public String doneTask(String inputIndex, Ui ui) { /** * delete task from list + * @param inputIndex the index of the task being deleted + * @param ui the ui for style printing + * @return string indicating the result of deletion */ public String deleteTask(String inputIndex, Ui ui) { try { @@ -154,8 +168,9 @@ public String deleteTask(String inputIndex, Ui ui) { /** * print out task + * @return tasks description in the list */ - public String printTask(Ui ui) { + public String printTask() { String taskList; taskList = "Here is your current tasks\n"; for (int i = 1; i <= task.size(); ++i) { @@ -166,6 +181,8 @@ public String printTask(Ui ui) { /** * check whether a task is in the list + * @param taskInfo + * @return foundTasks tasks with discriptions that match the string */ public List findTask(String taskInfo) { List foundTasks = new ArrayList<>(); diff --git a/src/main/java/duke/ui/Ui.java b/src/main/java/duke/ui/Ui.java index 1be3360050..0984bff772 100644 --- a/src/main/java/duke/ui/Ui.java +++ b/src/main/java/duke/ui/Ui.java @@ -126,7 +126,7 @@ public String getResponse(String userInput, TaskList task, FileSaver fs) { response = task.deleteTask(input[1], this); break; case LIST: - response = task.printTask(this); + response = task.printTask(); break; case DONE: response = task.doneTask(input[1], this);