-
Notifications
You must be signed in to change notification settings - Fork 461
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
[Brandon Thio] iP #19
base: master
Are you sure you want to change the base?
Conversation
…, simply echos commands entered by the user, and exits when the user types 'bye'
…y them back to the user when requested.
… change the status back to not done.
…changes. Load the data from the hard disk when Duke starts up.
… dates in a format such as yyyy-mm-dd format (e.g., 2019-10-15) and print in a different format such as MMM dd yyyy e.g., (Oct 15 2019).
# Conflicts: # src/main/java/Deadline.java # src/main/java/Task.java
Ui: deals with interactions with the user Storage: deals with loading tasks from the file and saving tasks in the file Parser: deals with making sense of the user command TaskList: contains the task list e.g., it has operations to add/delete tasks in the list Command classes (i.e., AddCommand, DeleteCommand, ExitCommand etc.) that inherit from an abstract Command class,
# Conflicts: # src/main/java/duke/commands/ListTasksCommand.java
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. 👍 Just some minor fixes to be made.
src/main/java/duke/task/Todo.java
Outdated
@@ -0,0 +1,40 @@ | |||
package duke.task; | |||
import duke.exceptions.*; |
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.
Imported classes should always be listed explicitly.
import duke.exceptions.*; | |
import duke.exceptions.ParsingTaskException; |
public class Task { | ||
private static final String DATA_PATH = new File("").getAbsolutePath() + "/data/duke.txt"; | ||
private String title; | ||
private boolean completed; |
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.
I can tell from your code that the boolean tracks whether the task is completed. Perhaps you should rename it to sound more like a boolean.
private boolean completed; | |
private boolean isCompleted; |
* Deadlines are tasks that need to be done before a specific date/time e.g., submit report by 11/10/2019 5pm | ||
*/ | ||
public class Deadline extends Task { | ||
protected LocalDate by; |
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.
by
seems vague for a variable name. Perhaps you could rename it to make it clearer.
|
||
@Override | ||
public void execute(TaskList taskList, Ui ui, Storage storage) { | ||
List<Task> tasks = taskList.getAll().stream() |
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 use of Java pipelines to find tasks! 👍
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!
public class ExitCommand extends Command { | ||
@Override | ||
public void execute(TaskList taskList, Ui ui, Storage storage) { | ||
ui.showGoodByeMessage(); |
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 descriptive method names
} | ||
|
||
@Override | ||
public void execute(TaskList taskList, 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.
Great use of streams!
public class InvalidDeadlineException extends InvalidCommandException { | ||
public InvalidDeadlineException() { | ||
super("Could not parse deadline. To create a deadline, " | ||
+ "please use the format in this example: " |
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.
nice exception message
|
||
import duke.commands.*; | ||
import duke.enums.Action; | ||
import duke.exceptions.*; |
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 have specified which file to import instead of all maybe?
# Conflicts: # src/main/java/duke/commands/FindCommand.java # src/main/java/duke/commands/ListTasksCommand.java # src/main/java/duke/ui/Ui.java
…ptions that should hold at various points in the code
Replace if-else branching with switch statement for readability
Use assert feature (not JUnit assertions) to document important assumptions
For example, users can now tag a task as "fun" via the command "tag <index> #fun". Current limitation is that the feature does not allow users to add multiple tags at once. For example, it does not allow the command "tag <index> #urgent, #important, #school".
DukePro
DukePro frees your mind of having to remember things you need to do. It's,
All you need to do is,
And it is FREE!
Features:
If you Java programmer, you can use it to practice Java too. Here's the main method: