aboutsummaryrefslogtreecommitdiff
path: root/src/net
diff options
context:
space:
mode:
authorPacien TRAN-GIRARD2014-05-07 17:09:45 +0200
committerPacien TRAN-GIRARD2014-05-07 17:09:45 +0200
commit2b9c7ce7e2a08464e412be2841f00f6524cef437 (patch)
treede55c712f48636d88b7240e4222e2e2e0274bd22 /src/net
parent39dd450b8b252cf5231918f6a03d4d9bf9cf4569 (diff)
downloadesieequest-2b9c7ce7e2a08464e412be2841f00f6524cef437.tar.gz
Reimplement Inventory (ItemList)
Diffstat (limited to 'src/net')
-rw-r--r--src/net/pacien/util/IntrinsicMap.java10
-rw-r--r--src/net/pacien/util/Mappable.java4
2 files changed, 5 insertions, 9 deletions
diff --git a/src/net/pacien/util/IntrinsicMap.java b/src/net/pacien/util/IntrinsicMap.java
index fe59ac2..c09965d 100644
--- a/src/net/pacien/util/IntrinsicMap.java
+++ b/src/net/pacien/util/IntrinsicMap.java
@@ -1,6 +1,3 @@
1/**
2 *
3 */
4package net.pacien.util; 1package net.pacien.util;
5 2
6import java.util.Collection; 3import java.util.Collection;
@@ -11,12 +8,12 @@ import java.util.Map;
11 * @author pacien 8 * @author pacien
12 * 9 *
13 */ 10 */
14public class IntrinsicMap<K, V extends Mappable> extends HashMap<K, V> { 11public class IntrinsicMap<K, V extends Mappable<K>> extends HashMap<K, V> {
15 12
16 /** 13 /**
17 * 14 *
18 */ 15 */
19 private static final long serialVersionUID = 1L; 16 private static final long serialVersionUID = 804991277001317260L;
20 17
21 /** 18 /**
22 * 19 *
@@ -47,9 +44,8 @@ public class IntrinsicMap<K, V extends Mappable> extends HashMap<K, V> {
47 super(initialCapacity, loadFactor); 44 super(initialCapacity, loadFactor);
48 } 45 }
49 46
50 @SuppressWarnings("unchecked")
51 public V put(final V value) { 47 public V put(final V value) {
52 return super.put((K) value.getKey(), value); 48 return super.put(value.getKey(), value);
53 } 49 }
54 50
55 @Override 51 @Override
diff --git a/src/net/pacien/util/Mappable.java b/src/net/pacien/util/Mappable.java
index b5bbf06..804a275 100644
--- a/src/net/pacien/util/Mappable.java
+++ b/src/net/pacien/util/Mappable.java
@@ -1,7 +1,7 @@
1package net.pacien.util; 1package net.pacien.util;
2 2
3public interface Mappable { 3public interface Mappable<K> {
4 4
5 public Object getKey(); 5 public K getKey();
6 6
7} 7}