net.i2p.router.networkdb.kademlia

## Class XORComparator

- java.lang.Object
- - net.i2p.router.networkdb.kademlia.XORComparator

All Implemented Interfaces:
  Comparator<Hash>

     class XORComparator
    extends Object
    implements Comparator<Hash>

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

### Constructor Summary

Constructors
Constructor and Description
`XORComparator(Hash target)`

### Method Summary

Methods
`int` `compare(Hash lhs, Hash 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(Hash lhs,
              Hash rhs)

Specified by:
  `compare` in interface `Comparator<Hash>`