harpoon.Util.Collections
Class UnmodifiableMultiMap

java.lang.Object
  |
  +--java.util.AbstractMap
        |
        +--harpoon.Util.Collections.UnmodifiableMultiMap
All Implemented Interfaces:
BinaryRelation, Map, MultiMap

public abstract class UnmodifiableMultiMap
extends AbstractMap
implements MultiMap

UnmodifiableMultiMap is an abstract superclass to save developers the trouble of implementing the various mutator methds of the MultiMap interface.

Version:
$Id: UnmodifiableMultiMap.java,v 1.2 2002/02/25 21:09:15 cananian Exp $
Author:
Felix S. Klock II <pnkfelix@mit.edu>

Nested Class Summary
 
Nested classes inherited from class harpoon.Util.Collections.MultiMap
MultiMap.Factory
 
Nested classes inherited from class java.util.Map
Map.Entry
 
Constructor Summary
UnmodifiableMultiMap()
           
 
Method Summary
 boolean add(Object key, Object value)
          Throws UnsupportedOperationException.
 boolean addAll(MultiMap mm)
          Throws UnsupportedOperationException.
 boolean addAll(Object key, Collection values)
          Throws UnsupportedOperationException.
 void clear()
          Throws UnsupportedOperationException.
static MultiMap proxy(MultiMap mmap)
          Constructs and returns an unmodifiable MultiMap backed by mmap.
 Object put(Object key, Object value)
          Throws UnsupportedOperationException.
 void putAll(Map t)
          Throws UnsupportedOperationException.
 Object remove(Object key)
          Throws UnsupportedOperationException.
 boolean remove(Object key, Object value)
          Throws UnsupportedOperationException.
 boolean removeAll(Object key, Collection values)
          Throws UnsupportedOperationException.
 boolean retainAll(Object key, Collection values)
          Throws UnsupportedOperationException.
 
Methods inherited from class java.util.AbstractMap
clone, containsKey, containsValue, entrySet, equals, get, hashCode, isEmpty, keySet, size, toString, values
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface harpoon.Util.Collections.MultiMap
contains, get, getValues, size
 
Methods inherited from interface java.util.Map
containsKey, containsValue, entrySet, equals, hashCode, isEmpty, keySet, values
 

Constructor Detail

UnmodifiableMultiMap

public UnmodifiableMultiMap()
Method Detail

proxy

public static MultiMap proxy(MultiMap mmap)
Constructs and returns an unmodifiable MultiMap backed by mmap.


put

public Object put(Object key,
                  Object value)
Throws UnsupportedOperationException.

Specified by:
put in interface MultiMap
Overrides:
put in class AbstractMap

remove

public Object remove(Object key)
Throws UnsupportedOperationException.

Specified by:
remove in interface MultiMap
Overrides:
remove in class AbstractMap
Returns:
one of the previous values associated with the key, or null if Map associated no values with the key. Note that a zero-sized collection is not returned in the latter case, and that a null return value may be ambiguous if the map associated null with the given key (in addition to possibly other values).

remove

public boolean remove(Object key,
                      Object value)
Throws UnsupportedOperationException.

Specified by:
remove in interface MultiMap

putAll

public void putAll(Map t)
Throws UnsupportedOperationException.

Specified by:
putAll in interface MultiMap
Overrides:
putAll in class AbstractMap

clear

public void clear()
Throws UnsupportedOperationException.

Specified by:
clear in interface Map
Overrides:
clear in class AbstractMap

add

public boolean add(Object key,
                   Object value)
Throws UnsupportedOperationException.

Specified by:
add in interface MultiMap
Returns:
true if this mapping changed as a result of the call

addAll

public boolean addAll(Object key,
                      Collection values)
Throws UnsupportedOperationException.

Specified by:
addAll in interface MultiMap
Returns:
true if this mapping changed as a result of the call

addAll

public boolean addAll(MultiMap mm)
Throws UnsupportedOperationException.

Specified by:
addAll in interface MultiMap

retainAll

public boolean retainAll(Object key,
                         Collection values)
Throws UnsupportedOperationException.

Specified by:
retainAll in interface MultiMap
Returns:
true if this mapping changed as a result of the call

removeAll

public boolean removeAll(Object key,
                         Collection values)
Throws UnsupportedOperationException.

Specified by:
removeAll in interface MultiMap
Returns:
true if this mapping changed as a result of the call