/**
* Class to sort photos by name
*/
-public class PhotoSorter implements Comparator
+public class PhotoSorter implements Comparator<Photo>
{
/**
* Compare two photos
* @see java.util.Comparator#compare(java.lang.Object, java.lang.Object)
*/
- public int compare(Object o1, Object o2)
+ public int compare(Photo o1, Photo o2)
{
- File file1 = ((Photo) o1).getFile();
- File file2 = ((Photo) o2).getFile();
+ File file1 = o1.getFile();
+ File file2 = o2.getFile();
int nameComp = file1.getName().compareTo(file2.getName());
if (nameComp == 0)
{