-
Notifications
You must be signed in to change notification settings - Fork 482
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
QianChangru
committed
Sep 16, 2023
1 parent
ed26f34
commit a146f5a
Showing
4 changed files
with
68 additions
and
0 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,37 @@ | ||
package duke; | ||
|
||
/** | ||
* Encapsulates FixedDurationTask which are Tasks with a fixed duration. | ||
*/ | ||
public class FixedDurationTask extends Task { | ||
private String duration; | ||
|
||
public FixedDurationTask(String description, String duration) { | ||
super(description); | ||
this.duration = duration; | ||
} | ||
|
||
public FixedDurationTask(String description, boolean isDone, String duration) { | ||
super(description, isDone); | ||
this.duration = duration; | ||
} | ||
|
||
/** | ||
* Returns a String representation for FixedDurationTask for output. | ||
*/ | ||
@Override | ||
public String toString() { | ||
return "[F]" + super.toString() + " (for: " | ||
+ this.duration + ")"; | ||
} | ||
|
||
/** | ||
* Returns a String representation of FixedDurationTask for storage. | ||
*/ | ||
@Override | ||
public String toTxt() { | ||
return "F | " + super.toTxt() | ||
+ " | " + this.duration; | ||
} | ||
|
||
} |
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
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 |
---|---|---|
|
@@ -87,4 +87,5 @@ public String findTask(String keyword) { | |
} | ||
return Ui.listMatchingTasks(result); | ||
} | ||
|
||
} |