public class InetAddressComparator extends Object implements Comparator<InetAddress>, Serializable
InetAddress addresses using the address
bytes.| Constructor and Description |
|---|
InetAddressComparator()
Creates a new instance of InetAddressComparator.
|
| Modifier and Type | Method and Description |
|---|---|
int |
compare(InetAddress a1,
InetAddress a2)
Returns an integer <, equal to or > zero if
a1 is <, equal to or > a2. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcomparing, comparing, comparingDouble, comparingInt, comparingLong, equals, naturalOrder, nullsFirst, nullsLast, reversed, reverseOrder, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLongpublic InetAddressComparator()
public int compare(InetAddress a1, InetAddress a2)
a1 is <, equal to or > a2. The
comparison is based on the raw IP address octets. If
a1 has fewer bytes or more bytes than a2,
then a negative or positve integer is returned,
respectively. Otherwise, the IP address octets are
compared until the first non-zero result is found.compare in interface Comparator<InetAddress>a1 - First compared address.a2 - Second compared address.a1 is <, equal to or > a2.Copyright © 2020. All rights reserved.