public class IdentityComparator<T>
extends java.lang.Object
implements java.util.Comparator<T>
This is useful if dynamic proxy is used with TreeSet or TreeMap (so equals is expensive). Reason: the speed of identifyHashCode is much faster than dynamic proxy (150:1).
However, if possible, java.util.IdentityHashMap and IdentityHashSet
are preferred.
IdentityHashSet
Constructor and Description |
---|
IdentityComparator() |
Modifier and Type | Method and Description |
---|---|
int |
compare(T o1,
T o2) |
Copyright © 2005-2018 Potix Corporation. All Rights Reserved.