package com.maxiee.heartbeat.model;

import java.util.ArrayList;

/**
 * Created by maxiee on 15-6-16.
 */
public class Thoughts {

    public static final String THOUGHT = "thought";
    public static final String TIMESTAMP = "timestamp";

    private ArrayList<Thought> mThoughts;

    public Thoughts() {
        mThoughts = new ArrayList<>();
    }

    public void addThought(String thought) {

        Thought thoughtObject = new Thought(
                thought,
                System.currentTimeMillis());

        mThoughts.add(thoughtObject);
    }

    public ArrayList<Thought> getmThoughts() {
        return mThoughts;
    }

    public Thought get(int position) {
        return mThoughts.get(position);
    }

    public void add(Thought thought) {
        mThoughts.add(thought);
    }


    public int length() {
        return mThoughts.size();
    }

    public static class Thought {
        private String mThought;
        private long mTimeStamp;

        public Thought(String mThought, long mTimeStamp) {
            this.mThought = mThought;
            this.mTimeStamp = mTimeStamp;
        }

        public String getThought() {
            return mThought;
        }

        public long getTimeStamp() {
            return mTimeStamp;
        }
    }
}

@@ -370,24 +370,33 @@
  addThought(
+int key, 
 String thoug
@@ -401,16 +401,16 @@
 ught) %7B%0A
-
 %0A       
@@ -447,16 +447,37 @@
 hought(%0A
+                key,%0A
         
@@ -828,16 +828,98 @@
 %0A    %7D%0A%0A
+    public void remove(int position) %7B%0A        mThoughts.remove(position);%0A    %7D%0A%0A
 %0A    pub
@@ -1010,16 +1010,42 @@
 hought %7B
+%0A%0A        private int key;
 %0A       
@@ -1127,16 +1127,25 @@
 Thought(
+int key, 
 String m
@@ -1168,24 +1168,52 @@
 imeStamp) %7B%0A
+            this.key = key;%0A
             
@@ -1283,32 +1283,97 @@
 amp;%0A        %7D%0A%0A
+        public int getKey() %7B%0A            return key;%0A        %7D%0A%0A
         public S
@@ -1466,24 +1466,24 @@
 meStamp() %7B%0A
-
             
@@ -1510,16 +1510,115 @@
        %7D
+%0A%0A        public void setThought(String mThought) %7B%0A            this.mThought = mThought;%0A        %7D
 %0A    %7D%0A%7D

add a field to store key.