org.limewire.io
Class IpPort.IpPortComparator
java.lang.Object
org.limewire.io.IpPort.IpPortComparator
- All Implemented Interfaces:
- Comparator<IpPort>
- Enclosing interface:
- IpPort
public static class IpPort.IpPortComparator
- extends Object
- implements Comparator<IpPort>
Compares IpPort objects.
This class is useful when a variety of objects that implement
IpPort want to be placed in a Set. Since it is difficult
(near impossible) to enforce that they all maintain a valid contract
with regards to hashCode and equals, the only valid way to enforce
Set equality is to use a Comparator that is based on a unique
IP Port criteria.
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
IpPort.IpPortComparator
public IpPort.IpPortComparator()
compare
public int compare(IpPort ip1,
IpPort ip2)
- Specified by:
compare in interface Comparator<IpPort>
Copyright © 2009. All Rights Reserved.