Conversation
- added DONE and Task object
Add input and expected
Added 3 exceptions extending Duke Exception Persisting issue: blank line / space input does not give IDK exception.
Add delete aaaa / done aaaa exception handler as invalid.
…g to each DukeException child class.
…pdate task in taskList.
w2vgd
left a comment
There was a problem hiding this comment.
Code is easy to read overall 👍 I have noted a few coding standard violations.
src/main/java/duke/Duke.java
Outdated
|
|
||
|
|
||
| private void processInput(String userInput) { | ||
| String keyword_UC = userInput.toUpperCase().split(" ", -1)[0]; |
There was a problem hiding this comment.
Perhaps use a camelCase variable name and a more descriptive name rather than UC here?
src/main/java/duke/Duke.java
Outdated
| import duke.exceptions.DukeMissingDesException; | ||
| import duke.handler.Parser; | ||
| import duke.handler.Queries; | ||
| import duke.tasks.*; |
There was a problem hiding this comment.
Should this import statement be listed explicitly instead?
src/main/java/duke/Duke.java
Outdated
| import duke.tasks.*; | ||
| import duke.tasks.Event; | ||
|
|
||
| import java.awt.*; |
src/main/java/duke/Storage.java
Outdated
| import java.util.Scanner; | ||
|
|
||
| public class Storage { | ||
| private static String STORAGE_PATH; |
There was a problem hiding this comment.
Perhaps this instance variable should be declared final instead? (as your variable name is already in all uppercase letters)
src/main/java/duke/Ui.java
Outdated
| } | ||
|
|
||
| public String readCommand() { | ||
| assert hasCommand(); |
| @@ -0,0 +1,14 @@ | |||
| package duke.exceptions; | |||
|
|
|||
| public class DukeException extends Exception{ | |||
There was a problem hiding this comment.
Should there be a space between Exception and the opening bracket {?
| @@ -0,0 +1,23 @@ | |||
| package duke.exceptions; | |||
|
|
|||
| public class DukeIDKException extends DukeException{ | |||
There was a problem hiding this comment.
Should there be a space between DukeException and the opening bracket {?
I noticed the same issue in several other places too.
| } | ||
|
|
||
| public Task markDone() { | ||
| this.isDone = true; |
There was a problem hiding this comment.
Perhaps you can remove the unnecessary this here?
| this.type = type; | ||
| } | ||
|
|
||
| public Task markDone() { |
There was a problem hiding this comment.
Should this method be named differently because markDone does not really tell us that a task will be returned?
|
|
||
|
|
||
| public TaskList() { | ||
| this.tasks = new ArrayList<>(); |
cnlinh
left a comment
There was a problem hiding this comment.
Overall clear and well-formatted code but some parts can be further abstracted for clarity.
src/main/java/duke/Duke.java
Outdated
| import java.util.Scanner; | ||
|
|
||
| public class Duke { | ||
| private boolean exit = false; |
src/main/java/duke/Duke.java
Outdated
| } | ||
|
|
||
| public static void main(String[] args) throws IOException { | ||
| new Duke("data/tasks.txt").run(); |
There was a problem hiding this comment.
Hi my understanding was that this already is a relative path.
What do you mean by use a "relative path"? could you suggest how this is done? Thank you.
src/main/java/duke/Duke.java
Outdated
| break; | ||
|
|
||
| case ADD: | ||
| Task toAdd; |
There was a problem hiding this comment.
You may want to abstract each case into a separate method
|
|
||
| public class Parser { | ||
| public static Task parseFromData(String dataInput) { | ||
| String[] splitInput = dataInput.split("\\|", -1); |
| /** | ||
| * Constructor for DukeException for incomprehensible request. | ||
| */ | ||
| public DukeIDKException() { |
…ePossible method in Duke. (easy way out). Change ADD to TODO/DEADLINE/EVENT in Queries.
Add TaskHandler absrtact class.
Improve CodeQuality
# Conflicts: # src/main/java/duke/handler/DeadlineHandler.java # src/main/java/duke/handler/EventHandler.java # src/main/java/duke/handler/TodoHandler.java
Add assert to getTask method
Format requires Schedule weekly (no.of times) (schedulable event). Issue: listing does not work beyond 7 tasks when queried as after 1st query.
Add Ui.png screenshot
Change app name to remove space
No description provided.