|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.util.AbstractMap<K,V> java.util.HashMap<PRIMARY_KEY,java.util.Map<SECONDARY_KEY,java.util.Map<TERTIARY_KEY,ITEM>>> cz.cuni.amis.utils.maps.HashTriMap<PRIMARY_KEY,SECONDARY_KEY,TERTIARY_KEY,ITEM>
PRIMARY_KEY
- SECONDARY_KEY
- TERTIARY_KEY
- ITEM
- public class HashTriMap<PRIMARY_KEY,SECONDARY_KEY,TERTIARY_KEY,ITEM>
Three-level thread-safe hash map, implemented via synchronized maps (Collections.synchronizedMap)
Nested Class Summary |
---|
Nested classes/interfaces inherited from class java.util.AbstractMap |
---|
java.util.AbstractMap.SimpleEntry<K,V>, java.util.AbstractMap.SimpleImmutableEntry<K,V> |
Constructor Summary | |
---|---|
HashTriMap()
|
|
HashTriMap(int primaryCapacity,
int secondaryCapacity,
int tertiaryCapacity)
|
Method Summary | |
---|---|
java.util.Map<SECONDARY_KEY,java.util.Map<TERTIARY_KEY,ITEM>> |
get(java.lang.Object primaryKey)
Returns a HashMap |
java.util.Map<TERTIARY_KEY,ITEM> |
get(PRIMARY_KEY primaryKey,
SECONDARY_KEY secondaryKey)
Returns the requested map, never returns null. |
ITEM |
get(PRIMARY_KEY primaryKey,
SECONDARY_KEY secondaryKey,
TERTIARY_KEY tertiaryKey)
Returns item specified, returns null if item does not appear in the map. |
void |
put(PRIMARY_KEY primaryKey,
SECONDARY_KEY secondaryKey,
TERTIARY_KEY tertiaryKey,
ITEM item)
Puts the item into the map. |
java.util.Map<SECONDARY_KEY,java.util.Map<TERTIARY_KEY,ITEM>> |
remove(java.lang.Object primaryKey)
Removes the requested map. |
java.util.Map<TERTIARY_KEY,ITEM> |
remove(PRIMARY_KEY primaryKey,
SECONDARY_KEY secondaryKey)
removes the map under primary and secondary key, if the map does not exist, the data structure is not changed and a new map is returned. |
ITEM |
remove(PRIMARY_KEY primaryKey,
SECONDARY_KEY secondaryKey,
TERTIARY_KEY tertiaryKey)
Returns the item under specified keys and removes it from the map, returns null if item is not present in the map. |
Methods inherited from class java.util.HashMap |
---|
clear, clone, containsKey, containsValue, entrySet, isEmpty, keySet, put, putAll, size, values |
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 |
---|
equals, hashCode |
Constructor Detail |
---|
public HashTriMap()
public HashTriMap(int primaryCapacity, int secondaryCapacity, int tertiaryCapacity)
Method Detail |
---|
public java.util.Map<SECONDARY_KEY,java.util.Map<TERTIARY_KEY,ITEM>> get(java.lang.Object primaryKey)
get
in interface java.util.Map<PRIMARY_KEY,java.util.Map<SECONDARY_KEY,java.util.Map<TERTIARY_KEY,ITEM>>>
get
in class java.util.HashMap<PRIMARY_KEY,java.util.Map<SECONDARY_KEY,java.util.Map<TERTIARY_KEY,ITEM>>>
primaryKey
-
public java.util.Map<TERTIARY_KEY,ITEM> get(PRIMARY_KEY primaryKey, SECONDARY_KEY secondaryKey)
primaryKey
- secondaryKey
-
public ITEM get(PRIMARY_KEY primaryKey, SECONDARY_KEY secondaryKey, TERTIARY_KEY tertiaryKey)
primaryKey
- secondaryKey
- tertiaryKey
-
public void put(PRIMARY_KEY primaryKey, SECONDARY_KEY secondaryKey, TERTIARY_KEY tertiaryKey, ITEM item)
primaryKey
- secondaryKey
- tertiaryKey
- item
- public java.util.Map<SECONDARY_KEY,java.util.Map<TERTIARY_KEY,ITEM>> remove(java.lang.Object primaryKey)
remove
in interface java.util.Map<PRIMARY_KEY,java.util.Map<SECONDARY_KEY,java.util.Map<TERTIARY_KEY,ITEM>>>
remove
in class java.util.HashMap<PRIMARY_KEY,java.util.Map<SECONDARY_KEY,java.util.Map<TERTIARY_KEY,ITEM>>>
public java.util.Map<TERTIARY_KEY,ITEM> remove(PRIMARY_KEY primaryKey, SECONDARY_KEY secondaryKey)
primaryKey
- secondaryKey
-
public ITEM remove(PRIMARY_KEY primaryKey, SECONDARY_KEY secondaryKey, TERTIARY_KEY tertiaryKey)
primaryKey
- secondaryKey
- tertiaryKey
-
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |