diff options
Diffstat (limited to 'src/net/pacien/util/IntrinsicMap.java')
-rw-r--r-- | src/net/pacien/util/IntrinsicMap.java | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/src/net/pacien/util/IntrinsicMap.java b/src/net/pacien/util/IntrinsicMap.java new file mode 100644 index 0000000..a68dcbe --- /dev/null +++ b/src/net/pacien/util/IntrinsicMap.java | |||
@@ -0,0 +1,59 @@ | |||
1 | /** | ||
2 | * | ||
3 | */ | ||
4 | package net.pacien.util; | ||
5 | |||
6 | import java.util.HashMap; | ||
7 | import java.util.Map; | ||
8 | |||
9 | /** | ||
10 | * @author pacien | ||
11 | * | ||
12 | */ | ||
13 | public class IntrinsicMap<K, V extends Mappable> extends HashMap<K, V> { | ||
14 | |||
15 | /** | ||
16 | * | ||
17 | */ | ||
18 | private static final long serialVersionUID = 1L; | ||
19 | |||
20 | /** | ||
21 | * | ||
22 | */ | ||
23 | public IntrinsicMap() { | ||
24 | super(); | ||
25 | } | ||
26 | |||
27 | /** | ||
28 | * @param initialCapacity | ||
29 | */ | ||
30 | public IntrinsicMap(int initialCapacity) { | ||
31 | super(initialCapacity); | ||
32 | } | ||
33 | |||
34 | /** | ||
35 | * @param m | ||
36 | */ | ||
37 | public IntrinsicMap(Map<? extends K, ? extends V> m) { | ||
38 | super(m); | ||
39 | } | ||
40 | |||
41 | /** | ||
42 | * @param initialCapacity | ||
43 | * @param loadFactor | ||
44 | */ | ||
45 | public IntrinsicMap(int initialCapacity, float loadFactor) { | ||
46 | super(initialCapacity, loadFactor); | ||
47 | } | ||
48 | |||
49 | @SuppressWarnings("unchecked") | ||
50 | public V put(V value) { | ||
51 | return super.put((K) value.getKey(), value); | ||
52 | } | ||
53 | |||
54 | @Override | ||
55 | public V put(K key, V value) { | ||
56 | return this.put(value); | ||
57 | } | ||
58 | |||
59 | } | ||