[Arun Kumarr] Duke Increments#353
[Arun Kumarr] Duke Increments#353ArunBeCoding wants to merge 47 commits intonus-cs2103-AY1920S1:masterfrom
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! |
| * to print for "list" command | ||
| * @return string in the format required | ||
| */ | ||
| public String printer(){ |
There was a problem hiding this comment.
Need a space before the curly bracket.
| 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.
Can delete the comments if it is not needed anymore :)
| * to print for text file | ||
| * @return string in the format required | ||
| */ | ||
| public String printToOutput(){ |
| * @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("\\|"); |
| * @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); |
|
|
||
| if (segments[1].equals(" 1 ")) { | ||
| newTask.taskDone(); | ||
| } else {} |
| * @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.
Maybe can use better argument name instead of s as it is not intuitive
| /** | ||
| * marks when task is done | ||
| */ | ||
| public void taskDone(){ |
There was a problem hiding this comment.
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.
| * exception for incorrect date format | ||
| * @param message is dummy parameter | ||
| */ | ||
| public DukeException(String message){ |
| String taskCommand = tasks.get(i).getCommand(); | ||
| if (taskCommand.contains(wordToFind) ){ | ||
| findResults.add(tasks.get(i)); | ||
| }else{} |
| String[]splitUpDate = command.split("/",2); | ||
|
|
||
| try { | ||
| SimpleDateFormat ft = new SimpleDateFormat("dd/MM/yyyy HHmm"); |
There was a problem hiding this comment.
Could use more informative naming :) eg. dateformat
A-Assertions
A code quality
No description provided.