Package org.apache.pdfbox.util
Class SmallMap<K,V>
- java.lang.Object
-
- org.apache.pdfbox.util.SmallMap<K,V>
-
- All Implemented Interfaces:
java.util.Map<K,V>
public class SmallMap<K,V> extends java.lang.Object implements java.util.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(java.lang.Object key)booleancontainsValue(java.lang.Object value)java.util.Set<java.util.Map.Entry<K,V>>entrySet()Vget(java.lang.Object key)booleanisEmpty()java.util.Set<K>keySet()Returns a set view of the keys contained in this map.Vput(K key, V value)voidputAll(java.util.Map<? extends K,? extends V> otherMap)Vremove(java.lang.Object key)intsize()java.util.Collection<V>values()Returns a collection of the values contained in this map.
-
-
-
Method Detail
-
containsKey
public boolean containsKey(java.lang.Object key)
-
containsValue
public boolean containsValue(java.lang.Object value)
-
keySet
public java.util.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 java.util.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.
-
-