diff options
Diffstat (limited to 'sources/ch/epfl/lamp/util/StackedMap.java')
-rw-r--r-- | sources/ch/epfl/lamp/util/StackedMap.java | 47 |
1 files changed, 0 insertions, 47 deletions
diff --git a/sources/ch/epfl/lamp/util/StackedMap.java b/sources/ch/epfl/lamp/util/StackedMap.java deleted file mode 100644 index 171976d7a0..0000000000 --- a/sources/ch/epfl/lamp/util/StackedMap.java +++ /dev/null @@ -1,47 +0,0 @@ -package ch.epfl.lamp.util; - -import java.util.*; - -/** - * A stack of hash maps. - * - * @author Michel Schinz - * @version 1.0 - */ - -public class StackedHashMap extends AbstractMap implements Map { - protected LinkedList/*<HashMap>*/ maps = new LinkedList(); - protected HashMap topmostMap = new HashMap(); - - public void push() { - maps.addFirst(topmostMap); - topmostMap = new HashMap(topmostMap); - } - - public void push(Map map) { - push(); - topmostMap.putAll(map); - } - - public void pop() { - topmostMap = (HashMap)maps.removeFirst(); - } - - public Object put(Object key, Object value) { - return topmostMap.put(key, value); - } - - public void putAll(Object[] keys, Object[] values) { - assert keys.length == values.length; - for (int i = 0; i < keys.length; ++i) - topmostMap.put(keys[i], values[i]); - } - - public Object get(Object key) { - return topmostMap.get(key); - } - - public Set entrySet() { - return topmostMap.entrySet(); - } -} |