-
Notifications
You must be signed in to change notification settings - Fork 228
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
[Wang Yihe] iP #243
base: master
Are you sure you want to change the base?
[Wang Yihe] iP #243
Conversation
[Wang Yihe] iP |
src/main/java/duke/TaskList.java
Outdated
throw new DukeException("Missing component: due date"); | ||
} | ||
String time = deadlineArr[1]; | ||
if (isDateFormat(time, "yyyy-mm-dd") || isDateFormat(time, "yyyy-m-dd") || isDateFormat(time, "yyyy-mm-d") || isDateFormat(time, "yyyy-m-d")) { |
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.
Perhaps might want to add more spaces in front to indent this method to fit with the Java coding convention.
src/main/java/duke/Ui.java
Outdated
|
||
package duke.ui; | ||
|
||
import duke.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.
It might be a better idea to import relevant files from the task folder instead of importing all?
src/main/java/duke/Ui.java
Outdated
printLine(); | ||
printMessage("Here are the matching tasks in your list"); | ||
for (int i = 0; i < task.size(); i++) { | ||
int index = i + 1; |
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 remember to add spaces around i + 1;
src/main/java/duke/Ui.java
Outdated
String[] input = temp.split(" ", 2); | ||
Command command = getUserInputType(input[0]); | ||
switch (command) { | ||
case 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.
"The explicit //Fallthrough comment should be included whenever there is a case statement without a break statement.", quoted from Java coding convection.
src/main/java/duke/FileSaver.java
Outdated
|
||
import duke.ui.Ui; | ||
import duke.exception.DukeException; | ||
import duke.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.
Although all the three classes in task package are used, perhaps listing them out explicitly will comply with the coding standard better? 🤔
src/main/java/duke/TaskList.java
Outdated
|
||
public void add(String[] userInput, Ui ui) throws DukeException { | ||
switch (userInput[0]) { | ||
case "todo": |
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.
According to our coding standard, perhaps there should not be spaces before each "case"? 🤔
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 work! LGTM except for some naming issues.
src/main/java/duke/Deadline.java
Outdated
} | ||
|
||
@Override | ||
public String savedFormat() { |
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.
Perhaps the naming here could be even more straightforward? e.g. formatInFile.
src/main/java/duke/FileSaver.java
Outdated
task.add(t); | ||
} | ||
|
||
public static boolean isDateFormat(String date) { |
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 naming for method!
src/main/java/duke/FileSaver.java
Outdated
return true; | ||
} | ||
|
||
public void parseTask(TaskList task, String info) throws IndexOutOfBoundsException{ |
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.
If it is a "TaskList", perhaps can rename the variable name to "tasks"? 🤔 (same applies to the rest methods)
src/main/java/duke/Task.java
Outdated
return "[ ] " + this.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.
Perhaps more Javadoc comments could be included? 🤔
User Guide 📣
No description provided.