net.i2p.router.networkdb.kademlia
Class XORComparator

java.lang.Object
  extended by net.i2p.router.networkdb.kademlia.XORComparator
All Implemented Interfaces:
java.util.Comparator

 class XORComparator
extends java.lang.Object
implements java.util.Comparator

Help sort Hashes in relation to a base key using the XOR metric


Constructor Summary
XORComparator(Hash target)
           
 
Method Summary
 int compare(java.lang.Object lhs, java.lang.Object rhs)
           
 
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
 

Constructor Detail

XORComparator

public XORComparator(Hash target)
Parameters:
target - key to compare distances with
Method Detail

compare

public int compare(java.lang.Object lhs,
                   java.lang.Object rhs)
Specified by:
compare in interface java.util.Comparator