|
|||||||||
| Home >> All >> com >> aendvari >> common >> [ util overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
com.aendvari.common.util
Class MultiHashMap

java.lang.Objectcom.aendvari.common.util.MultiHashMap
- All Implemented Interfaces:
- java.util.Map
- public class MultiHashMap
- extends java.lang.Object
- implements java.util.Map
- extends java.lang.Object
Implements java.util.Map using a java.util.HashMap. This Map class allows for multiple values for a single key.
Below is how the multi map is setup:
HASH_MAP
{
HASH_KEY => (
new Collection(
Object, Object, etc...
)
),
HASH_KEY => (
new Collection(
Object, Object, etc...
)
),
etc...
}
NOTE: This class DOES NOT implement the following:
- public void putAll(Map t)
| Nested Class Summary |
| Nested classes inherited from class java.util.Map |
java.util.Map.Entry |
| Field Summary | |
private java.util.HashMap |
map
The java.util.HashMap that this class uses |
| Constructor Summary | |
MultiHashMap()
Constructs a new, empty map with a default capacity and load factor, which is 0.75. |
|
MultiHashMap(int initialCapacity)
Constructs a new, empty map with the specified initial capacity and default load factor, which is 0.75. |
|
MultiHashMap(int initialCapacity,
float loadFactor)
Constructs a new, empty map with the specified initial capacity and the specified load factor. |
|
| Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface java.util.Map |
equals, hashCode |
| Field Detail |
map
private java.util.HashMap map
- The java.util.HashMap that this class uses
| Constructor Detail |
MultiHashMap
public MultiHashMap()
Constructs a new, empty map with a default capacity and load factor, which is 0.75.
MultiHashMap
public MultiHashMap(int initialCapacity)
Constructs a new, empty map with the specified initial capacity and default load factor, which is 0.75.
MultiHashMap
public MultiHashMap(int initialCapacity,
float loadFactor)
Constructs a new, empty map with the specified initial capacity and the specified load factor.
| Method Detail |
containsCollisionValue
public boolean containsCollisionValue(java.lang.Object value)
Determines if the given value matches any of the "collision" values
put
public java.lang.Object put(java.lang.Object key, java.lang.Object value)
- See HashMap.put(Object, Object)>
HashMap.put(Object, Object)55 . Places collided values into a Collection instead of replacing previous value.- Specified by:
putin interfacejava.util.Map
get
public java.util.Collection get(java.lang.String key)
- Get a Collection of the collided values at a give key.
getCollisionList
public java.util.Collection getCollisionList(java.lang.Object key)
- Returns the Collection of "collided" values.
putAll
public void putAll(java.util.Map t) throws java.lang.UnsupportedOperationException
This operation is not supported.
- Specified by:
putAllin interfacejava.util.Map
size
public int size()
- See HashMap.size()>
HashMap.size()55- Specified by:
sizein interfacejava.util.Map
size
public int size(java.lang.String key)
- Get the size of the collided values for a given key.
isEmpty
public boolean isEmpty()
- See HashMap.isEmpty()>
HashMap.isEmpty()55- Specified by:
isEmptyin interfacejava.util.Map
containsValue
public boolean containsValue(java.lang.Object value)
- See HashMap.containsValue(Object)>
HashMap.containsValue(Object)55- Specified by:
containsValuein interfacejava.util.Map
containsKey
public boolean containsKey(java.lang.Object key)
- See HashMap.containsKey(Object)>
HashMap.containsKey(Object)55- Specified by:
containsKeyin interfacejava.util.Map
get
public java.lang.Object get(java.lang.Object key)
- See HashMap.get(Object)>
HashMap.get(Object)55- Specified by:
getin interfacejava.util.Map
remove
public java.lang.Object remove(java.lang.Object key)
- See HashMap.remove(Object)>
HashMap.remove(Object)55- Specified by:
removein interfacejava.util.Map
clear
public void clear()
- See HashMap.clear()>
HashMap.clear()55- Specified by:
clearin interfacejava.util.Map
clone
public java.lang.Object clone()
keySet
public java.util.Set keySet()
- See HashMap.keySet()>
HashMap.keySet()55- Specified by:
keySetin interfacejava.util.Map
values
public java.util.Collection values()
- See HashMap.values()>
HashMap.values()55- Specified by:
valuesin interfacejava.util.Map
entrySet
public java.util.Set entrySet()
- See HashMap.entrySet()>
HashMap.entrySet()55- Specified by:
entrySetin interfacejava.util.Map
|
|||||||||
| Home >> All >> com >> aendvari >> common >> [ util overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
JAVADOC
com.aendvari.common.util.MultiHashMap