1 8 package org.jboss.axis.utils; 9 10 import java.util.HashMap ; 11 import java.util.Map ; 12 13 18 public class IdentityHashMap extends HashMap 19 { 20 26 public IdentityHashMap(int initialCapacity, float loadFactor) 27 { 28 super(initialCapacity, loadFactor); 29 } 30 31 36 public IdentityHashMap(int initialCapacity) 37 { 38 super(initialCapacity); 39 } 40 41 44 public IdentityHashMap() 45 { 46 super(); 47 } 48 49 54 public IdentityHashMap(Map t) 55 { 56 super(t); 57 } 58 59 62 public Object get(Object key) 63 { 64 return super.get(new IDKey(key)); 65 } 66 67 70 public Object put(Object key, Object value) 71 { 72 return super.put(new IDKey(key), value); 73 } 74 75 78 public Object add(Object value) 79 { 80 Object key = new IDKey(value); 81 if (!super.containsKey(key)) 82 { 83 return super.put(key, value); 84 } 85 else 86 return null; 87 88 } 89 90 93 public Object remove(Object key) 94 { 95 return super.remove(new IDKey(key)); 96 } 97 98 101 public boolean containsKey(Object key) 102 { 103 return super.containsKey(new IDKey(key)); 104 } 105 } 106 | Popular Tags |