01: /*
02: * Copyright 2004-2008 H2 Group. Licensed under the H2 License, Version 1.0
03: * (http://h2database.com/html/license.html).
04: * Initial Developer: H2 Group
05: */
06: package org.h2.util;
07:
08: import java.util.Collection;
09: import java.util.HashMap;
10:
11: /**
12: * A hash map with int keys and object values.
13: */
14: public class IntHashMap {
15: private final HashMap map = new HashMap();
16:
17: public Object get(int key) {
18: return map.get(ObjectUtils.getInteger(key));
19: }
20:
21: public void put(int key, Object value) {
22: map.put(ObjectUtils.getInteger(key), value);
23: }
24:
25: public void remove(int key) {
26: map.remove(ObjectUtils.getInteger(key));
27: }
28:
29: public int size() {
30: return map.size();
31: }
32:
33: public void clear() {
34: map.clear();
35: }
36:
37: public Collection values() {
38: return map.values();
39: }
40: }
|