--- jsr166/src/test/loops/SMap.java 2005/05/09 19:33:30 1.2 +++ jsr166/src/test/loops/SMap.java 2012/10/21 06:40:21 1.6 @@ -1,19 +1,17 @@ /* * Written by Doug Lea with assistance from members of JCP JSR-166 * Expert Group and released to the public domain, as explained at - * http://creativecommons.org/licenses/publicdomain + * http://creativecommons.org/publicdomain/zero/1.0/ */ import java.util.*; import java.util.concurrent.*; import java.util.concurrent.locks.*; - /** * This is an incomplete implementation of a wrapper class * that places read-write locks around unsynchronized Maps. * Exists as a sample input for MapLoops test. */ - public class SMap implements Map { private final Map m; public SMap(Map m) { @@ -22,14 +20,14 @@ public class SMap implements Map { this.m = m; } - public SMap() { + public SMap() { this(new TreeMap()); // use TreeMap by default } public synchronized int size() { return m.size(); } - public synchronized boolean isEmpty(){ + public synchronized boolean isEmpty() { return m.isEmpty(); } @@ -40,7 +38,7 @@ public class SMap implements Map { public synchronized boolean containsKey(Object key) { return m.containsKey(key); } - public synchronized boolean containsValue(Object value){ + public synchronized boolean containsValue(Object value) { return m.containsValue(value); } @@ -48,15 +46,15 @@ public class SMap implements Map { public synchronized Set keySet() { // Not implemented return m.keySet(); } - + public synchronized Set entrySet() { // Not implemented return m.entrySet(); } - + public synchronized Collection values() { // Not implemented return m.values(); } - + public synchronized boolean equals(Object o) { return m.equals(o); } @@ -81,5 +79,5 @@ public class SMap implements Map { public synchronized void clear() { m.clear(); } - + }