-
Notifications
You must be signed in to change notification settings - Fork 362
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
[Gibson0918] IP #375
base: master
Are you sure you want to change the base?
[Gibson0918] IP #375
Conversation
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.
LGTM. Good job thus far. Jiayous.
src/main/java/Duke.java
Outdated
switch (userInput[0]) { | ||
case "bye": | ||
System.out.println("Bye. Hope to see you again soon!"); | ||
sc.close(); | ||
startDuke = false; | ||
break; |
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.
Switch-case should not be indented. Could edit coding style in Intellij to reduce having to manually check.
src/main/java/Duke.java
Outdated
String[] userInput = sc.nextLine().split(" ", 2); | ||
|
||
try { | ||
switch (userInput[0]) { |
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 potentially abstract out userInput[0] using enum
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.
Great code overall!
src/main/java/Event.java
Outdated
protected LocalDateTime from; | ||
protected LocalDateTime to; |
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.
perhaps startDate and endDate would be better names
src/main/java/Event.java
Outdated
return "[E]" + super.toString() + " (from: " + from.format(DateTimeFormatter.ofPattern("MMM dd yyyy HH:mm")) + " to: " + to.format(DateTimeFormatter.ofPattern("MMM dd yyyy HH:mm")) + ")"; | ||
|
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.
this return statement could be indented better
public boolean isTerminated() { | ||
return isTerminated; | ||
}; |
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.
there shouldn't be a semi colon at the end of a method
public class ExitCommand extends Command { | ||
|
||
@Override | ||
public void initCommand(TaskList tasks, Ui ui, Storage storage) { |
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 job making the code readable and easy to understand
String[] output = command.split(" ", 2); | ||
ValidCommands validCommands = ValidCommands.valueOf(output[0].toUpperCase()); | ||
switch (validCommands) { | ||
case LIST: |
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.
Remember that there should not be any indentation for case clauses :)
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.
otherwise, i like how it is very easy to understand what your parser is doing 👍
String[] data = sc.nextLine().split(" \\| "); | ||
Task task = null; | ||
switch (data[0]) { | ||
case "T": |
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.
Same issue with the indentation for switch case as mentioned earlier :)
public List<Task> loadFile() throws FileNotFoundException { | ||
List<Task> taskList = new ArrayList<>(); | ||
File file = new File(filePath); | ||
if (file.isFile()) { |
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.
Is it possible to avoid this deep nesting?
Remove Java Docs for methods that have been removed. Refactor Todo, Deadline and Event's toString() and formatForFile() method for better clarity. Removed unused method in the Ui Class
Tasks already added to Duke cannot be updated so an edit/update feature for existing task would be appreciated as the only way to modify a task would be to delete the existing one and create a new one. Let's modify the 3 tasks (Event, Todo, Deadline) and add an UpdateCommand class to support Duke in updating existing task
1. Resolve minor GUI bugs where the GUI was not resizing properly 2. Added the missed out set method in TaskList class
Added Assertions to Duke
Duke
Duke is a simple reminder app that helps you to remember things you need to do. It's,
FASTSUPER FAST to useAll you need to do is,
And it is FREE!
Features:
if you are a Java programmer, you can use it to practice Java too. Here's the main method: