Package com.ibm.wala.util.collections
Class BimodalMap<K,V>
java.lang.Object
com.ibm.wala.util.collections.BimodalMap<K,V>
- All Implemented Interfaces:
Map<K,
V>
This implementation of
Map
chooses between one of two implementations, depending on the
size of the map.-
Nested Class Summary
-
Constructor Summary
-
Method Summary
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
compute, computeIfAbsent, computeIfPresent, equals, forEach, getOrDefault, hashCode, merge, putIfAbsent, remove, replace, replace, replaceAll
-
Constructor Details
-
BimodalMap
public BimodalMap(int cutoff) - Parameters:
cutoff
- the map size at which to switch from the small map implementation to the large map implementation
-
-
Method Details
-
size
public int size() -
isEmpty
public boolean isEmpty() -
containsKey
- Specified by:
containsKey
in interfaceMap<K,
V>
-
containsValue
- Specified by:
containsValue
in interfaceMap<K,
V>
-
get
-
put
-
remove
- Specified by:
remove
in interfaceMap<K,
V> - Throws:
UnsupportedOperationException
- if the backingStore doesn't support remove
-
putAll
- Specified by:
putAll
in interfaceMap<K,
V> - Throws:
UnsupportedOperationException
-
clear
public void clear() -
keySet
-
values
-
entrySet
- Specified by:
entrySet
in interfaceMap<K,
V> - Throws:
UnimplementedError
- if the backingStore implementation does
-