No idea why my code isn't working, supposed to add a song to the TreeSet allSongs, but it never adds more than the first one.
A Song is defined as a name and duration
Anyone know why this won't work
Code
public MPlayer() {
allSongs = new TreeSet<Song>();
playLists = new TreeMap<String, ArrayList<String>>();
}
/**
* Adds song to the database.
* @param name
* @param durationInSeconds
* @return
*/
public Mplayer addSong(String name, int durationInSeconds) {
allSongs.add(new Song(name, durationInSeconds));
return this;
}