-
Notifications
You must be signed in to change notification settings - Fork 364
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
[yyj-02] iP #17
base: master
Are you sure you want to change the base?
[yyj-02] iP #17
Conversation
β¦n abstract task class
β¦format to be passed in
|
||
import storage.TaskList; | ||
|
||
public abstract class Command { |
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 like how you separated the code with an abstract class Command
π
src/main/java/command/OnCommand.java
Outdated
public String run(TaskList taskList) { | ||
ArrayList<Task> taskOnQueryDate = new ArrayList<>(taskList.indexTask().stream().filter(task -> | ||
(task instanceof Deadline && ((Deadline) task).daysToDeadline(this.queryDate) == 0) || | ||
(task instanceof Event && ((Event) task).daysToEvent(this.queryDate) == 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.
I like how you indented the lines here
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.
Overall a well-thought IP, I can see that you have structured the classes very well and inside packages. Good use of Java OOP and the language itself, maybe you can add some JavaDoc comments, otherwise looks good to me.
try { | ||
String taskDescription = taskList.showTask(this.index).toString(); | ||
taskList.deleteTask(this.index); | ||
return "Noted. I've removed this task:\n " + taskDescription + "\nNow you have " + taskList.countTask() |
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 like how you abstract commands under the abstract class .Seeing how each run statement return a string , maybe store that string in each command and make a output method , this was you abstract all you're outputs there and in the future if you;re output message changes you would not have to change the code .
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.
Yeah considered that too and it would be easier for testing as well.
*/ | ||
public Command parse() throws UnknownCommandException, MissingArgumentException, InvalidArgumentException { | ||
preprocess(); | ||
switch (this.requestType) { |
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 like how you used switch-case statements here
@@ -0,0 +1,125 @@ | |||
package storage; | |||
|
|||
import java.time.LocalDate; |
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.
Import statements could be more clearer, The ordering of import statements must be consistent. as stated in the coding guidelines. So maybe organise them by putting spaces between them .
import task.Deadline; | ||
import task.Task; | ||
|
||
public class DeadlineCommandTest { |
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.
test can follow this featureUnderTest_testScenario_expectedBehavior()
according to guideline.
Added assetions where assumptions were made, mainly in the command package: * Mark, Unmark, Delete: assert that index >= 0 * Todo, Deadline, Event: assert that task is not empty
Follow the coding standards more closely. Did the following tasks: * Add missing header comments * Rearrange import statements
Added assertions for: * out of index * empty task
* Rearranged imports * Refactored code
Amend code to follow code quality Follow more SLAP principles and add more comments! π
Duke Ultra Pro Max
Description
Duke Ultra Pro Max is a open source bleeding edge πͺ, blazingly fast β‘, highly interactive π₯, all-in-one π¦ task manager for all your needs.
We are crrently in Beta Mode so Duke Ultra Pro Max is FREE FOR ALL USAGE. We also welcome everyone to contribute!
Feature
todo
|deadline
|event
on
commandfind
commandUsage
duke-v1.0.jar
AT YOUR OWN RISKand let us steal your dataRemember to give us these details:
Developer Guide
If you Java programmer, you can use it to practice Java too. Here's the main method: