jwutil.collections
Class UnmodifiableMultiMap

java.lang.Object
  extended by java.util.AbstractMap
      extended by jwutil.collections.UnmodifiableMultiMap
All Implemented Interfaces:
java.util.Map, BinaryRelation, MultiMap

public abstract class UnmodifiableMultiMap
extends java.util.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 1934 2004-09-27 22:42:35Z joewhaley $
Author:
Felix S. Klock II

Nested Class Summary
 
Nested classes/interfaces inherited from interface java.util.Map
java.util.Map.Entry<K,V>
 
Field Summary
static int DEFAULT_HISTOGRAM_SIZE
           
 
Constructor Summary
UnmodifiableMultiMap()
           
 
Method Summary
 boolean add(java.lang.Object key, java.lang.Object value)
          Throws UnsupportedOperationException.
 boolean addAll(MultiMap mm)
          Throws UnsupportedOperationException.
 boolean addAll(java.lang.Object key, java.util.Collection values)
          Throws UnsupportedOperationException.
 void clear()
          Throws UnsupportedOperationException.
static java.lang.String computeHistogram(MultiMap dis, int size, java.lang.String keyName, java.lang.String valueName)
           
 java.lang.String computeHistogram(java.lang.String keyName, java.lang.String valueName)
           
abstract  java.util.Set entrySet()
          Returns a Set view that allows you to recapture the MultiMap view.
protected  java.util.Set entrySetHelper(java.util.Set keys)
           
static MultiMap proxy(MultiMap mmap)
          Constructs and returns an unmodifiable MultiMap backed by mmap.
 java.lang.Object put(java.lang.Object key, java.lang.Object value)
          Throws UnsupportedOperationException.
 void putAll(java.util.Map t)
          Throws UnsupportedOperationException.
 java.lang.Object remove(java.lang.Object key)
          Throws UnsupportedOperationException.
 boolean remove(java.lang.Object key, java.lang.Object value)
          Throws UnsupportedOperationException.
 boolean removeAll(java.lang.Object key, java.util.Collection values)
          Throws UnsupportedOperationException.
 boolean retainAll(java.lang.Object key, java.util.Collection values)
          Throws UnsupportedOperationException.
 
Methods inherited from class java.util.AbstractMap
clone, containsKey, containsValue, 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 jwutil.collections.MultiMap
contains, get, getValues, size
 
Methods inherited from interface java.util.Map
containsKey, containsValue, equals, hashCode, isEmpty, keySet, values
 

Field Detail

DEFAULT_HISTOGRAM_SIZE

public static final int DEFAULT_HISTOGRAM_SIZE
See Also:
Constant Field Values
Constructor Detail

UnmodifiableMultiMap

public UnmodifiableMultiMap()
Method Detail

proxy

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


entrySet

public abstract java.util.Set entrySet()
Returns a Set view that allows you to recapture the MultiMap view.

Specified by:
entrySet in interface java.util.Map
Specified by:
entrySet in interface MultiMap
Specified by:
entrySet in class java.util.AbstractMap

entrySetHelper

protected java.util.Set entrySetHelper(java.util.Set keys)

put

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

Specified by:
put in interface java.util.Map
Specified by:
put in interface MultiMap
Overrides:
put in class java.util.AbstractMap

remove

public java.lang.Object remove(java.lang.Object key)
Throws UnsupportedOperationException.

Specified by:
remove in interface java.util.Map
Specified by:
remove in interface MultiMap
Overrides:
remove in class java.util.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(java.lang.Object key,
                      java.lang.Object value)
Throws UnsupportedOperationException.

Specified by:
remove in interface MultiMap

putAll

public void putAll(java.util.Map t)
Throws UnsupportedOperationException.

Specified by:
putAll in interface java.util.Map
Specified by:
putAll in interface MultiMap
Overrides:
putAll in class java.util.AbstractMap

clear

public void clear()
Throws UnsupportedOperationException.

Specified by:
clear in interface java.util.Map
Overrides:
clear in class java.util.AbstractMap

add

public boolean add(java.lang.Object key,
                   java.lang.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(java.lang.Object key,
                      java.util.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(java.lang.Object key,
                         java.util.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(java.lang.Object key,
                         java.util.Collection values)
Throws UnsupportedOperationException.

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

computeHistogram

public java.lang.String computeHistogram(java.lang.String keyName,
                                         java.lang.String valueName)
Specified by:
computeHistogram in interface MultiMap

computeHistogram

public static java.lang.String computeHistogram(MultiMap dis,
                                                int size,
                                                java.lang.String keyName,
                                                java.lang.String valueName)


Copyright © 2004-2008 SUIF Compiler Group. All Rights Reserved.