edu.stanford.nlp.util
Class DeltaCollectionValuedMap<K,V>

java.lang.Object
  extended by edu.stanford.nlp.util.CollectionValuedMap<K,V>
      extended by edu.stanford.nlp.util.DeltaCollectionValuedMap<K,V>
All Implemented Interfaces:
java.io.Serializable, java.util.Map<K,java.util.Collection<V>>

public class DeltaCollectionValuedMap<K,V>
extends CollectionValuedMap<K,V>

Implementation of CollectionValuedMap that appears to store an "original" map and changes to that map. No one currently uses it. See DeltaMap.

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
java.util.Map.Entry<K,V>
 
Field Summary
 
Fields inherited from class edu.stanford.nlp.util.CollectionValuedMap
cf, mf
 
Constructor Summary
DeltaCollectionValuedMap(CollectionValuedMap<K,V> originalMap)
           
 
Method Summary
 void add(K key, V value)
          Adds the value to the Collection mapped to by the key.
 void addAll(java.util.Map<K,V> m)
          Adds all of the mappings in m to this CollectionValuedMap.
 void clear()
          This is more expensive than normal.
 boolean containsKey(java.lang.Object key)
           
 boolean containsValue(java.lang.Object value)
          Unsupported.
 java.util.Set<java.util.Map.Entry<K,java.util.Collection<V>>> entrySet()
          This is cheap.
 java.util.Collection<V> get(java.lang.Object key)
           
 boolean isEmpty()
           
 java.util.Collection<V> put(K key, java.util.Collection<V> value)
          Replaces current Collection mapped to key with the specified Collection.
 void putAll(java.util.Map<? extends K,? extends java.util.Collection<V>> m)
          Unsupported.
 java.util.Collection<V> remove(java.lang.Object key)
          Removes the mapping associated with this key from this Map.
 void removeMapping(K key, V 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.
 java.util.Collection<java.util.Collection<V>> values()
           
 
Methods inherited from class edu.stanford.nlp.util.CollectionValuedMap
addAll, allValues, clone, deltaClone, equals, hashCode, keySet, main, removeAll, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DeltaCollectionValuedMap

public DeltaCollectionValuedMap(CollectionValuedMap<K,V> originalMap)
Method Detail

get

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

put

public java.util.Collection<V> put(K key,
                                   java.util.Collection<V> value)
Description copied from class: CollectionValuedMap
Replaces current Collection mapped to key with the specified Collection. Use carefully!

Specified by:
put in interface java.util.Map<K,java.util.Collection<V>>
Overrides:
put in class CollectionValuedMap<K,V>

putAll

public void putAll(java.util.Map<? extends K,? extends java.util.Collection<V>> m)
Description copied from class: CollectionValuedMap
Unsupported. Use CollectionValuedMap.addAll(Map) instead.

Specified by:
putAll in interface java.util.Map<K,java.util.Collection<V>>
Overrides:
putAll in class CollectionValuedMap<K,V>

add

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

Overrides:
add in class CollectionValuedMap<K,V>

addAll

public void addAll(java.util.Map<K,V> 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<K,V>

remove

public java.util.Collection<V> remove(java.lang.Object key)
Description copied from class: CollectionValuedMap
Removes the mapping associated with this key from this Map.

Specified by:
remove in interface java.util.Map<K,java.util.Collection<V>>
Overrides:
remove in class CollectionValuedMap<K,V>
Returns:
the Collection mapped to by this key.

removeMapping

public void removeMapping(K key,
                          V 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<K,V>
Parameters:
key - the key to the Collection to remove the value from
value - the value to remove

containsKey

public boolean containsKey(java.lang.Object key)
Specified by:
containsKey in interface java.util.Map<K,java.util.Collection<V>>
Overrides:
containsKey in class CollectionValuedMap<K,V>
Returns:
true iff this key is in this map

containsValue

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

Specified by:
containsValue in interface java.util.Map<K,java.util.Collection<V>>
Overrides:
containsValue in class CollectionValuedMap<K,V>

clear

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

Specified by:
clear in interface java.util.Map<K,java.util.Collection<V>>
Overrides:
clear in class CollectionValuedMap<K,V>

isEmpty

public boolean isEmpty()
Specified by:
isEmpty in interface java.util.Map<K,java.util.Collection<V>>
Overrides:
isEmpty in class CollectionValuedMap<K,V>
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 java.util.Map<K,java.util.Collection<V>>
Overrides:
size in class CollectionValuedMap<K,V>

values

public java.util.Collection<java.util.Collection<V>> values()
Specified by:
values in interface java.util.Map<K,java.util.Collection<V>>
Overrides:
values in class CollectionValuedMap<K,V>
Returns:
a collection of the values (really, a collection of values) in this Map

entrySet

public java.util.Set<java.util.Map.Entry<K,java.util.Collection<V>>> entrySet()
This is cheap.

Specified by:
entrySet in interface java.util.Map<K,java.util.Collection<V>>
Overrides:
entrySet in class CollectionValuedMap<K,V>
Returns:
a set view of the mappings contained in this map.


Stanford NLP Group