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

static class NetDbComparators.CountryComparatorextends Object implements Comparator<String>
Comparator for countries by translated name.
  • Field Details

    • _context

      private final RouterContext _context
      The router context used to read the display language.
    • coll

      private final Collator coll
      Locale-sensitive collator, so country names sort in the user's language.
  • Constructor Details

    • CountryComparator

      public CountryComparator(RouterContext ctx)
      Create a comparator ordering country names in the console's language.
      Parameters:
      ctx - the router context
  • Method Details

    • compare

      public int compare(String l, String r)
      Specified by:
      compare in interface Comparator<String>
    • translated

      private String translated(String code)
      Translates a country code for display.
      Parameters:
      code - the two-letter code
      Returns:
      the name to show