|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectiitb.con.util.MultiKeyHashMap<K1,K2,V>
public class MultiKeyHashMap<K1,K2,V>
MultiKeyHashMap provides to store values with two level hierarchy of keys, super key (K1) and sub key (K2). The objects are inserted using super and sub keys. It is not mandatory to use both keys as hierarchy, user can use two keys to store the values and use either of the key to retrieve it.
Constructor Summary | |
---|---|
MultiKeyHashMap()
Initializes the MultiKeyHashMap |
Method Summary | |
---|---|
void |
clear()
Clears the entire hash map |
boolean |
containsKey(K1 k1)
Returns true if value object is present for the specified (super)key K1 |
boolean |
containsKey(K1 k1,
K2 k2)
Returns true if value object is present for the specified (super)key K1 and (sub)key K2 |
java.util.Map<K2,V> |
get(K1 k1)
Gets the value object for the specified (super)key K1 |
V |
get(K1 k1,
K2 k2)
Gets the value object for the specified (super)key K1 and (sub)key K2 |
java.util.List<V> |
getAllItems()
Returns all the value objects in the MultiKeyHashMap |
V |
getBySubKey(K2 k2)
Gets the value object for the specified (sub)key K2 |
V |
put(K1 k1,
K2 k2,
V v)
Puts the value object based on the (super)key K1 and (sub)key K2 |
V |
remove(K1 k1,
K2 k2)
Removes the value object for the specified (super)key K1 and (sub)key K2 |
int |
size()
Size of MultiKeyHashMap |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MultiKeyHashMap()
Method Detail |
---|
public void clear()
public boolean containsKey(K1 k1)
k1
- key1 (super-key)
public boolean containsKey(K1 k1, K2 k2)
k1
- key1 (super-key)k2
- key2 (sub-key)
public java.util.Map<K2,V> get(K1 k1)
k1
- key1 (super-key)
public V get(K1 k1, K2 k2)
k1
- key1 (super-key)k2
- key2 (sub-key)
public java.util.List<V> getAllItems()
public V getBySubKey(K2 k2)
k2
- key2 (sub-key)
public V put(K1 k1, K2 k2, V v)
k1
- key1 (super-key)k2
- key2 (sub-key)v
- value object
public V remove(K1 k1, K2 k2)
k1
- key1 (super-key)k2
- key2 (sub-key)
public int size()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |