1
2
3
4 package jwutil.collections;
5
6 import jwutil.util.Assert;
7
8
9
10
11
12 public class IdentityHashCodeWrapper {
13
14 private Object o;
15 private IdentityHashCodeWrapper(Object o) {
16 this.o = o;
17 }
18 public static IdentityHashCodeWrapper create(Object o) {
19 Assert._assert(o != null);
20 return new IdentityHashCodeWrapper(o);
21 }
22 public boolean equals(Object that) {
23 if (this == that) return true;
24 if (!(that instanceof IdentityHashCodeWrapper)) return false;
25 return this.o == ((IdentityHashCodeWrapper)that).o;
26 }
27 public int hashCode() {
28 return System.identityHashCode(o);
29 }
30
31 public Object getObject() { return o; }
32
33 }