Class ITunesLibraryDescriptor.LastModificationComparator
- java.lang.Object
-
- com.tagtraum.beatunes.library.itunes.ITunesLibraryDescriptor.LastModificationComparator
-
- All Implemented Interfaces:
Comparator<LibraryDescriptor>
- Enclosing class:
- ITunesLibraryDescriptor
public static class ITunesLibraryDescriptor.LastModificationComparator extends Object implements Comparator<LibraryDescriptor>
Allows you to compare LibraryDescriptors based on their file's last modification date. This enables us to pick the newest one of a bunch of library descriptors with the same id. Library descriptors can have the same id, when a library has been moved and the old one is still lying around.After sorting with
Collections.sort(java.util.List, java.util.Comparator)
the newest Library descriptor is first.
-
-
Constructor Summary
Constructors Constructor Description LastModificationComparator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compare(LibraryDescriptor libraryDescriptor1, LibraryDescriptor libraryDescriptor2)
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.util.Comparator
equals, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
-
-
-
-
Method Detail
-
compare
public int compare(LibraryDescriptor libraryDescriptor1, LibraryDescriptor libraryDescriptor2)
- Specified by:
compare
in interfaceComparator<LibraryDescriptor>
-
-