Package no.ntnu.idatt

Class List

java.lang.Object
no.ntnu.idatt.List
All Implemented Interfaces:
Serializable

public class List extends Object implements Serializable
List represents list of tasks. List is a mutable and serializable class.
See Also:
Serialized Form
  • Constructor Details

    • List

      public List(String label)
  • Method Details

    • getLABEL

      public String getLABEL()
    • getAllTasks

      public ArrayList<Task> getAllTasks()
    • getNonCompletedTasks

      public ArrayList<Task> getNonCompletedTasks()
    • getCompletedTasks

      public ArrayList<Task> getCompletedTasks()
    • getSortedTasks

      public void getSortedTasks(int sortBy)
      Returns a sorted list.
      Parameters:
      sortBy - int representing sorting type (1 = by date, 2 = by priority, 3 = alphabetically)
    • setTasks

      public void setTasks(ArrayList<Task> tasks)
    • addTask

      public void addTask(Task task)
    • remove

      public void remove(Task task) throws RemoveException
      Removes given Task from list
      Parameters:
      task - The task which should be removed
      Throws:
      RemoveException - if task is not removed
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object