package edu.deanza.calendar.models;

//constructor for localDateTime: LocalDateTime(int year, int monthOfYear, int dayOfMonth, int hourOfDay, int minuteOfHour)

import org.joda.time.LocalTime;
import java.util.ArrayList;

/**
 * Created by Sara on 5/28/2016.
 */
public class Event {
    protected String name, description, location;
    protected LocalTime startTime, endTime;
    protected enum source {
        Facebook, ClubMeeting, TransferAppointment, Website
    }
    protected ArrayList<String> tags;

    Event()
    {

    }

    Event(String name, String description, String location, String startTime,
          String endTime)
    {
        this.name = name;
        this.description = description;
        this.location = location;
        this.startTime = LocalTime.parse(startTime);
        this.endTime = LocalTime.parse(endTime);

        tags = new ArrayList<String>();
        //generate_tags();
    }

    //NEED TO ALPHABETIZE ALL TAGS
    protected void generate_tags()
    {
        int tempDay = start.getDayOfWeek();
        switch (tempDay)
        {
            case 1: tags.add("Mo");
                break;
            case 2: tags.add("Tu");
                break;
            case 3: tags.add("We");
                break;
            case 4: tags.add("Th");
                break;
            case 5: tags.add("Fr");
                break;
            case 6: tags.add("Sa");
                break;
            case 7: tags.add("Su");
                break;
            //no default case
        }
        //does this make sense to continue with month and month/day?
        //cases from LocalDateTime API http://joda-time.sourceforge.net/apidocs/org/joda/time/DateTimeConstants.html

        //This will split the string around the spaces and stores them into the given string array
        String tempNameArr[] = name.split(" ");
        for (String tempName : tempNameArr)
        {
            tags.add(tempName);
        }

        //excessive?
        String tempDescriptionArr[] = description.split(" ");
        for (String tempDescription : tempDescriptionArr)
        {
            tags.add(tempDescription);
        }
    }

    //allows us to add any tag to list
    public void tag(String t)
    {
        tags.add(t);
        //sort/alphabetize new tag
    }

    /*public boolean search_tags(String input)
    {
        //return ArrayList<String> instead?
        String keys[] = input.split(" ");
        for (String key: keys)
            if (tags.contains(key)) //or do another for loop, check beginning of input to match tags
                return true;
        //display in ListView
    }*/
}

@@ -189,36 +189,8 @@
 ime;
-%0Aimport java.util.ArrayList;
 %0A%0A/*
@@ -445,67 +445,39 @@
     
-protected ArrayList%3CString%3E tags;%0A%0A    Event()%0A    %7B%0A%0A    %7D
+// TODO: add %60categories%60 field
 %0A%0A  
@@ -795,1798 +795,9 @@
     
-    tags = new ArrayList%3CString%3E();%0A        //generate_tags();%0A    %7D%0A%0A    //NEED TO ALPHABETIZE ALL TAGS%0A    protected void generate_tags()%0A    %7B%0A        int tempDay = start.getDayOfWeek();%0A        switch (tempDay)%0A        %7B%0A            case 1: tags.add(%22Mo%22);%0A                break;%0A            case 2: tags.add(%22Tu%22);%0A                break;%0A            case 3: tags.add(%22We%22);%0A                break;%0A            case 4: tags.add(%22Th%22);%0A                break;%0A            case 5: tags.add(%22Fr%22);%0A                break;%0A            case 6: tags.add(%22Sa%22);%0A                break;%0A            case 7: tags.add(%22Su%22);%0A                break;%0A            //no default case%0A        %7D%0A        //does this make sense to continue with month and month/day?%0A        //cases from LocalDateTime API http://joda-time.sourceforge.net/apidocs/org/joda/time/DateTimeConstants.html%0A%0A        //This will split the string around the spaces and stores them into the given string array%0A        String tempNameArr%5B%5D = name.split(%22 %22);%0A        for (String tempName : tempNameArr)%0A        %7B%0A            tags.add(tempName);%0A        %7D%0A%0A        //excessive?%0A        String tempDescriptionArr%5B%5D = description.split(%22 %22);%0A        for (String tempDescription : tempDescriptionArr)%0A        %7B%0A            tags.add(tempDescription);%0A        %7D%0A    %7D%0A%0A    //allows us to add any tag to list%0A    public void tag(String t)%0A    %7B%0A        tags.add(t);%0A        //sort/alphabetize new tag%0A    %7D%0A%0A    /*public boolean search_tags(String input)%0A    %7B%0A        //return ArrayList%3CString%3E instead?%0A        String keys%5B%5D = input.split(%22 %22);%0A        for (String key: keys)%0A            if (tags.contains(key)) //or do another for loop, check beginning of input to match tags%0A                return true;%0A        //display in ListView%0A    %7D*/
+%7D%0A
 %0A%7D%0A

Remove `tags` field and add TODO