/** * Returns the total duration of the playlist. * * @return The duration of all the songs on the list in seconds. */ public int getTotalTime() { int total = 0; for (Song s : songlist) { total = total + s.getDuration(); } return total; }
public int compare(Song s1, Song s2) { return s1.getDuration() - s2.getDuration(); }