-
Notifications
You must be signed in to change notification settings - Fork 483
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
[jellywaiyan] iP #538
base: master
Are you sure you want to change the base?
[jellywaiyan] iP #538
Changes from 1 commit
28ad2b8
ed6d4d2
5f41e1b
7845ef4
0a8f1fa
d757c5a
855fdbe
8ad03a0
9e78b42
4a262ae
f98495d
a1abb5f
8708c8a
4dbc78f
a6a9d84
7196ad9
8418609
ffc0ca4
9196ca0
f4cfe37
40dccfa
ec17221
1036713
eb3af70
e349452
298034b
7153636
f296862
f424f95
092aca3
ef85ff8
accd66b
aa8546d
c4e9d23
69dfcb2
78be3ef
5797609
cb808e7
4e8dd06
21c4475
43f2b52
22a0934
7c36a44
aef83c9
288f645
fc579d9
ccfa675
86abced
5a0e075
74fff83
1af5407
4015151
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 |
---|---|---|
|
@@ -5,42 +5,81 @@ | |
import java.util.ArrayList; | ||
import java.util.Scanner; | ||
|
||
/** | ||
* Responsible for the interface of the Jelly Chat Bot. | ||
*/ | ||
public class Ui { | ||
private Scanner sc; | ||
|
||
/** | ||
* Constructor for Ui, takes in user input from the keyboard. | ||
*/ | ||
public Ui() { | ||
sc = new Scanner(System.in); | ||
} | ||
|
||
/** | ||
* Prints out a welcome message when the Chat Bot is booted up. | ||
*/ | ||
public void startUpMessage() { | ||
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. sounds like a noun |
||
System.out.println("Hello! I'm Jelly"); | ||
System.out.println("What can I do for you?"); | ||
} | ||
|
||
/** | ||
* Reads the command inputted by the user. | ||
* | ||
* @return A string of the command inputted. | ||
*/ | ||
public String commandMe() { | ||
return sc.nextLine(); | ||
} | ||
|
||
/** | ||
* If there is an error, diplay it to the user. | ||
* | ||
* @param message The error message. | ||
*/ | ||
public void displayErrorMessage(String message) { | ||
System.out.println(message); | ||
} | ||
|
||
/** | ||
* Displays the list of tasks in the storage. | ||
* | ||
* @param storage The tasklist that is in the storage. | ||
*/ | ||
public void printList(ArrayList<Task> storage) { | ||
for (int i = 0; i < storage.size(); i++) { | ||
System.out.println((i + 1) + "." + storage.get(i).toString()); | ||
} | ||
} | ||
|
||
public void addedTaskMessage(Task task, int noOfTasks) { | ||
System.out.println("Ok! I've added this task: \n" + task.toString()); | ||
/** | ||
* Displays a completion message after successfully adding a task to the list. | ||
* | ||
* @param addedTask The task that was added. | ||
* @param noOfTasks The total number of tasks in the list after adding. | ||
*/ | ||
public void addedTaskMessage(Task addedTask, int noOfTasks) { | ||
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. noun |
||
System.out.println("Ok! I've added this task: \n" + addedTask.toString()); | ||
System.out.println("Now you have " + noOfTasks + " tasks in the list."); | ||
} | ||
|
||
/** | ||
* Displays a completion message after successfully deleting a task from the list. | ||
* | ||
* @param deletedTask The task that was deleted. | ||
* @param noOfTasks The total number of tasks in the list after deletion. | ||
*/ | ||
public void deleteMessage(Task deletedTask, int noOfTasks) { | ||
System.out.println("Okay, I've removed this task: \n" + deletedTask); | ||
System.out.println("Now you have " + noOfTasks + " in the list."); | ||
} | ||
|
||
|
||
/** | ||
* Displays a final message to the user before the Chat Bot shuts down. | ||
*/ | ||
public void byeMessage() { | ||
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. noun |
||
System.out.println("Bye mate! Have a nice day :]"); | ||
} | ||
|
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.
I do not think "@param args" help much
And I believe that you do not need to document every method as well.