[Wang-Jingwei] iP#102
Conversation
This reverts commit f44a3e6.
This reverts commit 748b623.
* branch-Level-5: Add some error handlings.
This reverts commit 4d255af.
* branch-Level-6: Add the delete functionality.
* branch-Level-7: Add the functionality to load data from the file and save data into the file.
Add the find functionality.
* 'master' of https://github.com/Wang-Jingwei/ip: Add the find functionality.
* master: Add the find functionality.
Branch a java doc
* 'master' of https://github.com/Wang-Jingwei/ip: Add javaDoc.
Mick609
left a comment
There was a problem hiding this comment.
Readable code with some coding standard and naming convention issue.
| public void run() throws IOException { | ||
| String task; | ||
| ui.greetings(); | ||
| Scanner in = new Scanner(System.in); |
There was a problem hiding this comment.
Maybe you should consider a more descriptive name for the Scanner object like "scanner"?
| String task; | ||
| ui.greetings(); | ||
| Scanner in = new Scanner(System.in); | ||
| task=in.nextLine(); |
There was a problem hiding this comment.
Please make sure the spaces between operators are consistent.
| else{ | ||
| try{ | ||
| int index = Integer.parseInt(words[1]); | ||
| if(index>todolist.size()||index<=0) System.out.println("No task found."); |
There was a problem hiding this comment.
Maybe you should consider having the if block in two lines.
| break; | ||
| } | ||
| case "find": { | ||
| if (words.length == 1) ui.incompleteMessage("find"); |
There was a problem hiding this comment.
Maybe you could place the if and else blocks in more than a line.
| */ | ||
|
|
||
| public static void save(String textToAdd,String filePath) throws IOException { | ||
| FileWriter fw = new FileWriter(filePath,false); |
There was a problem hiding this comment.
Maybe you should consider a more descriptive name for the object like fileWriter.
| */ | ||
| public ArrayList<Task> load() throws IOException { | ||
| ArrayList<Task> todolist = new ArrayList<Task>(); | ||
| BufferedReader br = new BufferedReader(new FileReader(this.filePath)); |
There was a problem hiding this comment.
Name like "bufferedReader" would be better in this case.
| * @param deadline Description of the task which will be added as Deadline. | ||
| */ | ||
| public void addDeadline(ArrayList<Task> taskList, String deadline){ | ||
| String[] deadline1 = deadline.split("/by", 2); |
There was a problem hiding this comment.
Maybe you should use the plural form for the name of a String array.
No description provided.