Skip to content

Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance

added hashCode and compareTo to new URL class

orbiter4bd626572b3a
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;