Skip to content
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

[Jacob-109] iP #234

Open
wants to merge 35 commits into
base: master
Choose a base branch
from
Open
Changes from 2 commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
271e2f4
Level 1.Greet,Echo,Exit
Jacob-109 Jan 21, 2021
9522d74
Level 2.Add,List
Jacob-109 Jan 21, 2021
082e99c
Level 3.Mark as Done
Jacob-109 Jan 21, 2021
56d2f18
Level 4. ToDos, Events, Deadlines
Jacob-109 Jan 21, 2021
5b6adf0
Level 4. ToDos, Events, Deadlines
Jacob-109 Jan 21, 2021
0e6d2c7
Revert "Level 4. ToDos, Events, Deadlines"
Jacob-109 Jan 21, 2021
b4d0ca6
Revert "Revert "Level 4. ToDos, Events, Deadlines""
Jacob-109 Jan 21, 2021
91ba5b7
Level4.ToDos, Events, Deadlines
Jacob-109 Jan 21, 2021
28f54b8
Level4.ToDos, Events, Deadlines
Jacob-109 Jan 21, 2021
44c3b6d
Level5.Handle Errors
Jacob-109 Jan 21, 2021
81367c5
Level6.Delete
Jacob-109 Jan 21, 2021
7e03915
A-TextUiTesting
Jacob-109 Jan 21, 2021
3166da9
Level-7
Jacob-109 Feb 9, 2021
436656a
Level-8
Jacob-109 Feb 10, 2021
5a03f8f
Merged branch 'branch-Level-7'
Jacob-109 Feb 10, 2021
5220f22
Merged Branch-level-8 into master branch
Jacob-109 Feb 15, 2021
14de94b
Fixed bug that caused Task to not be load properly
Jacob-109 Feb 15, 2021
0305fd6
add oop
Jacob-109 Feb 21, 2021
9d38c53
add JUnit test for Deadline and TaskList
Jacob-109 Feb 21, 2021
76fb6d6
add Level-9.Find command
Jacob-109 Feb 23, 2021
9337ccb
add JavaDocs
Jacob-109 Feb 23, 2021
7301499
add CodingStandard
Jacob-109 Feb 23, 2021
d7889df
add A-Gradle and Assertions
Jacob-109 Feb 24, 2021
bf4797e
add A-CodeQuality
Jacob-109 Feb 24, 2021
05a3f62
added C-Tagging for ToDo
Jacob-109 Feb 24, 2021
c2d76ad
added Assertions
Jacob-109 Feb 28, 2021
7d82d76
Added GUI
Jacob-109 Feb 28, 2021
04b7f4d
Added UserGuide
Jacob-109 Feb 28, 2021
f8c8bea
Fixed bugs in Gradle and Duke
Jacob-109 Feb 28, 2021
876e9ec
Fixed Bugs and Checkstyle
Jacob-109 Mar 4, 2021
08f29a1
Added Ui.png
Jacob-109 Mar 4, 2021
a82c13b
Modifications to Project to Structure
Jacob-109 Mar 21, 2021
6cbdfba
Modifications to Class Files and GUI
Jacob-109 Mar 21, 2021
4211cd9
Updated MANIFEST and README
Jacob-109 Mar 21, 2021
afe7462
Cleaned up .class files and fixed Parser.java
Jacob-109 Mar 28, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified src/main/java/Deadline.class
Binary file not shown.
15 changes: 9 additions & 6 deletions src/main/java/Deadline.java
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
public class Deadline extends Task {
Copy link

Choose a reason for hiding this comment

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

Should the class be added or grouped inside a package? This applies to other classes as well.


protected String by;
protected LocalDate date;

public Deadline(String description, String by) {
public Deadline(String description, LocalDate date) {
super(description);
this.by = by;
this.date = date;
}

public String getBy() {
return this.by;
public LocalDate getBy() {
return this.date;
}

@Override
public String toString() {
return "[D]" + super.toString() + " (by: " + by + ")";
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("MMM dd yyyy");
return "[D]" + super.toString() + " (by: " + date.format(formatter) + ")";
}
}
16 changes: 9 additions & 7 deletions src/main/java/Duke.java
Original file line number Diff line number Diff line change
@@ -3,10 +3,8 @@
import java.io.IOException;
import java.io.File;
import java.io.FileWriter;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.nio.file.Files;

import java.time.LocalDate;
import java.time.format.DateTimeFormatter;


public class Duke {
Copy link

Choose a reason for hiding this comment

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

Will it be better to add javadoc to all public classes and methods? The same applies to all other public classes and methods.

@@ -34,7 +32,8 @@ private static void loadTasks(ArrayList<Task> list, File f) throws IOException {
String[] strArray = s.split("\\|", 4);

if (strArray[0].trim().equals("D")) {
Deadline deadline = new Deadline(strArray[2].trim(), strArray[3].trim());
LocalDate date =LocalDate.parse(strArray[3].trim(), DateTimeFormatter.ofPattern("yyyy-MM-dd"));
Deadline deadline = new Deadline(strArray[2].trim(), date);
if (strArray[1].trim().equals("done")) {
deadline.isDone = true;
} else if (strArray[1].trim().equals("not done")){
@@ -61,6 +60,8 @@ private static void loadTasks(ArrayList<Task> list, File f) throws IOException {
}
}



public static void main(String[] args) throws DukeException{
Copy link

Choose a reason for hiding this comment

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

You should catch the DukeException, if not your program would stop running due to the exception.

File file = new File("data/DukeData.txt");
File dir = new File("data/");
@@ -131,9 +132,10 @@ public static void main(String[] args) throws DukeException{
System.out.println("Got it. I've added this task: ");
System.out.println(e.toString());
} else if (word.contains("deadline")) {
String[] input = word.split("/by");
String[] input = word.split("/by ");
input[0] = input[0].replaceAll("deadline", "");
Deadline d = new Deadline(input[0], input[1]);
LocalDate date =LocalDate.parse(input[1], DateTimeFormatter.ofPattern("yyyy-MM-dd"));
Deadline d = new Deadline(input[0], date);
list.add(d);
System.out.println("Got it. I've added this task: ");
System.out.println(d.toString());