PRIMARY_KEY
- SECONDARY_KEY
- TERTIARY_KEY
- ITEM
- public class WeakHashTriMap<PRIMARY_KEY,SECONDARY_KEY,TERTIARY_KEY,ITEM> extends WeakHashMap<PRIMARY_KEY,Map<SECONDARY_KEY,Map<TERTIARY_KEY,ITEM>>>
WeakHashMap
.
This means, that the PRIMARY_KEY maps, may be garbage collected unless there is a direct reference to the PRIMARY_KEY.AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>
Constructor and Description |
---|
WeakHashTriMap()
Creates a WeakHashTriMap with default loadFactor(0.75) and default starting capacities (16,16,16)
|
WeakHashTriMap(int primaryCapacity,
int secondaryCapacity,
int tertiaryCapacity)
Creates a new WeakHashTriMap with the default loadFactor (0.75) for all levels and the provided starting capacties for different levels.
|
Modifier and Type | Method and Description |
---|---|
Map<SECONDARY_KEY,Map<TERTIARY_KEY,ITEM>> |
get(Object primaryKey)
Returns a HashMap
|
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.
|
Map<SECONDARY_KEY,Map<TERTIARY_KEY,ITEM>> |
remove(Object primaryKey)
Removes the requested map.
|
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.
|
clear, containsKey, containsValue, entrySet, isEmpty, keySet, put, putAll, size, values
clone, equals, hashCode, toString
public WeakHashTriMap()
public WeakHashTriMap(int primaryCapacity, int secondaryCapacity, int tertiaryCapacity)
primaryCapacity
- secondaryCapacity
- tertiaryCapacity
- public Map<SECONDARY_KEY,Map<TERTIARY_KEY,ITEM>> get(Object primaryKey)
get
in interface Map<PRIMARY_KEY,Map<SECONDARY_KEY,Map<TERTIARY_KEY,ITEM>>>
get
in class WeakHashMap<PRIMARY_KEY,Map<SECONDARY_KEY,Map<TERTIARY_KEY,ITEM>>>
primaryKey
- public 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 Map<SECONDARY_KEY,Map<TERTIARY_KEY,ITEM>> remove(Object primaryKey)
remove
in interface Map<PRIMARY_KEY,Map<SECONDARY_KEY,Map<TERTIARY_KEY,ITEM>>>
remove
in class WeakHashMap<PRIMARY_KEY,Map<SECONDARY_KEY,Map<TERTIARY_KEY,ITEM>>>
public 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
- Copyright © 2012 AMIS research group, Faculty of Mathematics and Physics, Charles University in Prague, Czech Republic. All Rights Reserved.