import java.util.Collection; import java.util.Map; import java.util.Set; /** * An abstract class for a class implementing a map in which the most * important operations of the Map interface are supported, but all others are * not supported and result in errors if called. Dummy methods for unsupported * operations are defined here. * * @author Sean Barker * @param The type of the keys stored in the map. * @param The type of the values stored in the map. */ public abstract class AbstractSimpleMap implements Map { @Override public void putAll(Map m) { throw new UnsupportedOperationException("operation not supported"); } @Override public void clear() { throw new UnsupportedOperationException("operation not supported"); } @Override public Set keySet() { throw new UnsupportedOperationException("operation not supported"); } @Override public boolean containsValue(Object value) { throw new UnsupportedOperationException("operation not supported"); } @Override public Collection values() { throw new UnsupportedOperationException("operation not supported"); } @Override public Set> entrySet() { throw new UnsupportedOperationException("operation not supported"); } }