forked from nus-cs2103-AY2324S1/ip
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Level-4 Added Deadline, event, todo tasks
- Loading branch information
1 parent
ef089b7
commit ed92cb2
Showing
5 changed files
with
135 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
public class Deadline extends Tasks { | ||
private String deadline; | ||
|
||
public Deadline(String name, boolean isMarked, String deadline) { | ||
super(name, isMarked); | ||
this.deadline = deadline; | ||
} | ||
|
||
public String getDeadline() { | ||
return deadline; | ||
} | ||
|
||
public void setDeadline(String deadline) { | ||
this.deadline = deadline; | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
String status = isMarked ? "[X]" : "[ ]"; | ||
return "[D]" + status + " " + name + " (by: " + deadline + ")"; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
public class Event extends Tasks { | ||
private String startTime; | ||
private String endTime; | ||
|
||
public Event(String name, boolean isMarked, String startTime, String endTime) { | ||
super(name, isMarked); | ||
this.startTime = startTime; | ||
this.endTime = endTime; | ||
} | ||
|
||
public String getStartTime() { | ||
return startTime; | ||
} | ||
|
||
public void setStartTime(String startTime) { | ||
this.startTime = startTime; | ||
} | ||
|
||
public String getEndTime() { | ||
return endTime; | ||
} | ||
|
||
public void setEndTime(String endTime) { | ||
this.endTime = endTime; | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
String status = isMarked ? "[X]" : "[ ]"; | ||
return "[E]" + status + " " + name + " (from: " + startTime + " to: " + endTime + ")"; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
public class Todo extends Tasks { | ||
|
||
public Todo(String name, boolean isMarked) { | ||
super(name, isMarked); | ||
} | ||
|
||
|
||
|
||
|
||
@Override | ||
public String toString() { | ||
if (isMarked) { | ||
return "[T][X] " + name; | ||
} else { | ||
return "[T][ ] " + name; | ||
} | ||
} | ||
} | ||
|