JUtil

net.cscott.jutil
Class UnmodifiableMap<K,V>

java.lang.Object
  extended by net.cscott.jutil.MapWrapper<K,V>
      extended by net.cscott.jutil.UnmodifiableMap<K,V>
All Implemented Interfaces:
Map<K,V>
Direct Known Subclasses:
UnmodifiableMultiMap

public abstract class UnmodifiableMap<K,V>
extends MapWrapper<K,V>

This wrapper for Maps implements Map.entrySet() so that it returns an UnmodifiableMapSet.

Version:
$Id: UnmodifiableMap.java,v 1.2 2006-10-30 16:19:00 cananian Exp $
Author:
C. Scott Ananian

Nested Class Summary
 
Nested classes/interfaces inherited from interface java.util.Map
Map.Entry<K,V>
 
Constructor Summary
protected UnmodifiableMap()
           
 
Method Summary
 void clear()
          Throws UnsupportedOperationException.
abstract  MapSet<K,V> entrySet()
           
 Set<K> keySet()
          Throws UnsupportedOperationException.
static
<K,V> UnmodifiableMap<K,V>
proxy(Map<K,V> m)
           
 V put(K k, V v)
          Throws UnsupportedOperationException.
 void putAll(Map<? extends K,? extends V> m)
          Throws UnsupportedOperationException.
 V remove(Object o)
          Throws UnsupportedOperationException.
 Collection<V> values()
           
 
Methods inherited from class net.cscott.jutil.MapWrapper
containsKey, containsValue, equals, get, hashCode, isEmpty, size, toString, wrapped
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

UnmodifiableMap

protected UnmodifiableMap()
Method Detail

proxy

public static <K,V> UnmodifiableMap<K,V> proxy(Map<K,V> m)

values

public Collection<V> values()
Specified by:
values in interface Map<K,V>
Overrides:
values in class MapWrapper<K,V>

entrySet

public abstract MapSet<K,V> entrySet()
Specified by:
entrySet in interface Map<K,V>
Overrides:
entrySet in class MapWrapper<K,V>

clear

public void clear()
Throws UnsupportedOperationException.

Specified by:
clear in interface Map<K,V>
Overrides:
clear in class MapWrapper<K,V>

keySet

public Set<K> keySet()
Throws UnsupportedOperationException.

Specified by:
keySet in interface Map<K,V>
Overrides:
keySet in class MapWrapper<K,V>

put

public V put(K k,
             V v)
Throws UnsupportedOperationException.

Specified by:
put in interface Map<K,V>
Overrides:
put in class MapWrapper<K,V>

putAll

public void putAll(Map<? extends K,? extends V> m)
Throws UnsupportedOperationException.

Specified by:
putAll in interface Map<K,V>
Overrides:
putAll in class MapWrapper<K,V>

remove

public V remove(Object o)
Throws UnsupportedOperationException.

Specified by:
remove in interface Map<K,V>
Overrides:
remove in class MapWrapper<K,V>

JUtil

Copyright (c) 2006 C. Scott Ananian