1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package com.googlecode.mgwt.collection.shared.java;
17
18 import java.util.HashMap;
19 import java.util.Set;
20
21 import com.googlecode.mgwt.collection.shared.LightArray;
22 import com.googlecode.mgwt.collection.shared.LightMap;
23
24
25
26
27
28
29
30
31 public class JavaLightMap<V> implements LightMap<V> {
32
33 private HashMap<String, V> map;
34
35
36
37
38 public JavaLightMap() {
39 map = new HashMap<String, V>();
40 }
41
42 @Override
43 public void clear() {
44 map.clear();
45
46 }
47
48 @Override
49 public boolean containsKey(String key) {
50 return map.containsKey(key);
51 }
52
53 @Override
54 public LightArray<String> getKeys() {
55 Set<String> keySet = map.keySet();
56 return JavaLightArray.fromSet(keySet);
57 }
58
59 @Override
60 public void remove(String key) {
61 map.remove(key);
62 }
63
64 @Override
65 public V get(String key) {
66 return map.get(key);
67 }
68
69 @Override
70 public void put(String key, V value) {
71 map.put(key, value);
72 }
73
74 }