[jonyeokj] iP#518
Conversation
…lid task numbers and already marked/unmarked tasks
Gavino3o
left a comment
There was a problem hiding this comment.
Overall, the PR LGTM 👍. Some small changes can be considered but good progress has been made! Cheers and have a good day.
| throw new InvalidCommandException("☹ OOPS!!! I'm sorry, but I don't know what that means :-("); | ||
| } | ||
|
|
||
| String[] parts = input.split(" ", 2); |
There was a problem hiding this comment.
Good use of nouns and paid special attention to using plural forms when needed. Good job!
| return new DateCommand(input, tasks); | ||
| case "find": | ||
| return new FindCommand(input, tasks); | ||
| default: |
There was a problem hiding this comment.
Default case included as per coding standard. 👍
|
|
||
| @Override | ||
| public String toString() { | ||
| return "[E][" + (isDone ? "X" : " ") + "] " + description + " (from: " + from + " to: " + to + ")"; |
There was a problem hiding this comment.
Consider using String.format here, it makes the string more readable and easier to edit if required in the future.
|
|
||
| String type = parts[0]; | ||
|
|
||
| switch (type) { |
There was a problem hiding this comment.
If it's only two conditions, consider using if else instead. But I can see the potential of including todos, events and more subtypes of Tasks in the future.
| @@ -0,0 +1,37 @@ | |||
| package martin; | |||
| import java.util.Scanner; | |||
|
|
|||
There was a problem hiding this comment.
Consider adding JavaDocs for classes for a short description of what the class encapsulates or can do.
wui-hong
left a comment
There was a problem hiding this comment.
Overall, LGTM. Only minor suggestions but they are nitpicks!
| isDone = true; | ||
| } | ||
|
|
||
| public void unmarkAsDone() { |
There was a problem hiding this comment.
Would it be more appropriate to rename the function to markAsUndone?
| } | ||
|
|
||
| public void showLine() { | ||
| System.out.println(" ____________________________________________________________"); |
There was a problem hiding this comment.
Perhaps adding the Line string as a constant would make your code more readable and reusable
| Files.createFile(path); | ||
| } | ||
| Files.write(path, lines, StandardOpenOption.TRUNCATE_EXISTING); | ||
| } catch (IOException e) { |
There was a problem hiding this comment.
Good use of error handling throughout the code
| } | ||
|
|
||
| ui.showLine(); | ||
| System.out.println(" Tasks on " + date.format(DateTimeFormatter.ofPattern("M d yyyy")) + ":"); |
There was a problem hiding this comment.
Might be neater to split out the date formatting section onto a new line
erohsikivar
left a comment
There was a problem hiding this comment.
Overall LGTM. Just some minor things can be changed.
| * | ||
| * @param message Error message to be printed out. | ||
| */ | ||
| public class InvalidCommandException extends MartinException { |
There was a problem hiding this comment.
I feel maybe don't so many classes for each exceptions since all your class methods are implementing same line of code super(message).
| @@ -0,0 +1,63 @@ | |||
| package martin.gui; | |||
There was a problem hiding this comment.
Good to see that you have separate GUI package.
- Added assertions to handle null values for input in the MainWindow class. - Ensured null responses are appropriately handled in the Martin class. - Introduced error handling for scenarios where the input is empty.
Implement assertions for null values
Refactored code in the DateCommand class to minimize arrowhead style code. Also added javadoc headers for all the command messages briefly explaining what theydo, and cleaned up the headers for their respective execute() commands.
Implement A-CodeQuality
This commit introduces the snooze command for the task management app. Users can now snooze their tasks, delaying them by a specified amount of times in minutes. Additionally, events now support the toFileFormat method. Javadoc headers have also been added to all command class constructors.
Implement Snooze and enhance Event format
Implement SortCommand to enable task sorting functionality. Extend the fromFileFormat method in Task to handle Event tasks.
Implement Sort Command and support for parsing Events
Martin Bot
Once a chess bot, now a chatbot!
Martin is:
FASTSuper FAST to useAll you need to do is,
🎉 It's Absolutely Free! 🎉
Features:
If you're a Java programmer, you can use it to practice Java too. Here's the
mainmethod: