public class MemoryEfficientStringMap<V> extends HybridMapBase<java.lang.String,V>
ArrayBackedStringMap
while only a small number of
keys are present and switches to a HashMap
after a certain size has
been reached.Constructor and Description |
---|
MemoryEfficientStringMap()
Constructor.
|
MemoryEfficientStringMap(java.util.Map<? extends java.lang.String,? extends V> map)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
protected java.util.Map<java.lang.String,V> |
obtainNewMap()
Template method for obtaining a new map implementation after
HybridMapBase.shouldSwitch(Map) returned true. |
protected boolean |
shouldSwitch(java.util.Map<java.lang.String,V> map)
Template method for deciding that a switch of map implementation should
be performed before the next insertion.
|
clear, containsKey, containsValue, entrySet, get, isEmpty, keySet, put, putAll, remove, size, toString, values
public MemoryEfficientStringMap()
public MemoryEfficientStringMap(java.util.Map<? extends java.lang.String,? extends V> map)
protected java.util.Map<java.lang.String,V> obtainNewMap()
HybridMapBase.shouldSwitch(Map)
returned true.obtainNewMap
in class HybridMapBase<java.lang.String,V>
protected boolean shouldSwitch(java.util.Map<java.lang.String,V> map)
HybridMapBase.obtainNewMap()
and all values are copied.shouldSwitch
in class HybridMapBase<java.lang.String,V>
map
- the currently used map.