edu.stanford.nlp.util
Class DeltaCollectionValuedMap

java.lang.Object
  extended by edu.stanford.nlp.util.CollectionValuedMap
      extended by edu.stanford.nlp.util.DeltaCollectionValuedMap
All Implemented Interfaces:
Serializable, Map

public class DeltaCollectionValuedMap
extends CollectionValuedMap

Author:
Teg Grenager (grenager@cs.stanford.edu) Date: Jan 14, 2004 Time: 10:40:57 AM
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from interface java.util.Map
Map.Entry<K,V>
 
Field Summary
 
Fields inherited from class edu.stanford.nlp.util.CollectionValuedMap
mf
 
Constructor Summary
DeltaCollectionValuedMap(CollectionValuedMap originalMap)
           
 
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()
          This is more expensive than normal.
 boolean containsKey(Object key)
           
 boolean containsValue(Object value)
          Unsupported.
 Set entrySet()
          This is cheap.
 Collection get(Object key)
           
 boolean isEmpty()
           
 Collection put(Object key, Collection value)
          Replaces current Collection mapped to key with the specified Collection.
 void putAll(Map m)
          Unsupported.
 Collection remove(Object key)
          Removes the mapping associated with this key from this Map.
 void removeMapping(Object key, Object value)
          Removes the value from the Collection mapped to by this key, leaving the rest of the collection intact.
 int size()
          The number of keys in this map.
 Collection values()
          Unsupported.
 
Methods inherited from class edu.stanford.nlp.util.CollectionValuedMap
allValues, clone, deltaClone, equals, hashCode, keySet, main, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DeltaCollectionValuedMap

public DeltaCollectionValuedMap(CollectionValuedMap originalMap)
Method Detail

get

public Collection get(Object key)
Specified by:
get in interface Map
Overrides:
get in class CollectionValuedMap
Returns:
the Collection mapped to by key, never null, but may be empty.

put

public Collection put(Object key,
                      Collection value)
Description copied from class: CollectionValuedMap
Replaces current Collection mapped to key with the specified Collection. Use carefully!

Overrides:
put in class CollectionValuedMap

putAll

public void putAll(Map m)
Description copied from class: CollectionValuedMap
Unsupported. Use CollectionValuedMap.addAll(Map) instead.

Specified by:
putAll in interface Map
Overrides:
putAll in class CollectionValuedMap

add

public void add(Object key,
                Object value)
Description copied from class: CollectionValuedMap
Adds the value to the Collection mapped to by the key.

Overrides:
add in class CollectionValuedMap

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.

Overrides:
addAll in class CollectionValuedMap
Parameters:
m -

remove

public Collection remove(Object key)
Description copied from class: CollectionValuedMap
Removes the mapping associated with this key from this Map.

Specified by:
remove in interface Map
Overrides:
remove in class CollectionValuedMap
Returns:
the Collection mapped to by this key.

removeMapping

public void removeMapping(Object key,
                          Object value)
Description copied from class: CollectionValuedMap
Removes the value from the Collection mapped to by this key, leaving the rest of the collection intact.

Overrides:
removeMapping in class CollectionValuedMap
Parameters:
key - the key to the Collection to remove the value from
value - the value to remove

containsKey

public boolean containsKey(Object key)
Specified by:
containsKey in interface Map
Overrides:
containsKey in class CollectionValuedMap
Returns:
true iff this key is in this map

containsValue

public boolean containsValue(Object value)
Description copied from class: CollectionValuedMap
Unsupported.

Specified by:
containsValue in interface Map
Overrides:
containsValue in class CollectionValuedMap

clear

public void clear()
This is more expensive than normal.

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

isEmpty

public boolean isEmpty()
Specified by:
isEmpty in interface Map
Overrides:
isEmpty in class CollectionValuedMap
Returns:
true iff this Map has no mappings in it.

size

public int size()
Description copied from class: CollectionValuedMap
The number of keys in this map.

Specified by:
size in interface Map
Overrides:
size in class CollectionValuedMap

values

public Collection values()
Description copied from class: CollectionValuedMap
Unsupported.

Specified by:
values in interface Map
Overrides:
values in class CollectionValuedMap

entrySet

public Set entrySet()
This is cheap.

Specified by:
entrySet in interface Map
Overrides:
entrySet in class CollectionValuedMap
Returns:
a set view of the mappings contained in this map.


Stanford NLP Group