Package net.sf.eBus.config
Class InetSocketAddressComparator
- java.lang.Object
-
- net.sf.eBus.config.InetSocketAddressComparator
-
- All Implemented Interfaces:
Serializable,Comparator<InetSocketAddress>
public class InetSocketAddressComparator extends Object implements Comparator<InetSocketAddress>, Serializable
Compares twojava.net.InetSocketAddressinstances based on the address bytes and the TCP port. Usesnet.sf.eBus.net.InetAddressComparatorto compare the socket addresses.- Author:
- crapp
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description InetSocketAddressComparator()Creates a new instance of InetSocketAddressComparator.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompare(InetSocketAddress a1, InetSocketAddress a2)Returns an integer <, equal to or > zero ifa1is <, equal to or >a2.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.util.Comparator
equals, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
-
-
-
-
Method Detail
-
compare
public int compare(InetSocketAddress a1, InetSocketAddress a2)
Returns an integer <, equal to or > zero ifa1is <, equal to or >a2. TheInetAddresses are compared first. If equal, the ports are compared.- Specified by:
comparein interfaceComparator<InetSocketAddress>- Parameters:
a1- First compared address.a2- Second compared address.- Returns:
- an integer <, equal to or > zero if
a1is <, equal to or >a2. - See Also:
InetAddressComparator
-
-