summaryrefslogtreecommitdiff
path: root/sources/ch/epfl/lamp
diff options
context:
space:
mode:
authorpaltherr <paltherr@epfl.ch>2003-07-26 10:30:03 +0000
committerpaltherr <paltherr@epfl.ch>2003-07-26 10:30:03 +0000
commitd73289451bd3e7a357f1147f69c49fc2644c376e (patch)
tree45e6fbb91c6bad97bdd8737f13087c033d6109a1 /sources/ch/epfl/lamp
parent69d94c439ca228d7bf51edad2440f84fc5f14483 (diff)
downloadscala-d73289451bd3e7a357f1147f69c49fc2644c376e.tar.gz
scala-d73289451bd3e7a357f1147f69c49fc2644c376e.tar.bz2
scala-d73289451bd3e7a357f1147f69c49fc2644c376e.zip
- Added ForwardingMap.java
Diffstat (limited to 'sources/ch/epfl/lamp')
-rw-r--r--sources/ch/epfl/lamp/util/ForwardingMap.java97
1 files changed, 97 insertions, 0 deletions
diff --git a/sources/ch/epfl/lamp/util/ForwardingMap.java b/sources/ch/epfl/lamp/util/ForwardingMap.java
new file mode 100644
index 0000000000..7efc3627b0
--- /dev/null
+++ b/sources/ch/epfl/lamp/util/ForwardingMap.java
@@ -0,0 +1,97 @@
+package ch.epfl.lamp.util;
+
+import java.util.Collection;
+import java.util.Map;
+import java.util.Set;
+
+/**
+ * This class implements the interface Map by forwarding all its
+ * operations to an underlying instance of Map.
+ */
+public class ForwardingMap implements Map {
+
+ //########################################################################
+ // Protected Fields
+
+ protected final Map delegate;
+
+ //########################################################################
+ // Public Constructors
+
+ public ForwardingMap(Map delegate) {
+ this.delegate = delegate;
+ }
+
+ //########################################################################
+ // Public Methods - Query operations
+
+ public int size() {
+ return delegate.size();
+ }
+
+ public boolean isEmpty() {
+ return delegate.isEmpty();
+ }
+
+ public boolean containsKey(Object key) {
+ return delegate.containsKey(key);
+ }
+
+ public boolean containsValue(Object value) {
+ return delegate.containsValue(value);
+ }
+
+ public Object get(Object key) {
+ return delegate.get(key);
+ }
+
+ //########################################################################
+ // Public Methods - Modification operations
+
+ public Object put(Object key, Object value) {
+ return delegate.put(key, value);
+ }
+
+ public Object remove(Object key) {
+ return delegate.remove(key);
+ }
+
+ //########################################################################
+ // Public Methods - Bulk operations
+
+ public void putAll(Map map) {
+ delegate.putAll(map);
+ }
+
+ public void clear() {
+ delegate.clear();
+ }
+
+ //########################################################################
+ // Public Methods - Views
+
+ public Set keySet() {
+ return delegate.keySet();
+ }
+
+ public Collection values() {
+ return delegate.values();
+ }
+
+ public Set entrySet() {
+ return delegate.entrySet();
+ }
+
+ //########################################################################
+ // Public Methods - Comparison and hashing
+
+ public boolean equals(Object that) {
+ return delegate.equals(that);
+ }
+
+ public int hashCode() {
+ return delegate.hashCode();
+ }
+
+ //########################################################################
+}