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

[wingho]IP #196

Open
wants to merge 90 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
90 commits
Select commit Hold shift + click to select a range
cfa100b
Change the dukes speech
Sep 1, 2021
58398a4
Add a echo functions that repeat commands entered by the user and exi…
Sep 1, 2021
7b1d074
Add the ability to store text input into a list and display it back w…
Sep 1, 2021
1d74b39
Add the ability to mark task as done
Sep 1, 2021
eed209d
Add catergory to the task, todo,deadlines and events
Sep 2, 2021
f4fecb4
Refactor the code to remove duplcated functions
Sep 4, 2021
b8ad62d
Added the ability to add mutiple task in the same line and the abilit…
Sep 5, 2021
37abf0d
Added a way to print words like what was printed for duke but based o…
Sep 5, 2021
1e6963b
Added testing
Sep 6, 2021
2f491b7
Add a lot of exceptions to prevent any errors
Sep 6, 2021
4a08901
Changing some Strings
Sep 6, 2021
50ed25d
Further fixes to the String printed
Sep 6, 2021
64b7752
Merge branch 'branch-Level-5'
Sep 7, 2021
2305316
Minimal packaging
Sep 7, 2021
57771c8
More packages
Sep 7, 2021
a9d7713
Fix packages
Sep 7, 2021
1a2a6ac
Merge branch 'branch-A-Packages'
Sep 7, 2021
c383114
Add a delete function to class ListManager and class inputhandler whe…
Sep 15, 2021
5ee47d4
Some formatting words changes
Sep 15, 2021
6ee2be3
Add the save function to txt files
Sep 15, 2021
f714fce
Merge branch 'branch-Level-7'
Sep 15, 2021
ec11a9f
remove some bugged files
Sep 15, 2021
6d21d77
debugging the file update when there is no task in the array
Sep 15, 2021
8565495
Change all the commands into their own class
Sep 25, 2021
80e1c4e
Added a find date command that find task with a specific date
Sep 26, 2021
71fb4c5
Added Find Keyword to search the list
Sep 27, 2021
cf3394a
Merge pull request #1 from kum-wh/branch-Level-8
kum-wh Sep 28, 2021
3f53d4e
Merge pull request #2 from kum-wh/branch-Level-9
kum-wh Sep 28, 2021
30a5c96
Added Comment to All function and classes
Sep 28, 2021
1f8f273
Merge branch 'master' of https://github.com/kum-wh/ip
Sep 28, 2021
4fb78e6
Merge pull request #3 from kum-wh/branch-A-JavaDoc
kum-wh Sep 28, 2021
05c358f
Merge branch 'branch-A-JavaDoc'
Sep 28, 2021
9a88e1b
Level-8
Sep 28, 2021
668659b
Level-9
Sep 28, 2021
8c59d4d
JavaDoc
Sep 28, 2021
9060af4
no message
Sep 28, 2021
dc1ab66
Merge branch 'branch-A-JavaDoc'
Sep 28, 2021
2b9947c
Merge commit '668659beb25f93f3be1f67d4b3ea7b0d964ae7b9'
Sep 28, 2021
6ca401f
Merge commit '9a88e1b9b936bff54c9ed02dbd7763db87c9cd6b'
Sep 28, 2021
27f1319
Merge branch 'master' of https://github.com/kum-wh/ip
Sep 28, 2021
1c84ea0
Levvel-7 fix
Sep 28, 2021
899cb14
Merge branch 'branch-Level-7'
Sep 28, 2021
1915741
Level-8-fix
Sep 28, 2021
2bb73dd
Level9 fix
Sep 28, 2021
88be32e
A-JavaDoc
Sep 28, 2021
6ffc9fd
Merge pull request #4 from kum-wh/branch-Level-8
kum-wh Sep 28, 2021
fd4bc0a
Merge branch 'master' into branch-Level-9
kum-wh Sep 28, 2021
125df38
Merge pull request #5 from kum-wh/branch-Level-9
kum-wh Sep 28, 2021
2ecd0a6
Merge branch 'master' into branch-A-JavaDoc
kum-wh Sep 28, 2021
d22def0
Merge pull request #6 from kum-wh/branch-A-JavaDoc
kum-wh Sep 28, 2021
5d5f795
Merge branch 'master' of https://github.com/kum-wh/ip
Sep 28, 2021
1bbc6f5
Level8
Sep 28, 2021
7022461
Level9
Sep 28, 2021
78d2e29
JavaDoc
Sep 28, 2021
15cfa13
Branch level8
Sep 28, 2021
b349f2e
Branch Level9
Sep 28, 2021
6a5eff9
A-JavaDoc
Sep 28, 2021
0303cbe
Merge pull request #7 from kum-wh/branch-Level-8
kum-wh Sep 28, 2021
52b947b
Merge branch 'master' into branch-Level-9
kum-wh Sep 28, 2021
b097c6f
Merge pull request #8 from kum-wh/branch-Level-9
kum-wh Sep 28, 2021
025d7c0
Merge branch 'master' into branch-A-JavaDoc
kum-wh Sep 28, 2021
c922374
Merge pull request #9 from kum-wh/branch-A-JavaDoc
kum-wh Sep 28, 2021
ecceb76
Level:8
Sep 28, 2021
8e59389
Level:9
Sep 28, 2021
887ddf1
A-JavaDoc
Sep 28, 2021
b184fca
Merge pull request #10 from kum-wh/branch-Level-8
kum-wh Sep 28, 2021
2989450
Merge branch 'branch-A-JavaDoc'
Sep 28, 2021
d07b2aa
Solving merge conflict
Sep 28, 2021
bd7aca4
Merge branch 'branch-Level-9'
Sep 28, 2021
f3317e1
Merging PRS
Sep 28, 2021
264344e
Fix Exception Messages and add more comments to functions
Sep 29, 2021
21ea138
Fix a bug that invalid date keep throwing parsing error
Sep 29, 2021
19b892c
Update README.md
kum-wh Sep 29, 2021
8e97fa8
Set theme jekyll-theme-cayman
kum-wh Sep 29, 2021
41d7353
Update README.md
kum-wh Sep 29, 2021
5d3bffc
Create README.md
kum-wh Sep 29, 2021
4339745
Update README.md
kum-wh Sep 29, 2021
7576a85
Update README.md
kum-wh Sep 29, 2021
3f424fc
Update README.md
kum-wh Sep 29, 2021
5cbdada
Update README.md
kum-wh Sep 30, 2021
0ec1b61
Update README.md
kum-wh Sep 30, 2021
28c7be4
Update README.md
kum-wh Sep 30, 2021
e4d14a7
Update README.md
kum-wh Sep 30, 2021
4054b00
Update README.md
kum-wh Sep 30, 2021
bc4554c
Update README.md
kum-wh Sep 30, 2021
1816abe
Update README.md
kum-wh Sep 30, 2021
e29bcf7
Update README.md
kum-wh Sep 30, 2021
cee51f8
Update README.md
kum-wh Sep 30, 2021
bba48ca
Fix ArtBot null pointer
Sep 30, 2021
f2c2a13
Merge branch 'master' of https://github.com/kum-wh/ip
Sep 30, 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
10 changes: 10 additions & 0 deletions src/main/java/Deadline.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
public class Deadline extends Task{
protected String by;
public Deadline(String description, String by){
super(description);
this.by = by;
}
public String toString(){
Copy link

Choose a reason for hiding this comment

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

I think we need to have a blank line in between variables declared and method, as well as between two methods.

return "[D]" + super.toString() + "by: " + by + ")";
Copy link

Choose a reason for hiding this comment

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

It might be more readable if you add the @OverRide before overriding toString() method.

}
Copy link

Choose a reason for hiding this comment

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

It is better to follow the coding standard where there is a space between the class name and the {. The same goes for methods.

}
31 changes: 24 additions & 7 deletions src/main/java/Duke.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,19 +26,36 @@ public static void main(String[] args) {
break;
}else if(echoLower.equals("list")) {
for(int i = 0; i < listIndex; i ++){
System.out.println((i + 1) + ". ["+ list[i].getStatusIcon() + "] " + list[i].getDescription());
System.out.println((i + 1) + ". " + list[i].toString());
}
}else if(echoLower.equals("done")) {
Copy link

Choose a reason for hiding this comment

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

Just a very small issue of coding standard. Based on Checkstyle, there should be a space before else and after if here.

Suggested change
}else if(echoLower.equals("done")) {
} else if (echoLower.equals("done")) {

Copy link

Choose a reason for hiding this comment

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

Please leave spaces for the if-else blocks, abiding by the coding standard.

int taskDone = Integer.parseInt(in.nextLine());
list[taskDone-1].markAsDone();
for(int i = 0; i < listIndex; i ++){
System.out.println((i + 1) + ". ["+ list[i].getStatusIcon() + "] " + list[i].getDescription());
list[taskDone - 1].markAsDone();
for (int i = 0; i < listIndex; i++) {
System.out.println((i + 1) + ". " + list[i].toString());
}
}else {
Task t = new Task(echoLower);
}else if(echoLower.startsWith("event")){

Choose a reason for hiding this comment

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

Just a small issue, I think there should be spaces before "{" and after "}"

int startOfTime = echoLower.indexOf("/");
String description = echoLower.substring(6,startOfTime);
Copy link

Choose a reason for hiding this comment

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

it is better to avoid magic number, e.g., 6

Choose a reason for hiding this comment

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

it is better to avoid magic numbers, e.g., 6

String time = echoLower.substring(startOfTime + 1);
Task t = new Event(description, time);
list[listIndex] = t;
listIndex += 1;
System.out.println("Got it. I've added this task: " + System.lineSeparator() + t.toString() + System.lineSeparator() + "Now you have " + listIndex+" tasks in the list.");

Choose a reason for hiding this comment

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

I think there are more than 120 characters in this line, maybe you could split it into 2 lines?

Copy link

Choose a reason for hiding this comment

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

Agree

}else if (echoLower.startsWith("todo")){
String description = echoLower.substring(5);
Task t = new Todo(description);
list[listIndex] = t;
listIndex += 1;
System.out.println("Got it. I've added this task: " + System.lineSeparator() + t.toString() + System.lineSeparator() + "Now you have " + listIndex +" tasks in the list.");

Choose a reason for hiding this comment

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

I think there are more than 120 characters in this line, maybe you could split it into 2 lines?

}else if(echoLower.startsWith("deadline")){
int startOfDeadline = echoLower.indexOf("/");
String description = echoLower.substring(9,startOfDeadline);
String deadline = echoLower.substring(startOfDeadline + 1);
Task t = new Deadline(description, deadline);
list[listIndex] = t;
listIndex += 1;
System.out.println("____________________________________________________________\n" + "added: " + echo + System.lineSeparator() + "____________________________________________________________");
System.out.println("Got it. I've added this task: " + System.lineSeparator() + t.toString() + System.lineSeparator() + "Now you have " + listIndex +" tasks in the list.");

Choose a reason for hiding this comment

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

I think there are more than 120 characters in this line, maybe you could split it into 2 lines?

}
}
}
Expand Down
10 changes: 10 additions & 0 deletions src/main/java/Event.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
public class Event extends Task{
protected String time;
Copy link

Choose a reason for hiding this comment

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

It is better to make it a private string to ensure data hiding in encapsulation.

public Event(String description, String time){
super(description);
this.time = time;
}
public String toString(){
return "[E]" + super.toString() + "(at:" + time + ")";
}
}
3 changes: 3 additions & 0 deletions src/main/java/Task.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,7 @@ public String getDescription(){
public String getStatusIcon(){
return(isDone?"X":" ");

Choose a reason for hiding this comment

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

Maybe you could consider using the full if statement.

Copy link

Choose a reason for hiding this comment

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

Suggested change
return(isDone?"X":" ");
return(isDone ? "X" : " ");

Copy link

Choose a reason for hiding this comment

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

Please follow the coding standard in leaving spaces.

}
public String toString(){
return "[" + getStatusIcon() + "]" + description;
}
}
11 changes: 11 additions & 0 deletions src/main/java/Todo.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
public class Todo extends Task{

public Todo(String description){
super(description);
}

@Override
public String toString() {
return "[T]" + super.toString();
}
}