cz.cuni.amis.utils.maps
Class WeakHashQuadMap<PRIMARY_KEY,SECONDARY_KEY,TERTIARY_KEY,QUATERNARY_KEY,ITEM>
java.lang.Object
java.util.AbstractMap<K,V>
java.util.WeakHashMap<PRIMARY_KEY,Map<SECONDARY_KEY,Map<TERTIARY_KEY,Map<QUATERNARY_KEY,ITEM>>>>
cz.cuni.amis.utils.maps.WeakHashQuadMap<PRIMARY_KEY,SECONDARY_KEY,TERTIARY_KEY,QUATERNARY_KEY,ITEM>
- Type Parameters:
PRIMARY_KEY
- SECONDARY_KEY
- TERTIARY_KEY
- QUATERNARY_KEY
- ITEM
-
- All Implemented Interfaces:
- Map<PRIMARY_KEY,Map<SECONDARY_KEY,Map<TERTIARY_KEY,Map<QUATERNARY_KEY,ITEM>>>>
public class WeakHashQuadMap<PRIMARY_KEY,SECONDARY_KEY,TERTIARY_KEY,QUATERNARY_KEY,ITEM>
- extends WeakHashMap<PRIMARY_KEY,Map<SECONDARY_KEY,Map<TERTIARY_KEY,Map<QUATERNARY_KEY,ITEM>>>>
A 4-level hashMap, the PrimaryKeys are weakly referenced.
Get methods of all levels assure that the corresponding maps are created.
- Author:
- srlok
Method Summary |
Map<SECONDARY_KEY,Map<TERTIARY_KEY,Map<QUATERNARY_KEY,ITEM>>> |
get(Object key)
|
Map<TERTIARY_KEY,Map<QUATERNARY_KEY,ITEM>> |
get(PRIMARY_KEY primaryKey,
SECONDARY_KEY secondaryKey)
If the requested secondLevel map does not exist an empty one is created, inserted
according to the primaryKey and returned. |
Map<QUATERNARY_KEY,ITEM> |
get(PRIMARY_KEY primaryKey,
SECONDARY_KEY secondaryKey,
TERTIARY_KEY tertiaryKey)
If the requested level 3 map does not exist
an empty one is created, inserted and returned. |
ITEM |
get(PRIMARY_KEY primaryKey,
SECONDARY_KEY secondaryKey,
TERTIARY_KEY tertiaryKey,
QUATERNARY_KEY quaternaryKey)
Returns null if the mapping is not present. |
ITEM |
put(PRIMARY_KEY primaryKey,
SECONDARY_KEY secondaryKey,
TERTIARY_KEY tertiaryKey,
QUATERNARY_KEY quaternaryKey,
ITEM item)
Returns the inserted item. |
Map<SECONDARY_KEY,Map<TERTIARY_KEY,Map<QUATERNARY_KEY,ITEM>>> |
remove(Object key)
|
Map<TERTIARY_KEY,Map<QUATERNARY_KEY,ITEM>> |
remove(PRIMARY_KEY primaryKey,
SECONDARY_KEY secondaryKey)
|
Map<QUATERNARY_KEY,ITEM> |
remove(PRIMARY_KEY primaryKey,
SECONDARY_KEY secondaryKey,
TERTIARY_KEY tertiaryKey)
|
ITEM |
remove(PRIMARY_KEY primaryKey,
SECONDARY_KEY secondaryKey,
TERTIARY_KEY tertiaryKey,
QUATERNARY_KEY quaternaryKey)
|
WeakHashQuadMap
public WeakHashQuadMap()
WeakHashQuadMap
public WeakHashQuadMap(int primaryCapacity,
int secondaryCapacity,
int tertiaryCapacity,
int quaternaryCapacity)
get
public Map<SECONDARY_KEY,Map<TERTIARY_KEY,Map<QUATERNARY_KEY,ITEM>>> get(Object key)
- Specified by:
get
in interface Map<PRIMARY_KEY,Map<SECONDARY_KEY,Map<TERTIARY_KEY,Map<QUATERNARY_KEY,ITEM>>>>
- Overrides:
get
in class WeakHashMap<PRIMARY_KEY,Map<SECONDARY_KEY,Map<TERTIARY_KEY,Map<QUATERNARY_KEY,ITEM>>>>
get
public Map<TERTIARY_KEY,Map<QUATERNARY_KEY,ITEM>> get(PRIMARY_KEY primaryKey,
SECONDARY_KEY secondaryKey)
- If the requested secondLevel map does not exist an empty one is created, inserted
according to the primaryKey and returned.
- Parameters:
primaryKey
- secondaryKey
-
- Returns:
get
public Map<QUATERNARY_KEY,ITEM> get(PRIMARY_KEY primaryKey,
SECONDARY_KEY secondaryKey,
TERTIARY_KEY tertiaryKey)
- If the requested level 3 map does not exist
an empty one is created, inserted and returned.
- Parameters:
primaryKey
- secondaryKey
- tertiaryKey
-
- Returns:
get
public ITEM get(PRIMARY_KEY primaryKey,
SECONDARY_KEY secondaryKey,
TERTIARY_KEY tertiaryKey,
QUATERNARY_KEY quaternaryKey)
- Returns null if the mapping is not present.
- Parameters:
primaryKey
- secondaryKey
- tertiaryKey
- quaternaryKey
-
- Returns:
put
public ITEM put(PRIMARY_KEY primaryKey,
SECONDARY_KEY secondaryKey,
TERTIARY_KEY tertiaryKey,
QUATERNARY_KEY quaternaryKey,
ITEM item)
- Returns the inserted item.
- Parameters:
primaryKey
- secondaryKey
- tertiaryKey
- quaternaryKey
- item
-
- Returns:
remove
public Map<SECONDARY_KEY,Map<TERTIARY_KEY,Map<QUATERNARY_KEY,ITEM>>> remove(Object key)
- Specified by:
remove
in interface Map<PRIMARY_KEY,Map<SECONDARY_KEY,Map<TERTIARY_KEY,Map<QUATERNARY_KEY,ITEM>>>>
- Overrides:
remove
in class WeakHashMap<PRIMARY_KEY,Map<SECONDARY_KEY,Map<TERTIARY_KEY,Map<QUATERNARY_KEY,ITEM>>>>
remove
public Map<TERTIARY_KEY,Map<QUATERNARY_KEY,ITEM>> remove(PRIMARY_KEY primaryKey,
SECONDARY_KEY secondaryKey)
remove
public Map<QUATERNARY_KEY,ITEM> remove(PRIMARY_KEY primaryKey,
SECONDARY_KEY secondaryKey,
TERTIARY_KEY tertiaryKey)
remove
public ITEM remove(PRIMARY_KEY primaryKey,
SECONDARY_KEY secondaryKey,
TERTIARY_KEY tertiaryKey,
QUATERNARY_KEY quaternaryKey)
Copyright © 2012 AMIS research group, Faculty of Mathematics and Physics, Charles University in Prague, Czech Republic. All Rights Reserved.