Back to project page kure-music-player.
The source code is released under:
GNU General Public License
If you think the Android project kure-music-player listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.kure.musicplayer.model; /*from ww w.j ava2 s . co m*/ import java.util.ArrayList; public class Playlist { private long id; private String name; private ArrayList<Long> songs = new ArrayList<Long>(); public Playlist(long id, String name) { this.id = id; this.name = name; } public long getID() { return id; } public String getName() { return name; } /** * Inserts a song on this Playlist. * * @param id Global song id. */ public void add(long id) { if (! songs.contains(id)) songs.add(id); } /** * Returns a list with all the songs inside this Playlist. * @return */ public ArrayList<Long> getSongIds() { ArrayList<Long> list = new ArrayList<Long>(); for (Long songID : songs) list.add(songID); return list; } }