Package com.tom_roush.pdfbox.util
Class SmallMap<K,V>
- java.lang.Object
-
- com.tom_roush.pdfbox.util.SmallMap<K,V>
-
- All Implemented Interfaces:
Map<K,V>
public class SmallMap<K,V> extends Object implements Map<K,V>
Map implementation with a smallest possible memory usage. It should only be used for maps with small number of items (e.g. <30) since most operations have an O(n) complexity. Thus it should be used in cases with large number of map objects, each having only few items.nullis not supported for keys or values.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclear()booleancontainsKey(Object key)booleancontainsValue(Object value)Set<Map.Entry<K,V>>entrySet()Vget(Object key)booleanisEmpty()Set<K>keySet()Returns a set view of the keys contained in this map.Vput(K key, V value)voidputAll(Map<? extends K,? extends V> otherMap)Vremove(Object key)intsize()Collection<V>values()Returns a collection of the values contained in this map.-
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
-
-
-
-
Method Detail
-
containsKey
public boolean containsKey(Object key)
- Specified by:
containsKeyin interfaceMap<K,V>
-
containsValue
public boolean containsValue(Object value)
- Specified by:
containsValuein interfaceMap<K,V>
-
keySet
public Set<K> keySet()
Returns a set view of the keys contained in this map.The current implementation does not allow changes to the returned key set (which would have to be reflected in the underlying map.
-
values
public Collection<V> values()
Returns a collection of the values contained in this map.The current implementation does not allow changes to the returned collection (which would have to be reflected in the underlying map.
-
-