public static class AddressComparator.ValueComparator extends AddressComparator
For individual addresses, it simply compares segment to segment from high to low, so 1.2.3.4 < 1.2.3.5 and 2.2.3.4 > 1.2.3.5.
The difference is how they treat addresses representing multiple addresses (ie subnets) like 1::/64 or 1.*.*.*
The count comparator considers addresses which represent more individual addresses to be larger.
The value comparator goes by either the highest value or the lowest value in the range of represented addresses.
So, for instance, consider 1.2.3.4 and 1.0.0.*
With count comparator, 1.2.3.4 < 1.2.3.* since the second represents more addresses (ie 1 < 255)
With value comparator using the high value, 1.2.3.4 < 1.2.3.* since 1.2.3.4 < 1.2.3.255
With value comparator using the low value, 1.2.3.4 > 1.2.3.* since 1.2.3.4 > 1.2.3.0
Also see AddressComparator.CountComparator
AddressComparator.CountComparator, AddressComparator.ValueComparator
Constructor and Description |
---|
ValueComparator(boolean compareHighValue) |
ValueComparator(boolean equalsConsistent,
boolean compareHighValue) |
ValueComparator(boolean equalsConsistent,
boolean compareHighValue,
boolean flipSecond) |
compare, compare, compare, compare, compare, compare, compare
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
comparing, comparing, comparingDouble, comparingInt, comparingLong, equals, naturalOrder, nullsFirst, nullsLast, reversed, reverseOrder, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong