1 package tim.prune.load;
4 import java.util.Comparator;
6 import tim.prune.data.Photo;
9 * Class to sort photos by name
11 public class PhotoSorter implements Comparator<Photo>
16 * @see java.util.Comparator#compare(java.lang.Object, java.lang.Object)
18 public int compare(Photo o1, Photo o2)
20 File file1 = o1.getFile();
21 File file2 = o2.getFile();
22 int nameComp = file1.getName().compareTo(file2.getName());
25 // names same, maybe in different directories
26 return file1.getAbsolutePath().compareTo(file2.getAbsolutePath());