1 11 package org.eclipse.jface.viewers.deferred; 12 13 import java.util.HashMap ; 14 15 23 class IntHashMap { 24 private HashMap map; 25 26 30 public IntHashMap(int size, float loadFactor) { 31 map = new HashMap (size, loadFactor); 32 } 33 34 37 public IntHashMap() { 38 map = new HashMap (); 39 } 40 41 44 public void remove(Object key) { 45 map.remove(key); 46 } 47 48 52 public void put(Object key, int value) { 53 map.put(key, new Integer (value)); 54 } 55 56 60 public int get(Object key) { 61 return get(key, 0); 62 } 63 64 69 public int get(Object key, int defaultValue) { 70 Integer result = (Integer )map.get(key); 71 72 if (result != null) { 73 return result.intValue(); 74 } 75 76 return defaultValue; 77 } 78 79 83 public boolean containsKey(Object key) { 84 return map.containsKey(key); 85 } 86 87 90 public int size() { 91 return map.size(); 92 } 93 } 94 | Popular Tags |