-
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
Bui Phuong Nam ip #236
base: master
Are you sure you want to change the base?
Bui Phuong Nam ip #236
Conversation
Add, List
Add, List
Added Mark & Unmark
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 progress on your iP! I have left some comments regarding some areas for improvement.
package Arsdorint.task; | ||
|
||
public class Deadline extends Task { | ||
public static final String typeDeadline = "D"; |
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.
Consider renaming your constant variables to all uppercase in order to maintain consistency and adhere to the module's coding standards.
package Arsdorint.task; | ||
|
||
public class Event extends Task { | ||
public static final String typeEvent = "E"; |
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.
Similarly, consider renaming your constant variables to all uppercase
private static final int MAX_NUM_OF_TASKS = 100; | ||
private static final String EXIT_MESSAGE = " Bye. Hope to see you again soon!\n"; | ||
private static final String HELLO_MESSAGE = | ||
" Hello! I'm Arsdorint, a member of Arsdorint Team.\n" + | ||
" Please Type The Command As Follow:\n"; | ||
private static final String COMMAND_LIST_MESSAGE = | ||
"> Type \"list\" to list all the tasks. \n" + | ||
"> Type \"mark\" follow by a number x to mark x tasks in the list. \n" + | ||
"> Type \"unmark\" follow by a number y to unmark y tasks in the list. \n" + | ||
"> Type \"todo\" follow by a string x to add a work that need to be done. \n" + | ||
"> Type \"deadline /x y\" with x is the type of work, y is the time or date of the deadline. \n" + | ||
"> Type \"event x /y\" with x is the event, y is the time or date of that event. \n" + | ||
"> Type \"bye\" to exit. \n"; | ||
private static final String QUESTION = " What can I do for you?"; | ||
|
||
private static final String STORAGE_DIRECTORY = "./storage"; | ||
private static final String STORAGE_FILE_NAME = "./storage/arsdorintTask.txt"; | ||
private static final String MESSAGE_NEW_FILE = "File created"; | ||
private static final String MESSAGE_OVERWRITE_FILE = "File overwritten"; | ||
private static final String MESSAGE_LOAD_FILE = "File loaded"; | ||
private static final String MESSAGE_NO_FILE = "There is no existing file"; | ||
private static final String MESSAGE_WRONG_FILE = "The storage files entry is invalid. Please save to overwrite"; | ||
private static final String MESSAGE_DIVIDER = | ||
"____________________________________________________________"; | ||
private static final String MESSAGE_DIVIDER_LIST = | ||
"____________________________LIST____________________________"; | ||
private static final String MESSAGE_DELETE = "Noted. I've removed this task:"; | ||
|
||
private static final String ERROR_MESSAGE_BYE = " "; | ||
private static final String ERROR_MESSAGE_LIST = " "; | ||
private static final String ERROR_MESSAGE_MARK = | ||
"=( OOPS!!! The description of a mark cannot be empty.\n" + "Syntax for mark\n\t" + | ||
">>> mark <item index number> \n" + "Note: item index must exist in the current list"; | ||
private static final String ERROR_MESSAGE_UNMARK = | ||
"=( OOPS!!! The description of an unmark cannot be empty.\n" + "Syntax for unmark\n\t" + | ||
">>> unmark <item index number> \n" + "Note: item index must exist in the current list"; | ||
private static final String ERROR_MESSAGE_TODO = | ||
"=( OOPS!!! The description of a todo cannot be empty.\n" + "Syntax for todo\n\t>>> todo <task>"; | ||
private static final String ERROR_MESSAGE_DEADLINE = | ||
"=( OOPS!!! The description of a deadline cannot be empty.\n" + |
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.
You can consider relocating all your messages to a separate java file in order to improve code readability of Arsdorint.java
.
|
||
|
||
public static void removeTaskMessage(int idx) { | ||
//showToUser(MESSAGE_DIVIDER); |
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.
If you no longer plan to use this line of code, consider removing it.
if (lowerCaseLine.equals("bye")) exit(); | ||
else if (lowerCaseLine.contains("list")) { | ||
System.out.println("Here are the tasks in your list:\n"); | ||
list(); | ||
} | ||
else if (lowerCaseLine.equalsIgnoreCase("mark")) { | ||
mark(splitLine); | ||
} | ||
else if (lowerCaseLine.equalsIgnoreCase("unmark")) { | ||
unmark(splitLine); | ||
} | ||
else if (lowerCaseLine.equalsIgnoreCase("todo") || | ||
lowerCaseLine.equalsIgnoreCase("deadline") || | ||
lowerCaseLine.equalsIgnoreCase("event")) add(command); | ||
//add command when user don't type the instruction's TaskList.command | ||
else if (lowerCaseLine.equalsIgnoreCase("delete")) { | ||
delete(splitLine); | ||
} | ||
else if (lowerCaseLine.equalsIgnoreCase("save")) { | ||
save(); | ||
} | ||
else wrongCommandMessage(); | ||
} |
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.
Consider re-organising this if-else block to match the format stated in the coding standard, in order to maintain consistnecy.
A-Userguide
No description provided.