package com.example.habitrack;

/**
 * Created by sshussai on 10/21/17.
 */

public class HabitTypeController {
    String second_word = "hello";


    public String getWord() {
        return second_word;
    }
}




@@ -29,16 +29,63 @@
 k;%0A%0A/**%0A
+ *%0A * HabitTypeController%0A *%0A * Version 1.0%0A *%0A
  * Creat
@@ -112,16 +112,22 @@
 /21/17.%0A
+ *%0A *%0A
  */%0A%0Apub
@@ -162,107 +162,1886 @@
 r %7B%0A
+%0A
     
-String second_word = %22hello%22;%0A%0A%0A    public String getWord() %7B%0A        return second_word;%0A    %7D
+/**%0A     * This class is the main interface for the habit type entity. It can create a new habit type%0A     * and delete it. It can also edit the title, reason, start date or schedule for a given%0A     * habit type.%0A     *%0A     */%0A%0A    public HabitTypeController()%7B%7D%0A%0A    public void createNewHabitType(String title, String reason,%0A                                   Calendar startDate, ArrayList%3CInteger%3E schedule) %7B%0A        HabitType ht = new HabitType(4);%0A        ht.setTitle(title);%0A        ht.setReason(reason);%0A        ht.setStartDate(startDate);%0A        ht.setSchedule(schedule);%0A%0A    %7D%0A%0A    public void delete(Integer requestedID) %7B%0A        HabitTypeManager.getHTManager().removeHabitType(requestedID);%0A%0A    %7D%0A%0A    public HabitType viewDetails(Integer requestedID) %7B%0A        HabitType ht = HabitTypeManager.getHTManager().getHabitType(requestedID);%0A        return ht;%0A    %7D%0A%0A    public static void editHabitTypeTitle(Integer requestedID, String newTitle)%7B%0A        HabitType ht = HabitTypeManager.getHTManager().getHabitType(requestedID);%0A%0A        if(ht != null)%7B%0A            ht.setTitle(newTitle);%0A        %7D%0A    %7D%0A%0A    public static void editHabitTypeReason(Integer requestedID, String newReason)%7B%0A        HabitType ht = HabitTypeManager.getHTManager().getHabitType(requestedID);%0A        if(ht != null)%7B%0A            ht.setReason(newReason);%0A        %7D%0A    %7D%0A%0A    public static void editHabitTypeStartDate(Integer requestedID, Calendar newDate)%7B%0A        HabitType ht = HabitTypeManager.getHTManager().getHabitType(requestedID);%0A        if(ht != null)%7B%0A            ht.setStartDate(newDate);%0A        %7D%0A    %7D%0A%0A    public static void editHabitTypeSchedule(Integer requestedID, ArrayList%3CInteger%3E newSchedule)%7B%0A        HabitType ht = HabitTypeManager.getHTManager().getHabitType(requestedID);%0A        if(ht != null)%7B%0A            ht.setSchedule(newSchedule);%0A        %7D%0A    %7D%0A
 %0A%7D%0A%0A

version 1.0 of HabitTypeController