-
Notifications
You must be signed in to change notification settings - Fork 315
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
[Kwong Chung Yue Jerry] Duke Increments #354
base: master
Are you sure you want to change the base?
Conversation
Add toolVersion block in to Gradle code sample to prevent errors.
Change file mode on `gradle` to be executable (nus-cs2103-AY1920S1#9)
# Conflicts: # src/main/java/tasks.txt
To add gradle support to the project.
* Prints the list of tasks which has descriptions | ||
* matching that of a target String. | ||
* @param taskList List of matching tasks | ||
*/ | ||
public void showFoundTasks(LinkedList<Task> taskList) { | ||
ListIterator<Task> iter = taskList.listIterator(); | ||
Task current; |
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.
Your code looks pretty clean with the accurate variable naming as well as javadocs comments. Perhaps you could consider making packages to make it more organized? Otherwise it looks good
@FXML | ||
public void initialize() { | ||
scrollPane.vvalueProperty().bind(dialogContainer.heightProperty()); | ||
dialogContainer.getChildren().addAll(DialogBox.getUserDialog(Ui.showWelcome(), dukeImage)); |
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 really like your idea of calling it in initialize, good job!
@@ -94,7 +95,7 @@ public void parseCommand(String input, TaskList taskList) throws DukeException { | |||
|
|||
taskList.addTask(newEvent); | |||
|
|||
ui.showTaskAdded(newEvent, taskList); | |||
return ui.showTaskAdded(newEvent, taskList); | |||
} |
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 OOP and clean code! But reading through this it might be slightly unclear, maybe you can refactor this part to use case and switch statements?
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.
Methods and variables are well named and I appreciate the use of StringBuilder
s! Just have some comments about some parts.
public Event(String description, String eventDate, boolean status) { | ||
super(description); | ||
this.eventDateString = makeEventDate(eventDate); | ||
this.eventDate = storeAsDateTime(eventDateString); |
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 be replaced with this(description, eventDate);
src/main/java/Parser.java
Outdated
return builder.toString(); | ||
} | ||
|
||
public static boolean correctInput(String input) { |
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.
How about isCorrectInput
taskList.addTask(newEvent); | ||
|
||
return ui.showTaskAdded(newEvent, taskList); | ||
} |
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.
Consider splitting into methods or classes. Maybe todo, deadline and event can go into another method parseTask
, and the repeated lines can also be factored out?
src/main/java/Task.java
Outdated
|
||
sb.append(hour + ":" + minutes + ":00"); | ||
|
||
LocalDateTime dateTime = LocalDateTime.parse(sb.toString()); |
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.
How about
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("d/M/yyyy HHmm");
LocalDateTime dateTime = LocalDateTime.parse(date, formatter);
|
||
return output; | ||
} | ||
} |
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 splitting of code into methods!
} | ||
} | ||
|
||
public boolean isExit() { |
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 you include javaDoc here
src/main/java/Ui.java
Outdated
return welcomeMessage; | ||
} | ||
|
||
public String showGoodbye() { |
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 you include javaDoc for this class
} | ||
} | ||
|
||
public String showTaskDone(Task task) { |
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.
The two methods have the same body, maybe you could consider delete one.
* Filler method to imitate an interface. | ||
* @return String empty string | ||
*/ | ||
protected String toFileFormat() { |
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 you abstract this class and method?
} | ||
} | ||
|
||
public String run(String input) { |
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 can probably add JavaDocs 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.
Good morning @jerryk1997 ,
I think that you have good OOP implementation; class responsibilities are clear and non-conflicting, e.g Ui not managing anything else other than I/O interaction. However, I believe you haven't used gradle checkstyle to verify your compliance to coding standard. In addition, I think you could try extracting repeated methods calls to reduce code duplication. You could also improve the parser by simplifying multiple if-case into a switch-case. This should also simplify input verification as non-expected inputs will generally enter into the default case.
There is also a Ui issue.
But all in all. It is good individual effort with taught methodologies.
Keep it up. 👍
no message
Added way for user to specify priorities of tasks
No description provided.