net.i2p.kademlia
Class XORComparator<T extends SimpleDataStructure>
java.lang.Object
net.i2p.kademlia.XORComparator<T>
- All Implemented Interfaces:
- Comparator<T>
class XORComparator<T extends SimpleDataStructure>
- extends Object
- implements Comparator<T>
Help sort Hashes in relation to a base key using the XOR metric
- Since:
- 0.9.2
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
XORComparator
public XORComparator(T target)
- Parameters:
target
- key to compare distances with
compare
public int compare(T lhs,
T rhs)
- Specified by:
compare
in interface Comparator<T extends SimpleDataStructure>