Skip to content

Commit 5e7d440

Browse files
committed
Update JavaDoc comments for duke.task package
1 parent 94259dd commit 5e7d440

File tree

4 files changed

+58
-5
lines changed

4 files changed

+58
-5
lines changed

src/main/java/duke/task/Deadline.java

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,22 +73,28 @@ public void printDelete(List<Task> allTasks) {
7373

7474
/**
7575
* Returns that this is a deadline task type.
76+
*
77+
* @return Type of task.
7678
*/
7779
@Override
7880
public String getTaskType() {
7981
return this.taskType;
8082
}
8183

8284
/**
83-
* Get task deadline.
85+
* Gets task deadline.
86+
*
87+
* @return Date and time of deadline.
8488
*/
8589
@Override
8690
public LocalDateTime getDeadline() {
8791
return this.taskDeadline;
8892
}
8993

9094
/**
91-
* Get date of task deadline.
95+
* Gets date of task deadline.
96+
*
97+
* @return Date of deadline.
9298
*/
9399
@Override
94100
public LocalDate getDate() {

src/main/java/duke/task/Event.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,8 @@ public void printDelete(List<Task> allTasks) {
8282

8383
/**
8484
* Returns that this is an event task type.
85+
*
86+
* @return Task type.
8587
*/
8688
@Override
8789
public String getTaskType() {
@@ -90,6 +92,8 @@ public String getTaskType() {
9092

9193
/**
9294
* Get the starting time of event.
95+
*
96+
* @return Date and time of event start time.
9397
*/
9498
@Override
9599
public LocalDateTime getEventStartTime() {
@@ -98,6 +102,8 @@ public LocalDateTime getEventStartTime() {
98102

99103
/**
100104
* Get the ending time of event.
105+
*
106+
* @return Date and time of event end time.
101107
*/
102108
@Override
103109
public LocalDateTime getEventEndTime() {
@@ -106,6 +112,8 @@ public LocalDateTime getEventEndTime() {
106112

107113
/**
108114
* Get the date of event.
115+
*
116+
* @return Date of event.
109117
*/
110118
@Override
111119
public LocalDate getDate() {

src/main/java/duke/task/Task.java

Lines changed: 40 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,20 +55,28 @@ public void printDelete(List<Task> allTasks) {
5555

5656
/**
5757
* Gets task number.
58+
*
59+
* @return Index of task on task list.
5860
*/
5961
public int getTaskNumber() {
6062
return this.taskNumber;
6163
}
6264

6365
/**
64-
* Gets type of task: Todo, Deadline, Event.
66+
* Gets type of task.
67+
* Returns empty string as parent class is not a specific type of
68+
* task.
69+
*
70+
* @return String of task type.
6571
*/
6672
public String getTaskType() {
6773
return "";
6874
}
6975

7076
/**
7177
* Gets whether task is done.
78+
*
79+
* @return String of brackets that fills with X if task is done.
7280
*/
7381
public String getTaskStatus() {
7482
if (!this.taskStatus) {
@@ -80,30 +88,59 @@ public String getTaskStatus() {
8088

8189
/**
8290
* Gets task.
91+
*
92+
* @return Task.
8393
*/
8494
public String getTask() {
8595
return this.task;
8696
}
8797

98+
/**
99+
* Gets deadline.
100+
* Returns null as parent class does not require deadlines.
101+
*
102+
* @return Date and time of deadline.
103+
*/
88104
public LocalDateTime getDeadline() {
89105
return null;
90106
}
91107

108+
/**
109+
* Gets event start time.
110+
* Returns null as parent class does not have a start time.
111+
*
112+
* @return Date and time of event start time.
113+
*/
92114
public LocalDateTime getEventStartTime() {
93115
return null;
94116
}
95117

118+
/**
119+
* Gets event start time.
120+
* Returns null as parent class does not have an end time.
121+
*
122+
* @return Date and time of event end time.
123+
*/
96124
public LocalDateTime getEventEndTime() {
97125
return null;
98126
}
99127

128+
/**
129+
* Gets task date.
130+
* Returns null as parent class does not have a date required.
131+
*
132+
* @return Date of task.
133+
*/
100134
public LocalDate getDate() {
101135
return null;
102136
}
103137

104138
/**
105-
* To override equals such that same type of object can pass Junit
106-
* test.
139+
* Overrides default equal method such that same type of object
140+
* can pass Junit test.
141+
*
142+
* @param o Object to be compared to.
143+
* @return Boolean of whether object has same class.
107144
*/
108145
@Override
109146
public boolean equals(Object o) {

src/main/java/duke/task/Todo.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,8 @@ public void printDelete(List<Task> allTasks) {
6161

6262
/**
6363
* Returns that this is a todo task type.
64+
*
65+
* @return Task type.
6466
*/
6567
@Override
6668
public String getTaskType() {

0 commit comments

Comments
 (0)