org.apache.commons.collections
Class MultiHashMap
java.lang.Object
|
+--java.util.AbstractMap
|
+--java.util.HashMap
|
+--org.apache.commons.collections.MultiHashMap
- All Implemented Interfaces:
- Cloneable, Map, MultiMap, Serializable
- public class MultiHashMap
- extends HashMap
- implements MultiMap
MultiHashMap is the default implementation of the
MultiMap interface.
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.
- Since:
- 2.0
- Author:
- Christopher Berry, James Strachan, Steve Downey, Stephen Colebourne
- See Also:
- Serialized Form
MultiHashMap
public MultiHashMap()
MultiHashMap
public MultiHashMap(int initialCapacity)
MultiHashMap
public MultiHashMap(int initialCapacity,
float loadFactor)
MultiHashMap
public MultiHashMap(Map mapToCopy)
clear
public void clear()
- Specified by:
clear in interface Map- Overrides:
clear in class HashMap
clone
public Object clone()
- Overrides:
clone in class HashMap
containsValue
public boolean containsValue(Object value)
- Specified by:
containsValue in interface Map- Overrides:
containsValue in class HashMap
getName
public String getName()
put
public Object put(Object key,
Object value)
- Specified by:
put in interface Map- Overrides:
put in class HashMap
putAll
public void putAll(Map mapToPut)
- Specified by:
putAll in interface Map- Overrides:
putAll in class HashMap
remove
public Object remove(Object key,
Object item)
- Specified by:
remove in interface MultiMap
values
public Collection values()
- Specified by:
values in interface Map- Overrides:
values in class HashMap
Copyright © 2001-2002 Apache Software Foundation. Documenation generated February 22 2003.