package com.andela.motustracker.model;

/**
 * Created by Spykins on 06/04/16.
 */
public class LocationData {
    private String address;
    private double longitude;
    private double latitude;
    private String  date;
    private Double timeSpent;

    public LocationData(String address, String date, double latitude, double longitude, Long timeSpent) {
        this.address = address;
        this.date = date;
        this.latitude = latitude;
        this.longitude = longitude;
        this.timeSpent = timeSpent.doubleValue();

    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public String getDate() {

        return date;
    }

    public void setDate(String date) {
        this.date = date;
    }

    public double getLatitude() {
        return latitude;
    }

    public void setLatitude(double latitude) {
        this.latitude = latitude;
    }

    public double getLongitude() {
        return longitude;
    }

    public void setLongitude(double longitude) {
        this.longitude = longitude;
    }

    public double getTimeSpent() {
        return timeSpent;
    }

    public void setTimeSpent(Long timeSpent) {
        this.timeSpent = timeSpent.doubleValue();
    }

    public void upDateTimeSpent(double newTime) {
        this.timeSpent += newTime;
    }
}

@@ -33,16 +33,73 @@
 model;%0A%0A
+import android.os.Parcel;%0Aimport android.os.Parcelable;%0A%0A
 /**%0A * C
@@ -159,16 +159,38 @@
 ionData 
+implements Parcelable 
 %7B%0A    pr
@@ -289,17 +289,16 @@
  String 
- 
 date;%0A  
@@ -610,24 +610,554 @@
 alue();%0A
-%0A
     %7D%0A%0A
+    protected LocationData(Parcel in) %7B%0A        address = in.readString();%0A        longitude = in.readDouble();%0A        latitude = in.readDouble();%0A        date = in.readString();%0A    %7D%0A%0A    public static final Creator%3CLocationData%3E CREATOR = new Creator%3CLocationData%3E() %7B%0A        @Override%0A        public LocationData createFromParcel(Parcel in) %7B%0A            return new LocationData(in);%0A        %7D%0A%0A        @Override%0A        public LocationData%5B%5D newArray(int size) %7B%0A            return new LocationData%5Bsize%5D;%0A        %7D%0A    %7D;%0A%0A
     publ
@@ -1326,17 +1326,16 @@
 ate() %7B%0A
-%0A
         
@@ -1358,80 +1358,8 @@
  %7D%0A%0A
-    public void setDate(String date) %7B%0A        this.date = date;%0A    %7D%0A%0A
     
@@ -1848,87 +1848,287 @@
     
-public void upDateTimeSpent(double newTime) %7B%0A        this.timeSpent += newTime
+@Override%0A    public int describeContents() %7B%0A        return 0;%0A    %7D%0A%0A    @Override%0A    public void writeToParcel(Parcel dest, int flags) %7B%0A        dest.writeString(address);%0A        dest.writeDouble(longitude);%0A        dest.writeDouble(latitude);%0A        dest.writeString(date)
 ;%0A  

Implement parcelable in LocationData.java class