Sort on highest score

This commit is contained in:
2015-07-06 17:01:45 +02:00
parent c111a52f52
commit 18d6a9dcbd
+18
View File
@@ -0,0 +1,18 @@
package audio.sorting;
import java.util.Comparator;
import audio.Song;
public class SortSCORE implements Comparator<Song> {
public int compare(Song s1, Song s2) {
if(s1.getHighestScore() < s2.getHighestScore())
return 1;
else if(s1.getHighestScore() > s2.getHighestScore())
return -1;
else
return s1.getTitle().compareTo(s2.getTitle());
}
}