|
TUM CCSM Commons | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.tum.cs.commons.collections.HybridMapBase<K,V>
public abstract class HybridMapBase<K,V>
A hybrid map is a map which starts with one map implementation, but switches to another one after a certain size is reached.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface java.util.Map |
|---|
Map.Entry<K,V> |
| Constructor Summary | |
|---|---|
protected |
HybridMapBase(Map<K,V> initialMap)
Constructor. |
| Method Summary | |
|---|---|
void |
clear()
|
boolean |
containsKey(Object key)
|
boolean |
containsValue(Object value)
|
Set<Map.Entry<K,V>> |
entrySet()
|
V |
get(Object key)
|
boolean |
isEmpty()
|
Set<K> |
keySet()
|
protected abstract Map<K,V> |
obtainNewMap()
Template method for obtaining a new map implementation after shouldSwitch(Map) returned true. |
V |
put(K key,
V value)
|
void |
putAll(Map<? extends K,? extends V> m)
|
V |
remove(Object key)
|
protected abstract boolean |
shouldSwitch(Map<K,V> map)
Template method for deciding that a switch of map implementation should be performed before the next insertion. |
int |
size()
|
Collection<V> |
values()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface java.util.Map |
|---|
equals, hashCode |
| Constructor Detail |
|---|
protected HybridMapBase(Map<K,V> initialMap)
| Method Detail |
|---|
protected abstract boolean shouldSwitch(Map<K,V> map)
obtainNewMap() and all values are copied.
map - the currently used map.protected abstract Map<K,V> obtainNewMap()
shouldSwitch(Map) returned true.
public void clear()
clear in interface Map<K,V>public boolean containsKey(Object key)
containsKey in interface Map<K,V>public boolean containsValue(Object value)
containsValue in interface Map<K,V>public Set<Map.Entry<K,V>> entrySet()
entrySet in interface Map<K,V>public V get(Object key)
get in interface Map<K,V>public boolean isEmpty()
isEmpty in interface Map<K,V>public Set<K> keySet()
keySet in interface Map<K,V>
public V put(K key,
V value)
put in interface Map<K,V>public void putAll(Map<? extends K,? extends V> m)
putAll in interface Map<K,V>public V remove(Object key)
remove in interface Map<K,V>public int size()
size in interface Map<K,V>public Collection<V> values()
values in interface Map<K,V>
|
TUM CCSM Commons | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||