From: David ‘Bombe’ Roden Date: Wed, 2 Feb 2011 13:11:46 +0000 (+0100) Subject: Implement Comparable interface in Sone. X-Git-Tag: 0.4.4^2~10 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=b99cf54167bc8503f35790e95149bc4dd85fca50;p=Sone.git Implement Comparable interface in Sone. --- diff --git a/src/main/java/net/pterodactylus/sone/data/Sone.java b/src/main/java/net/pterodactylus/sone/data/Sone.java index f183b39..cc54697 100644 --- a/src/main/java/net/pterodactylus/sone/data/Sone.java +++ b/src/main/java/net/pterodactylus/sone/data/Sone.java @@ -40,7 +40,7 @@ import freenet.keys.FreenetURI; * * @author David ‘Bombe’ Roden */ -public class Sone implements Fingerprintable { +public class Sone implements Fingerprintable, Comparable { /** comparator that sorts Sones by their nice name. */ public static final Comparator NICE_NAME_COMPARATOR = new Comparator() { @@ -626,6 +626,18 @@ public class Sone implements Fingerprintable { } // + // INTERFACE Comparable + // + + /** + * {@inheritDoc} + */ + @Override + public int compareTo(Sone sone) { + return NICE_NAME_COMPARATOR.compare(this, sone); + } + + // // OBJECT METHODS //