edu.stanford.nlp.util
Class CollectionValuedMap

java.lang.Object
  extended byedu.stanford.nlp.util.CollectionValuedMap
All Implemented Interfaces:
Map
Direct Known Subclasses:
DeltaCollectionValuedMap

public class CollectionValuedMap
extends Object
implements Map

User: Teg Grenager Date: Jan 12, 2004 Time: 9:15:53 AM


Nested Class Summary
 
Nested classes inherited from class java.util.Map
Map.Entry
 
Field Summary
protected  CollectionFactory cf
           
protected  MapFactory mf
           
 
Constructor Summary
CollectionValuedMap()
           
CollectionValuedMap(CollectionValuedMap cvm)
           
CollectionValuedMap(MapFactory mf, CollectionFactory cf, boolean treatCollectionsAsImmutable)
           
 
Method Summary
 void add(Object key, Object value)
          Adds the value to the Collection mapped to by the key.
 void addAll(Map m)
          Adds all of the mappings in m to this CollectionValuedMap.
 void clear()
           
 Object clone()
           
 boolean containsKey(Object key)
           
 boolean containsValue(Object value)
           
 Object deltaClone()
           
 Set entrySet()
           
 boolean equals(Object o)
           
 Object get(Object key)
           
 int hashCode()
           
 boolean isEmpty()
           
 Set keySet()
           
static void main(String[] args)
          For testing only.
 Object put(Object key, Object value)
           
 void putAll(Map m)
           
 Object remove(Object key)
           
 void removeMapping(Object key, Object value)
           
 int size()
           
 String toString()
           
 Collection values()
           
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

cf

protected CollectionFactory cf

mf

protected MapFactory mf
Constructor Detail

CollectionValuedMap

public CollectionValuedMap(MapFactory mf,
                           CollectionFactory cf,
                           boolean treatCollectionsAsImmutable)

CollectionValuedMap

public CollectionValuedMap(CollectionValuedMap cvm)

CollectionValuedMap

public CollectionValuedMap()
Method Detail

put

public Object put(Object key,
                  Object value)
Specified by:
put in interface Map

putAll

public void putAll(Map m)
Specified by:
putAll in interface Map

get

public Object get(Object key)
Specified by:
get in interface Map
Parameters:
key -
Returns:
the Collection mapped to by key.

add

public void add(Object key,
                Object value)
Adds the value to the Collection mapped to by the key.

Parameters:
key -
value -

addAll

public void addAll(Map m)
Adds all of the mappings in m to this CollectionValuedMap. If m is a CollectionValuedMap, it will behave strangely. Use the constructor instead.

Parameters:
m -

remove

public Object remove(Object key)
Specified by:
remove in interface Map

removeMapping

public void removeMapping(Object key,
                          Object value)

clear

public void clear()
Specified by:
clear in interface Map

containsKey

public boolean containsKey(Object key)
Specified by:
containsKey in interface Map

containsValue

public boolean containsValue(Object value)
Specified by:
containsValue in interface Map

isEmpty

public boolean isEmpty()
Specified by:
isEmpty in interface Map

entrySet

public Set entrySet()
Specified by:
entrySet in interface Map
Returns:
a set view of the mappings contained in this map.

keySet

public Set keySet()
Specified by:
keySet in interface Map

size

public int size()
Specified by:
size in interface Map

values

public Collection values()
Specified by:
values in interface Map

equals

public boolean equals(Object o)
Specified by:
equals in interface Map

hashCode

public int hashCode()
Specified by:
hashCode in interface Map

deltaClone

public Object deltaClone()

clone

public Object clone()

toString

public String toString()

main

public static void main(String[] args)
For testing only.

Parameters:
args - from command line


Stanford NLP Group