org.apache.commons.collections
Class MultiHashMap
java.lang.Object
java.util.AbstractMap
java.util.HashMap
org.apache.commons.collections.MultiHashMap
- All Implemented Interfaces:
- java.lang.Cloneable, java.util.Map, MultiMap, java.io.Serializable
- public class MultiHashMap
- extends java.util.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, , Steve Downey, Stephen Colebourne
- See Also:
- Serialized Form
| Nested classes inherited from class java.util.HashMap |
|
| Nested classes inherited from class java.util.AbstractMap |
|
| Nested classes inherited from class java.util.Map |
java.util.Map.Entry |
| Field Summary |
private java.lang.String |
mName
|
private static int |
sCount
|
| Fields inherited from class java.util.HashMap |
|
| Fields inherited from class java.util.AbstractMap |
|
| Method Summary |
void |
clear()
|
java.lang.Object |
clone()
|
boolean |
containsValue(java.lang.Object value)
|
java.lang.String |
getName()
|
java.lang.Object |
put(java.lang.Object key, java.lang.Object value)
|
void |
putAll(java.util.Map mapToPut)
|
java.lang.Object |
remove(java.lang.Object key, java.lang.Object item)
|
private void |
setName()
|
java.util.Collection |
values()
|
| Methods inherited from class java.util.HashMap |
containsKey, entrySet, get, isEmpty, keySet, remove, size |
| Methods inherited from class java.util.AbstractMap |
equals, hashCode, toString |
| Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface java.util.Map |
containsKey, entrySet, equals, get, hashCode, isEmpty, keySet, remove, size |
sCount
private static int sCount
-
mName
private java.lang.String mName
-
MultiHashMap
public MultiHashMap()
MultiHashMap
public MultiHashMap(int initialCapacity)
MultiHashMap
public MultiHashMap(int initialCapacity,
float loadFactor)
MultiHashMap
public MultiHashMap(java.util.Map mapToCopy)
setName
private void setName()
-
-
getName
public java.lang.String getName()
-
-
put
public java.lang.Object put(java.lang.Object key,
java.lang.Object value)
-
- Specified by:
put in interface java.util.Map
-
containsValue
public boolean containsValue(java.lang.Object value)
-
- Specified by:
containsValue in interface java.util.Map
-
remove
public java.lang.Object remove(java.lang.Object key,
java.lang.Object item)
-
- Specified by:
remove in interface MultiMap
-
clear
public void clear()
-
- Specified by:
clear in interface java.util.Map
-
putAll
public void putAll(java.util.Map mapToPut)
-
- Specified by:
putAll in interface java.util.Map
-
values
public java.util.Collection values()
-
- Specified by:
values in interface java.util.Map
-
clone
public java.lang.Object clone()
-
-
Please see keelframework.org for information about new Keel releases.