*
* @author <a href="mailto:bombe@pterodactylus.net">David ‘Bombe’ Roden</a>
*/
- public static class Episode implements Iterable<TorrentFile> {
+ public static class Episode implements Comparable<Episode>, Iterable<TorrentFile> {
/** The season of the episode. */
@JsonProperty
return torrentFiles.iterator();
}
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public int compareTo(Episode episode) {
+ if (season() < episode.season()) {
+ return -1;
+ }
+ if (season() > episode.season()) {
+ return 1;
+ }
+ if (episode() < episode.episode()) {
+ return -1;
+ }
+ if (episode() > episode.episode()) {
+ return 1;
+ }
+ return 0;
+ }
+
//
// OBJECT METHODS
//