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(int key, String thought) {

        Thought thoughtObject = new Thought(
                key,
                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 void remove(int position) {
        mThoughts.remove(position);
    }


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

    public static class Thought {

        private int key;
        private String mThought;
        private long mTimeStamp;

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

        public int getKey() {
            return key;
        }

        public String getThought() {
            return mThought;
        }

        public long getTimeStamp() {
            return mTimeStamp;
        }

        public void setThought(String mThought) {
            this.mThought = mThought;
        }
    }
}

@@ -57,16 +57,75 @@
 rayList;
+%0Aimport java.util.Collection;%0Aimport java.util.Collections;
 %0A%0A/**%0A *
@@ -969,16 +969,90 @@
 %0A    %7D%0A%0A
+    public void reverse() %7B%0A        Collections.reverse(mThoughts);%0A    %7D%0A
 %0A    pub

add reverse() method.