Interface Task

  • All Superinterfaces:
    java.lang.Iterable<Task>
    All Known Implementing Classes:
    AbstactTask, AnonymousTask, DirectoryTask, FolderTask, LeafTask

    public interface Task
    extends java.lang.Iterable<Task>

    A task in the task tree.

    A task consists mainly of two parts: the description and the content. In addition to this,for the task tree, the task can have a parent task and child tasks. A task implements Iterable on its children.

    A task has no concrete state since for a task with children the task itself is supposed to be in all the states of the children.

    The content of the task is just a bunch of Strings that can be collected and returned.

    Author:
    alexxismachine (Ulrich David)
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void addChild​(Task task)
      Add a child to the task. (???
      void addContent​(java.lang.String line)
      Add a line to the content collection.
      java.util.Collection<java.lang.String> getContent()
      Get the content collection.
      java.lang.String getDescription()
      Get the tasks description.
      Task getParent()
      Get the praent task.
      short getPriority()
      Get the priority, The lower the number the higher the priority.
      boolean hasChildren()
      Tell if there are children to the task.
      boolean isInState​(TaskState status)
      Tell if the task is in the asked status.
      java.util.List<java.lang.Short> priorities()
      Get the priorities that this task and all the sub tasks are in.
      • Methods inherited from interface java.lang.Iterable

        forEach, iterator, spliterator
    • Method Detail

      • isInState

        boolean isInState​(TaskState status)
        Tell if the task is in the asked status. A task is in a status if itself or one of the children is in that status. If given status is null must return true.
        Parameters:
        status - the task state
        Returns:
        true if the task is in the asked status.
      • addChild

        void addChild​(Task task)
        Add a child to the task. (??? Sets the parent of the added task to this???).
        Parameters:
        task - the task to add.
      • getDescription

        java.lang.String getDescription()
        Get the tasks description.
        Returns:
        the description.
      • hasChildren

        boolean hasChildren()
        Tell if there are children to the task.
        Returns:
        true if there are children.
      • getParent

        Task getParent()
        Get the praent task.
        Returns:
        the parent task. null if there is no parent.
      • addContent

        void addContent​(java.lang.String line)
        Add a line to the content collection.
        Parameters:
        line - the line to add.
      • getContent

        java.util.Collection<java.lang.String> getContent()
        Get the content collection.
        Returns:
        the content collection. MUST NOT be null. MAY be an unmodifiable collection.
      • getPriority

        short getPriority()
        Get the priority, The lower the number the higher the priority.
        Returns:
        the priority. '0' if not specified.
      • priorities

        java.util.List<java.lang.Short> priorities()
        Get the priorities that this task and all the sub tasks are in.
        Returns:
        the priorities;