Class ToDo


public class ToDo extends Task
Represents a simple task with no specific date or time constraints.

This class extends the Task class and provides functionality specific to ToDo tasks.

  • Constructor Details

    • ToDo

      public ToDo(String name)
      Constructs a ToDo task with a given name or description.
      Parameters:
      name - the name or description of the task; must not be null.
    • ToDo

      public ToDo(String name, boolean done)
      Constructs a ToDo task with a given name and completion status.
      Parameters:
      name - the name or description of the task; must not be null.
      done - a boolean indicating whether the task is completed (true) or not (false).
  • Method Details

    • toFileFormat

      public String toFileFormat()
      Converts the ToDo task to a file-friendly format.

      The format is: T | <isDone> | <description>.

      Specified by:
      toFileFormat in class Task
      Returns:
      a string representation of the ToDo task in a format suitable for saving to a file.
    • getDetails

      public String getDetails()
      Returns the details of the ToDo task.

      Since ToDo tasks have no additional details, this method returns an empty string.

      Specified by:
      getDetails in class Task
      Returns:
      an empty string.