Hi,
ich hab noch einen bug in meinem Programm bzw ein kleiner fehler im junittest schlägt noch aus und ich weiß einfach nicht wieso.
Wäre sehr dankbar, wenn mir jmd helfen könnte.
hier ist die methode die noch nicht richtig funktionier. der link zeigt das üb.
https://www.dropbox.com/s/rfc8kt93u19vy9r/Vorfuehraufgabe09.pdf?dl=0
Vielen Dank schon mal!
ich hab noch einen bug in meinem Programm bzw ein kleiner fehler im junittest schlägt noch aus und ich weiß einfach nicht wieso.
Wäre sehr dankbar, wenn mir jmd helfen könnte.
hier ist die methode die noch nicht richtig funktionier. der link zeigt das üb.
https://www.dropbox.com/s/rfc8kt93u19vy9r/Vorfuehraufgabe09.pdf?dl=0
Vielen Dank schon mal!
Java:
package studiplayer.audio;
import java.util.Comparator;
public class AlbumComparator implements Comparator<AudioFile>{
@Override
public int compare(AudioFile af0, AudioFile af1) {
if(af0 != null && af1 != null){
if(!(af0 instanceof TaggedFile) && af1 instanceof TaggedFile){
return -1;
}else if(af1 instanceof TaggedFile && !(af0 instanceof TaggedFile)){
return 1;
}else if(!(af0 instanceof TaggedFile) && !(af1 instanceof TaggedFile)){
return 0;
}else{
return ((TaggedFile) af0).getAlbum().compareTo(((TaggedFile) af1).getAlbum());
}
}else{
throw new NullPointerException("incorrect album references!");
}
}
}