java.lang.Object
net.i2p.router.web.helpers.TunnelRenderer.CountryComparator
- All Implemented Interfaces:
Comparator<Hash>
- Enclosing class:
TunnelRenderer
Sorts peers by country then name.
Field Summary
FieldsConstructor Summary
ConstructorsConstructorDescriptionOrder router hashes by the country code they resolve to, with an unknown country sorted last.Method Summary
All MethodsMethods inherited from class Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Comparator
equals, max, min, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
Field Details
comm
Source of the peer locations.
Constructor Details
CountryComparator
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
Compare the two countries as plain strings, substituting "zzzz" for an unknown one so it sorts after every real code.- Specified by:
comparein interfaceComparator<Hash>