java.lang.Object
net.i2p.router.web.helpers.TunnelRenderer.CountryComparator
All Implemented Interfaces:
Comparator<Hash>
Enclosing class:
TunnelRenderer

private static class TunnelRenderer.CountryComparatorextends Object implements Comparator<Hash>
Sorts peers by country then name.
  • Field Details

  • Constructor Details

    • CountryComparator

      public CountryComparator(CommSystemFacade comm)
      Order router hashes by the country code they resolve to, with an unknown country sorted last.
      Parameters:
      comm - the source of the peer locations
  • Method Details

    • compare

      public int compare(Hash l, Hash r)
      Compare the two countries as plain strings, substituting "zzzz" for an unknown one so it sorts after every real code.
      Specified by:
      compare in interface Comparator<Hash>