Skip to content

[Wei Xue] iP#262

Open
weixue123 wants to merge 65 commits into
nus-cs2103-AY2021S2:masterfrom
weixue123:master
Open

[Wei Xue] iP#262
weixue123 wants to merge 65 commits into
nus-cs2103-AY2021S2:masterfrom
weixue123:master

Conversation

@weixue123
Copy link
Copy Markdown

No description provided.

weixue123 and others added 5 commits February 5, 2021 18:34
Copy link
Copy Markdown

@BenedictBCJJ BenedictBCJJ left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall I think the project is very well segmented and can easily expand in scope in the coming weeks. Good job.

@@ -0,0 +1,8 @@
package CustomExceptions;

public class DateTimeFormatNotRecognizedException extends Exception {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not so sure for exceptions but class names should be nouns according to the coding standard.
Maybe DateTimeFormatException is better since it already implies that it is invalid/not recognised.

Comment thread src/main/java/Parser.java Outdated
Comment on lines +13 to +14
private static final ArrayList<String> validActions
= new ArrayList<>(Arrays.asList("todo", "deadline", "event", "done", "delete", "list", "bye"));
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this is a constant, it should follow the coding standard of all uppercase and using underscore to separate words.

Comment thread src/main/java/Parser.java Outdated
return "";
}

public boolean inputsAreValid() {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of naming inputsAreValid, areInputsValid seem more inline for a boolean return value method.

Comment thread src/main/java/Tasks/Event.java Outdated
import java.time.format.DateTimeFormatter;

public class Event extends Task {
private final LocalDateTime at;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think 'at' is too short a name for a variable that has a rather large scope, should Event class become bigger in the future it might cause confusion in the future.
Since it might mean time or location.

Copy link
Copy Markdown

@spzj spzj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall, good job Wei Xue! Rmb to include javadocs too.

Comment thread data/tasks.txt Outdated
@@ -0,0 +1,4 @@
T | 1 | CS2107 Revision |
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi Wei Xue! You can try to delete the output lines before committing, just in case it affects with testing.

Comment thread src/main/java/Parser.java Outdated
@@ -0,0 +1,152 @@
import CustomExceptions.*;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps you can list out the exceptions that you will be using in this file.

Comment thread src/main/java/Ui.java Outdated
LocalDateTime at = parser.getAt();

switch (action) {
case "bye":
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

According to the modules' coding standards, case and default should be at the same indentation as the switch statement.

Copy link
Copy Markdown

@nicoleang09 nicoleang09 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your code quality is good and I could barely find any violations. I like how you broke bigger functions up into smaller ones and made your code easy to understand. Good job!

newTask = new ToDo(description);
} else if (taskType.equals("D")) {
newTask = new Deadline(description, dateTime);
} else {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe instead of using the else block to handle the case of an Event task, it can be used to handle invalid task types?

} else if (task instanceof Event) {
taskType = "E";
dateTimeString = ((Event) task).getAtDateTimeString();
} else {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should the block to handle to do tasks be stated explicitly in an else-if block instead?

return remainingTokens.split("/by")[0].trim();
} else if (action.equals("EVENT") && remainingTokens.contains("/at")) {
return remainingTokens.split("/at")[0].trim();
} else {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comment as before.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants