Package amadeus.workspace
Class Deadline
java.lang.Object
amadeus.workspace.Task
amadeus.workspace.Deadline
Represents a task with a specific deadline.
This class extends the Task class and provides functionality specific to deadline tasks.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetBy()Returns the due date/time of the deadline task.Returns the details of theDeadlinetask, including the due date/time.Converts theDeadlinetask to a file-friendly format.toString()Returns a string representation of theDeadline, including its name and due date/time.Methods inherited from class amadeus.workspace.Task
getDone, getName, printTask, updateDone
-
Field Details
-
by
The due date/time of the deadline task.
-
-
Constructor Details
-
Deadline
Constructs aDeadlinetask with a name and due date/time.- Parameters:
name- the name or description of the task; must not benull.by- the deadline by which the task must be completed; must not benull.
-
Deadline
Constructs aDeadlinetask with a name, completion status, and due date/time.- Parameters:
name- the name or description of the task; must not benull.done- a boolean indicating whether the task is completed (true) or not (false).by- the deadline by which the task must be completed; must not benull.
-
-
Method Details
-
getBy
Returns the due date/time of the deadline task.- Returns:
- The due date/time of the deadline task.
-
getDetails
Returns the details of theDeadlinetask, including the due date/time.- Specified by:
getDetailsin classTask- Returns:
- the details of the deadline as a formatted string.
-
toString
Returns a string representation of theDeadline, including its name and due date/time. -
toFileFormat
Converts theDeadlinetask to a file-friendly format.The format is:
D | <isDone> | <description> | <by>.- Specified by:
toFileFormatin classTask- Returns:
- a string representation of the
Deadlinetask in a format suitable for saving to a file.
-