Package com.ibm.wala.util.collections
Class SmallMap<K,V>
java.lang.Object
com.ibm.wala.util.collections.SmallMap<K,V>
- All Implemented Interfaces:
Map<K,
V>
A simple implementation of Map; intended for Maps with few elements. Optimized for space, not
time -- use with care.
-
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
-
SmallMap
public SmallMap()
-
-
Method Details
-
size
public int size() -
getKey
Use with care.- Returns:
- the ith key
- Throws:
IllegalStateException
-
getValue
Use with care.- Returns:
- the ith key
- Throws:
IllegalStateException
-
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
-
putAll
- Specified by:
putAll
in interfaceMap<K,
V> - Throws:
UnsupportedOperationException
-
clear
@NullUnmarked public void clear() -
keySet
-
values
-
entrySet
-