Class Event

java.lang.Object
amadeus.workspace.Task
amadeus.workspace.Event

public class Event extends Task
Represents a scheduled event task with a start and end time.

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

  • Field Details

    • from

      protected Object from
      The start date/time of the event.
    • to

      protected Object to
      The end date/time of the event.
  • Constructor Details

    • Event

      public Event(String name, Object from, Object to)
      Constructs an Event task with a name, start time, and end time.
      Parameters:
      name - the name or description of the event; must not be null.
      from - the start date/time of the event; must not be null.
      to - the end date/time of the event; must not be null.
    • Event

      public Event(String name, boolean done, Object from, Object to)
      Constructs an Event task with a name, completion status, start time, and end time.
      Parameters:
      name - the name or description of the event; must not be null.
      done - a boolean indicating whether the task is completed (true) or not (false).
      from - the start date/time of the event; must not be null.
      to - the end date/time of the event; must not be null.
  • Method Details

    • getFrom

      public Object getFrom()
      Returns the start date/time of the event.
      Returns:
      The start date/time of the event.
    • getDetails

      public String getDetails()
      Returns the details of the Event task, including the start and end times.
      Specified by:
      getDetails in class Task
      Returns:
      the details of the event as a formatted string.
    • toString

      public String toString()
      Returns a string representation of the Event, including its name, start time, and end time.
      Overrides:
      toString in class Task
      Returns:
      a formatted string representing the event details.
    • toFileFormat

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

      The format is: E | <isDone> | <description> | <from> | <to>.

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