-
Notifications
You must be signed in to change notification settings - Fork 102
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
[Lim Wen Feng] iP #98
base: master
Are you sure you want to change the base?
Conversation
src/main/java/Duke.java
Outdated
tasksCount++; | ||
System.out.println("Added: " + userCommand[0]); | ||
notifyUser(inputDetails, selectedTask); | ||
|
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.
can remove the blank line
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.
Recommended to use sub classes for the events, todo, deadlines
src/main/java/Duke.java
Outdated
public class Duke { | ||
private static final Scanner SCANNER = new Scanner(System.in); |
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.
Why is SCANNER in caps?
src/main/java/Task.java
Outdated
public String getTaskType() { | ||
if (this.taskType.equalsIgnoreCase("todo")) { | ||
return "[T]"; | ||
} else if (this.taskType.equalsIgnoreCase("deadline")) { | ||
return "[D]"; | ||
} else { | ||
return "[E]"; | ||
} |
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.
Use inheritance just like we learnt
src/main/java/Duke.java
Outdated
exitDuke(); | ||
break; | ||
} | ||
if (userCommand.equalsIgnoreCase("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.
Maybe use boolean variables to make this easier to understand
src/main/java/Task.java
Outdated
public void markAsDone() { | ||
this.isDone = true; | ||
} | ||
|
||
public String getTaskType() { |
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.
looks clean!
src/main/java/Duke.java
Outdated
} | ||
else if (isValidInput(userCommand)){ | ||
processUserRequest(userCommand, inputDetails); | ||
} else { |
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.
new line after bracket
src/main/java/Task.java
Outdated
|
||
public Task(String description) { | ||
public Task(String description, String taskType) { |
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.
looks good! easy to understand
src/main/java/Duke.java
Outdated
@@ -80,7 +98,7 @@ private static void listOutTasks() { | |||
while (i < tasksCount) { | |||
Task selectedTask = tasksList[i]; | |||
i++; | |||
System.out.println(i + ". " + selectedTask.getStatusIcon() + " " + selectedTask.description); | |||
System.out.println(i + ". " + selectedTask.getTaskType() + selectedTask.getStatusIcon() + " " + selectedTask.description); | |||
} | |||
} | |||
|
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.
another blank line here
Branch level 6
src/main/java/Duke.java
Outdated
@@ -1,10 +1,239 @@ | |||
import java.io.*; |
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.
You may wish to consider explicitly importing the classes that you wish to use here to increase clarity of what classes are to be maintained here.
src/main/java/Duke.java
Outdated
printLine(); | ||
printLine(); |
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.
It seems you have repeated lines of code here. Consider reviewing what is redundant.
@@ -0,0 +1,13 @@ | |||
package Duke; |
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 in keeping this class simple and easy to read.
src/main/java/Duke/Task.java
Outdated
protected String taskType; | ||
|
||
public Task(String description, String taskType) { | ||
if (taskType.equalsIgnoreCase("event")) { |
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 constructor class seems to be lengthy for the start. You could abstract away some details, while ensuring SLAP.
src/main/java/Duke/Task.java
Outdated
this.isDone = false; | ||
this.taskType = taskType; | ||
} | ||
else if (taskType.equalsIgnoreCase("deadline")) { |
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.
You have several cases here. Instead of multiple else if
, perhaps explicit switch case statements could be, See switch layouts: https://se-education.org/guides/conventions/java/basic.html#layout.
implemented find features
No description provided.