package se.chalmers.pd.device;

public class Track {
	
	
	private String name;
	private String artist;
	private String spotifyUri;

	public Track(String name, String artist, String spotifyUri) {
		this.name = name;
		this.artist = artist;
		this.spotifyUri = spotifyUri;
	}

	/**
	 * @return the name of the track
	 */
	public String getName() {
		return name;
	}

	/**
	 * @return the artist
	 */
	public String getArtist() {
		return artist;
	}

	/**
	 * @return the spotifyUri
	 */
	public String getUri() {
		return spotifyUri;
	}
	
	@Override
	public boolean equals(Object object){
		if (object instanceof Track) {
			Track track = (Track) object;
			if(track.name.equals(this.name)&&track.artist.equals(this.artist)&&track.spotifyUri.equals(this.spotifyUri))
				return true;
		}
		return false;
	}

}

@@ -29,32 +29,107 @@
 e;%0A%0A
-public class Track %7B%0A%09%0A%09
+import android.os.Parcel;%0Aimport android.os.Parcelable;%0A%0Apublic class Track implements Parcelable %7B
 %0A%09pr
@@ -198,16 +198,58 @@
 tifyUri;
+%0A%09private int length;%0A%0A%09public Track() %7B %7D
 %0A%0A%09publi
@@ -301,16 +301,28 @@
 otifyUri
+, int length
 ) %7B%0A%09%09th
@@ -393,16 +393,226 @@
 ifyUri;%0A
+%09%09this.setLength(length);%0A%09%7D%0A%0A%09public Track(Parcel parcel) %7B%0A%09%09this.name = parcel.readString();%0A%09%09this.artist = parcel.readString();%0A%09%09this.spotifyUri = parcel.readString();%0A%09%09this.setLength(parcel.readInt());%0A
 %09%7D%0A%0A%09/**
@@ -867,17 +867,390 @@
 Uri;%0A%09%7D%0A
-%09
+%0A%09/**%0A%09 * @param the%0A%09 *            name of the track%0A%09 */%0A%09public void setName(String name) %7B%0A%09%09this.name = name;%0A%09%7D%0A%0A%09/**%0A%09 * @param the%0A%09 *            name of the artist%0A%09 */%0A%09public void setArtist(String artist) %7B%0A%09%09this.artist = artist;%0A%09%7D%0A%0A%09/**%0A%09 * @param the%0A%09 *            spotify URI%0A%09 */%0A%09public void setUri(String spotifyUri) %7B%0A%09%09this.spotifyUri = spotifyUri;%0A%09%7D%0A
 %0A%09@Overr
@@ -1290,16 +1290,17 @@
  object)
+ 
 %7B%0A%09%09if (
@@ -1364,16 +1364,17 @@
 t;%0A%09%09%09if
+ 
 (track.n
@@ -1394,18 +1394,20 @@
 is.name)
+ 
 &&
+ 
 track.ar
@@ -1430,18 +1430,25 @@
 .artist)
+%0A%09%09%09%09%09
 &&
+ 
 track.sp
@@ -1522,10 +1522,732 @@
 se;%0A%09%7D%0A%0A
+%09public int describeContents() %7B%0A%09%09return 0;%0A%09%7D%0A%0A%09/**%0A     * Writes the data to the parcel%0A     */%0A%09public void writeToParcel(Parcel dest, int flags) %7B%0A%09%09dest.writeString(name);%0A%09%09dest.writeString(artist);%0A%09%09dest.writeString(spotifyUri);%0A%09%09dest.writeInt(length);%0A%09%7D%0A%0A%09/**%0A%09 * @return the length%0A%09 */%0A%09public int getLength() %7B%0A%09%09return length;%0A%09%7D%0A%0A%09/**%0A%09 * @param length the length to set%0A%09 */%0A%09public void setLength(int length) %7B%0A%09%09this.length = length;%0A%09%7D%0A%0A%09/**%0A%09 * Parcelable construction%0A%09 */%0A%09public static final Parcelable.Creator CREATOR = new Parcelable.Creator() %7B%0A%09%09public Track createFromParcel(Parcel in) %7B%0A%09%09%09return new Track(in);%0A%09%09%7D%0A%0A%09%09public Track%5B%5D newArray(int size) %7B%0A%09%09%09return new Track%5Bsize%5D;%0A%09%09%7D%0A%09%7D;%0A%0A
 %7D%0A

Fix #45 updated track class with length of track