From 1b3a2fb9cc274540bbfed0a9f29a512acfb7b9fe Mon Sep 17 00:00:00 2001 From: jochen Date: Mon, 28 Jun 1999 11:08:03 +0000 Subject: [PATCH] Use BasicMapEntry git-svn-id: https://svn.code.sf.net/p/jode/code/trunk@945 379699f6-c40d-0410-875b-85095c16579e --- jode/jode/util/SimpleMap.java | 38 ++++------------------------------- 1 file changed, 4 insertions(+), 34 deletions(-) diff --git a/jode/jode/util/SimpleMap.java b/jode/jode/util/SimpleMap.java index 4d532d9..3291dcc 100644 --- a/jode/jode/util/SimpleMap.java +++ b/jode/jode/util/SimpleMap.java @@ -49,41 +49,11 @@ public class SimpleMap extends AbstractMap { return backing; } - public static class SimpleEntry implements Map.Entry { - Object key; - Object value; - + public static class SimpleEntry extends BasicMapEntry { public SimpleEntry(Object key, Object value) { - this.key = key; - this.value = value; - } - - public Object getKey() { - return key; - } - - public Object getValue() { - return value; - } - - public Object setValue(Object newValue) { - Object old = value; - value = newValue; - return old; - } - - public int hashCode() { - return key.hashCode() ^ value.hashCode(); - } - - public boolean equals(Object o) { - if (o instanceof Map.Entry) { - Map.Entry e = (Map.Entry) o; - return key.equals(e.getKey()) && value.equals(e.getValue()); - } - return false; - } - } + super(key, value); + } + } public Object put(Object key, Object value) { for (Iterator i = backing.iterator();