edu.stanford.nlp.util
Class CollectionValuedMap
java.lang.Object
edu.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
cf
protected CollectionFactory cf
mf
protected MapFactory mf
CollectionValuedMap
public CollectionValuedMap(MapFactory mf,
CollectionFactory cf,
boolean treatCollectionsAsImmutable)
CollectionValuedMap
public CollectionValuedMap(CollectionValuedMap cvm)
CollectionValuedMap
public CollectionValuedMap()
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