java.lang.Object
net.i2p.router.sybil.Pair
All Implemented Interfaces:
Comparable<Pair>

public class Pairextends Object implements Comparable<Pair>
A pair of routers and the distance between them.
  • Field Details

    • r1

      public final RouterInfo r1
      First router.
    • r2

      public final RouterInfo r2
      Second router.
    • dist

      public final BigInteger dist
      Distance between the routers.
  • Constructor Details

    • Pair

      public Pair(RouterInfo ri1, RouterInfo ri2, BigInteger distance)
      Holds the two routers and their Kademlia distance.
      Parameters:
      ri1 - the first router of the pair
      ri2 - the second router of the pair
      distance - the Kademlia distance between the two routers
  • Method Details

    • compareTo

      public int compareTo(Pair p)
      Compare this pair's distance to another pair's.
      Specified by:
      compareTo in interface Comparable<Pair>
    • equals

      public boolean equals(Object o)
      Whether this pair equals the given object.
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Hash code for this pair.
      Overrides:
      hashCode in class Object
      Returns:
      whether h code is present