java.lang.Object
net.i2p.router.transport.TransportImpl.AddrComparator
- All Implemented Interfaces:
Serializable, Comparator<RouterAddress>
- Enclosing class:
TransportImpl
private static class TransportImpl.AddrComparatorextends Object implements Comparator<RouterAddress>, Serializable
Compare based on published cost, adjusting for our IPv6 preference. Lowest cost (most preferred) first.
Field Summary
FieldsConstructor Summary
ConstructorsConstructorDescriptionAddrComparator(int ipv6Adjustment) Sort addresses by published cost, biased by the configured IPv6 preference.Method Summary
All MethodsModifier and TypeMethodDescriptionintCompare router addresses for sort order.Methods 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
adj
private final int adjCost adjustment for the IPv6 preference.
Constructor Details
AddrComparator
public AddrComparator(int ipv6Adjustment) Sort addresses by published cost, biased by the configured IPv6 preference.- Parameters:
ipv6Adjustment- cost added to every IPv6 address
Method Details
compare
Compare router addresses for sort order.- Specified by:
comparein interfaceComparator<RouterAddress>