net.i2p.kademlia

## Class XORComparator<T extends SimpleDataStructure>

- java.lang.Object
- - net.i2p.kademlia.XORComparator<T>

- Type Parameters:
    `T` - type of SimpleDataStructure objects being compared
  All Implemented Interfaces:
    Serializable, Comparator<T>

      public class XORComparator<T extends SimpleDataStructure>
      extends Object
      implements Comparator<T>, Serializable

  Help sort Hashes in relation to a base key using the XOR metric
  See Also:
    Serialized Form

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `XORComparator(T target)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `compare(T lhs, T 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

      `comparing, comparing, comparingDouble, comparingInt, comparingLong, equals, naturalOrder, nullsFirst, nullsLast, reversed, reverseOrder, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong`

- - ### Constructor Detail

    - #### XORComparator

          public XORComparator(T target)

      Parameters:
        `target` - key to compare distances with

  - ### Method Detail

    - #### compare

          public int compare(T lhs,
                             T rhs)

      Specified by:
        `compare` in interface `Comparator<T extends SimpleDataStructure>`