net.i2p.router.tunnel.pool
Class TunnelPool.LeaseComparator
java.lang.Object
net.i2p.router.tunnel.pool.TunnelPool.LeaseComparator
- All Implemented Interfaces:
- Comparator
- Enclosing class:
- TunnelPool
class TunnelPool.LeaseComparator
- extends Object
- implements Comparator
Always build a LeaseSet with Leases in sorted order,
so that LeaseSet.equals() and lease-by-lease equals() always work.
The sort method is arbitrary, as far as the equals() tests are concerned,
but we use latest expiration first, since we need to sort them by that anyway.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
TunnelPool.LeaseComparator
TunnelPool.LeaseComparator()
compare
public int compare(Object l,
Object r)
- Specified by:
compare
in interface Comparator