From 4bd626572b3ab8d0dd021da0756cdf3de5c95b7f Mon Sep 17 00:00:00 2001 From: orbiter Date: Tue, 18 Jul 2006 12:00:54 +0000 Subject: [PATCH] added hashCode and compareTo to new URL class git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@2301 6c8d7289-2bf4-0310-a012-ef5d649a1542 --- source/de/anomic/net/URL.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/source/de/anomic/net/URL.java b/source/de/anomic/net/URL.java index 7b009c80e..31ee94223 100644 --- a/source/de/anomic/net/URL.java +++ b/source/de/anomic/net/URL.java @@ -222,6 +222,14 @@ public class URL { ((this.port == other.port ))); } + public int hashCode() { + return this.toString().hashCode(); + } + + public int compareTo(Object h) { + assert (h instanceof URL); + return this.toString().compareTo(((URL) h).toString()); + } public static void main(String[] args) { URL u;