-
Notifications
You must be signed in to change notification settings - Fork 315
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
[Arun Kumarr] Duke Increments #353
base: master
Are you sure you want to change the base?
Conversation
Add toolVersion block in to Gradle code sample to prevent errors.
Change file mode on `gradle` to be executable (nus-cs2103-AY1920S1#9)
This reverts commit d96e6b1.
This reverts commit e786e40.
It's really good that you've written javadocs comments! But in the style guide, they suggest that the javadoc comments should be capitalised and start with a singular verb. Also, @param doesn't need the "is" word. So for example,
could be something like
It's good that you've split up the tasks into more OOP, like with the parser, ui, and storage. I think another way of splitting it up would be to move the interpretation of the commands into the parser, and just have the ui for the printing. It's also possible to go into even more OOP, for example having different commands. Then your parser could pass command objects back to Duke, then Duke executes the command with the Ui, Storage, and TasksList. For error handling, some error names could be more descriptive, like DukeException for date formatting. Good job overall! |
Hi Arun! I like that you have included Javadoc comments for most of your methods and have separated your test cases into different classes for jUnit testing which makes it more organised! (something I should consider doing as well). Some suggestions:
Overall, I think you have done a good job! |
src/main/java/Deadline.java
Outdated
* to print for "list" command | ||
* @return string in the format required | ||
*/ | ||
public String printer(){ |
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.
Need a space before the curly bracket.
src/main/java/DeleteCommand.java
Outdated
try { | ||
int val = Integer.parseInt(splitWords[1]); | ||
ui.deleteMessage(val-1, tasks); | ||
//System.out.println("Noted. I've removed this task:"+ "\n" + tasks.taskPrint(val-1) + |
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.
Can delete the comments if it is not needed anymore :)
src/main/java/Deadline.java
Outdated
* to print for text file | ||
* @return string in the format required | ||
*/ | ||
public String printToOutput(){ |
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.
add a space between () and {
src/main/java/Deadline.java
Outdated
* @throws DukeException in case segments[3] is not in the proper date format | ||
*/ | ||
public static Task outputAsDeadline(String s) throws DukeException { | ||
String[]segments = s.split("\\|"); |
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.
add a space between [] and segments
src/main/java/Deadline.java
Outdated
* @throws Exception in case user inputs in an incorrect format | ||
*/ | ||
public static void createDeadline(String command, TaskList tasks, Storage storage) throws DukeException { | ||
String[]splitWords = command.trim().split("\\s",2); |
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.
add space between [] and splitWords
src/main/java/Deadline.java
Outdated
|
||
if (segments[1].equals(" 1 ")) { | ||
newTask.taskDone(); | ||
} else {} |
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.
Should not have an empty else block :)
src/main/java/Deadline.java
Outdated
* @return a Task (Deadline) object | ||
* @throws DukeException in case segments[3] is not in the proper date format | ||
*/ | ||
public static Task outputAsDeadline(String s) throws DukeException { |
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.
Maybe can use better argument name instead of s
as it is not intuitive
src/main/java/Deadline.java
Outdated
/** | ||
* marks when task is done | ||
*/ | ||
public void taskDone(){ |
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.
line 97, 104 & 112: space between () & {
line 97 to 107: You may consider either using try-catch block and throw your exception inside the try block, or just if-else and throw your exception in else block.
src/main/java/DukeException.java
Outdated
* exception for incorrect date format | ||
* @param message is dummy parameter | ||
*/ | ||
public DukeException(String message){ |
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.
Space before curly bracket
src/main/java/FindCommand.java
Outdated
String taskCommand = tasks.get(i).getCommand(); | ||
if (taskCommand.contains(wordToFind) ){ | ||
findResults.add(tasks.get(i)); | ||
}else{} |
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 removing empty else.
src/main/java/Event.java
Outdated
String[]splitUpDate = command.split("/",2); | ||
|
||
try { | ||
SimpleDateFormat ft = new SimpleDateFormat("dd/MM/yyyy HHmm"); |
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.
Could use more informative naming :) eg. dateformat
A-Assertions
A code quality
No description provided.