-
Notifications
You must be signed in to change notification settings - Fork 193
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
[Anderson Leong] iP #206
base: master
Are you sure you want to change the base?
[Anderson Leong] iP #206
Conversation
Added Greet, Echo, and Exit
Switched all Arrays to ArrayList
# Conflicts: # src/main/java/duke/Duke.java
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, good effort in the checks for the input. However, do make sure not to put too much code into one line!
src/main/java/duke/Duke.java
Outdated
return userInput; | ||
} | ||
|
||
public static String GetItem(String userInput) throws IllegalToDoException, InvalidCommandException, EmptyCommand { |
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.
Follow camelCase naming convention for methods
|
||
public class Event extends Task { | ||
|
||
protected String at; |
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.
Private may be a better access modifier since no class extends Event.
|
||
public class Event extends Task { | ||
|
||
protected String at; |
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.
naming for at
could be more descriptive of what it represents
src/main/java/duke/Duke.java
Outdated
private static void AcknowledgeAddition(String command, ArrayList<Task> unfilteredTasks) { | ||
if (isToDo(command) || isDeadline(command) || isEvent(command)) { | ||
System.out.println(LINE + "Got it. I've added this task:\t"); | ||
System.out.println(String.format("\t%d.", unfilteredTasks.size()) + unfilteredTasks.get(unfilteredTasks.size() - 1) + "\n" + String.format("\tNow you have %d tasks in the list.\n", unfilteredTasks.size()) + 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.
Too many characters on this line! Occurred on other lines in this code
src/main/java/duke/Duke.java
Outdated
unfilteredTasks = loadFile(FILE_PATH, unfilteredTasks); | ||
} catch (FileNotFoundException e) { | ||
File dukeCheckpoint = new File(FILE_PATH); | ||
try { |
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.
Instead of nesting try-catch block, try to include then in the same level.
try {
...
} catch (FileNotFoundException e) {
...
} catch (FileNotFoundException e){
...
}
src/main/java/duke/Duke.java
Outdated
+ "What do you need to do?\n" | ||
+ LINE; | ||
|
||
public static String getCommand(String userInput) { |
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 are some methods private and some public? Seems to me that they are all only used in this class
Added optional for user: DateTime Format
Added Find function
Added JavaDoc
No description provided.