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:
  • Field Details

    • _base

      private final byte[] _base
      Key to compare distances with.
  • Constructor Details

    • XORComparator

      public XORComparator(T target)
      Create a comparator with the given target key.
      Parameters:
      target - key to compare distances with
  • Method Details