edu.buffalo.nsf.xmlcqa.util
Class MultiMap

java.lang.Object
  extended byjava.util.AbstractMap
      extended byjava.util.HashMap
          extended byedu.buffalo.nsf.xmlcqa.util.MultiMap
All Implemented Interfaces:
java.lang.Cloneable, java.util.Map, java.io.Serializable

public class MultiMap
extends java.util.HashMap

MultiMapImpl is a special implementation of the MultiMapinterface. A MultiMap is a Map with slightly different semantics. Instead of returning an Object, it returns a Collection. So for example, you can put( key, new Integer(1) ); and then a Object get( key ); will return you a Collection instead of an Integer. This implementation of MultiMap returns a Set, and therefore duplicates of elements contained under a particular key are ignored.

Author:
Slawomir Staworko
See Also:
Serialized Form

Constructor Summary
MultiMap(int initialCapacity)
           
 
Method Summary
 boolean containsValue(java.lang.Object value)
           
 java.lang.Object put(java.lang.Object key, java.lang.Object value)
           
 java.lang.Object remove(java.lang.Object key, java.lang.Object item)
           
 java.util.Collection values()
           
 
Methods inherited from class java.util.HashMap
clear, clone, containsKey, entrySet, get, isEmpty, keySet, putAll, remove, size
 
Methods inherited from class java.util.AbstractMap
equals, hashCode, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Map
equals, hashCode
 

Constructor Detail

MultiMap

public MultiMap(int initialCapacity)
Method Detail

containsValue

public boolean containsValue(java.lang.Object value)

put

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

remove

public java.lang.Object remove(java.lang.Object key,
                               java.lang.Object item)

values

public java.util.Collection values()