-
Notifications
You must be signed in to change notification settings - Fork 437
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
[Goh Ee Liang] iP #197
base: master
Are you sure you want to change the base?
[Goh Ee Liang] iP #197
Conversation
FileManager class ensures that directory and text file exists. It reads and updates the text file.
… branch-A-Gradle
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.
Thank you both for the reviews! Will continue to improve my codes. Yall can follow me back on GitHub!
src/main/java/Gel.java
Outdated
* | ||
* @param filePath takes in the filepath of the storage file. | ||
*/ | ||
public Gel (String filePath) { |
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 constructor should be kept public because in the latest iteration, MainWindow creates a Gel object. But run() on the other hand should be private. Thanks for pointing this out!
src/main/java/gel/Parser.java
Outdated
* Ensures that user input of date and time is in the correct format. | ||
* If is in the correct format, translate the string into <code>LocalDateTime</code>. | ||
* | ||
* @param dateTime User's 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.
Yup thanks!
src/main/java/gel/Parser.java
Outdated
* @throws IOException If file could not be updated. | ||
*/ | ||
public static void parseUserInput(Scanner sc, Storage storage, Ui ui, TaskList taskList) throws IOException { | ||
label: |
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.
Yes you are right! I have changed it to loop.
src/main/java/gel/Parser.java
Outdated
String keyword = inputArr[0]; | ||
try { | ||
switch (keyword) { | ||
case "bye": { //bye |
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.
Yea HAHA quite a useless comment indeed.
src/main/java/gel/Storage.java
Outdated
private String directoryPath; | ||
|
||
/** | ||
* Constructor of Storage class. |
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 think you are right. I have referred to the Java APIs and their constructors have descriptive Javadoc.
src/main/java/gel/Storage.java
Outdated
public void checkFileExistence() throws IOException { | ||
File dataDir = new File(directoryPath); | ||
if (!dataDir.exists()) { | ||
boolean bool = dataDir.mkdir(); |
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.
Yes, I have changed it to your suggestion. Thanks!
src/main/java/gel/TaskList.java
Outdated
*/ | ||
public class TaskList { | ||
private List<Task> listOfTasks; | ||
private Ui ui; |
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 are right I will modify my code. Thank you for pointing this out!
private List<Task> listOfTasks; | ||
private Ui ui; | ||
|
||
public TaskList(Ui ui) { |
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.
Yes... I did not have the time to write them all, will do it soon!
src/main/java/gel/Ui.java
Outdated
System.out.println(" Hello! I'm Gel\n What do you want from me?\n"); | ||
} | ||
|
||
public void farewellMessage() { |
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.
Yes, thank you!
src/test/java/gel/ParserTest.java
Outdated
assertEquals("\n" + | ||
" Your time has an invalid format... please use" |
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.
Yup! thanks!
Use Assertions
# Conflicts: # data/tasks.txt
# Conflicts: # data/tasks.txt
Improve code quality
No description provided.