Package net.sf.eBus.config
Class InetSocketAddressComparator
- java.lang.Object
-
- net.sf.eBus.config.InetSocketAddressComparator
-
- All Implemented Interfaces:
java.io.Serializable
,java.util.Comparator<java.net.InetSocketAddress>
public class InetSocketAddressComparator extends java.lang.Object implements java.util.Comparator<java.net.InetSocketAddress>, java.io.Serializable
Compares twojava.net.InetSocketAddress
instances based on the address bytes and the TCP port. Usesnet.sf.eBus.net.InetAddressComparator
to 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 int
compare(java.net.InetSocketAddress a1, java.net.InetSocketAddress a2)
Returns an integer <, equal to or > zero ifa1
is <, equal to or >a2
.
-
-
-
Method Detail
-
compare
public int compare(java.net.InetSocketAddress a1, java.net.InetSocketAddress a2)
Returns an integer <, equal to or > zero ifa1
is <, equal to or >a2
. TheInetAddress
es are compared first. If equal, the ports are compared.- Specified by:
compare
in interfacejava.util.Comparator<java.net.InetSocketAddress>
- Parameters:
a1
- First compared address.a2
- Second compared address.- Returns:
- an integer <, equal to or > zero if
a1
is <, equal to or >a2
. - See Also:
InetAddressComparator
-
-