Back to project page music-tag.
The source code is released under:
Apache License
If you think the Android project music-tag 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 binauld.pierre.musictag.collection; /* w w w .j a v a 2s. c o m*/ import java.util.Comparator; import binauld.pierre.musictag.item.LibraryItem; /** * Allows to compare 2 library items. * Sort files in alphabetical order (Folder first). */ public class LibraryItemComparator implements Comparator<LibraryItem> { @Override public int compare(LibraryItem item1, LibraryItem item2) { if(!item1.isAudioItem() && item2.isAudioItem()) { return -1; } else if (item1.isAudioItem() && !item2.isAudioItem()) { return 1; } else { return item1.getPrimaryInformation().toLowerCase() .compareTo(item2.getPrimaryInformation().toLowerCase()); } } }