java.lang.Object
net.i2p.router.tunnel.pool.TunnelPool.TunnelInfoComparator
All Implemented Interfaces:
Serializable, Comparator<TunnelInfo>
Enclosing class:
TunnelPool

private static class TunnelPool.TunnelInfoComparatorextends Object implements Comparator<TunnelInfo>, Serializable
Find the tunnel with the far-end that is XOR-closest to a given hash.
  • Field Details

    • serialVersionUID

      private static final long serialVersionUID
      Fixed serial version for the inner class.
      See Also:
    • _base

      private final byte[] _base
      Destination prefix used to match peers.
    • _avoidZero

      private final boolean _avoidZero
      Whether zero-hop tunnels are avoided.
  • Constructor Details

    • TunnelInfoComparator

      public TunnelInfoComparator(Hash target, boolean avoidZeroHop)
      The sort key and zero-hop handling for this comparator.
      Parameters:
      target - key to compare distances with
      avoidZeroHop - if true, zero-hop tunnels will be put last
  • Method Details