Class TaskStorage

  • All Implemented Interfaces:
    java.io.Serializable

    public class TaskStorage
    extends java.lang.Object
    implements java.io.Serializable
    This class is used in order to save all the tasks in the memory. Also, this class manage all the different types available.
    Author:
    CADOUL Michael AND VERY-GRIETTE Milan
    See Also:
    Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.util.Vector<Task> mStorage  
      private java.util.List<java.lang.String> mTypes
      Vector array, where all the tasks are saved
    • Constructor Summary

      Constructors 
      Constructor Description
      TaskStorage()
      Basically sets the default types of tasks directly in the constructor
    • Method Summary

      Modifier and Type Method Description
      (package private) void addTask​(Task task)
      Used to add a task
      (package private) java.util.Vector<Task> getmStorage()
      Getter
      (package private) java.util.List<java.lang.String> getmTypes()
      Getter
      (package private) java.util.Vector<java.lang.String> getTitleArray()
      Kind of getter
      (package private) void remove​(int index)
      Used to remove a specific task
      java.lang.String toString()
      Override the toString function in order to show all the stored tasks
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • mStorage

        private java.util.Vector<Task> mStorage
      • mTypes

        private java.util.List<java.lang.String> mTypes
        Vector array, where all the tasks are saved
    • Constructor Detail

      • TaskStorage

        TaskStorage()
        Basically sets the default types of tasks directly in the constructor
    • Method Detail

      • getTitleArray

        java.util.Vector<java.lang.String> getTitleArray()
        Kind of getter
        Returns:
        a generated array with all the Task's title.
      • toString

        public java.lang.String toString()
        Override the toString function in order to show all the stored tasks
        Overrides:
        toString in class java.lang.Object
        Returns:
        String value
      • addTask

        void addTask​(Task task)
        Used to add a task
        Parameters:
        task - The task we want to add
      • getmStorage

        java.util.Vector<Task> getmStorage()
        Getter
        Returns:
        The Tasks vector
      • getmTypes

        java.util.List<java.lang.String> getmTypes()
        Getter
        Returns:
        The List of types
      • remove

        void remove​(int index)
        Used to remove a specific task
        Parameters:
        index - The index of the task we want to remove