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>
@Deprecated public class SmallMap<K,V> extends java.lang.Object implements java.util.Map<K,V>Deprecated.will be removed in 4.0.0Map 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.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private classSmallMap.SmallMapEntryDeprecated.
-
Field Summary
Fields Modifier and Type Field Description private java.lang.Object[]mapArrDeprecated.stores key-value pair as 2 objects; key first; in case of empty map this might benull
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidclear()Deprecated.booleancontainsKey(java.lang.Object key)Deprecated.booleancontainsValue(java.lang.Object value)Deprecated.java.util.Set<java.util.Map.Entry<K,V>>entrySet()Deprecated.private intfindKey(java.lang.Object key)Deprecated.Returns index of key within map-array or-1if key is not found (or key isnull).private intfindValue(java.lang.Object value)Deprecated.Returns index of value within map-array or-1if value is not found (or value isnull).Vget(java.lang.Object key)Deprecated.booleanisEmpty()Deprecated.java.util.Set<K>keySet()Deprecated.Returns a set view of the keys contained in this map.Vput(K key, V value)Deprecated.voidputAll(java.util.Map<? extends K,? extends V> otherMap)Deprecated.Vremove(java.lang.Object key)Deprecated.intsize()Deprecated.java.util.Collection<V>values()Deprecated.Returns a collection of the values contained in this map.
-
-
-
Method Detail
-
findKey
private int findKey(java.lang.Object key)
Deprecated.Returns index of key within map-array or-1if key is not found (or key isnull).
-
findValue
private int findValue(java.lang.Object value)
Deprecated.Returns index of value within map-array or-1if value is not found (or value isnull).
-
containsKey
public boolean containsKey(java.lang.Object key)
Deprecated.
-
containsValue
public boolean containsValue(java.lang.Object value)
Deprecated.
-
get
public V get(java.lang.Object key)
Deprecated.
-
remove
public V remove(java.lang.Object key)
Deprecated.
-
keySet
public java.util.Set<K> keySet()
Deprecated.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()
Deprecated.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.
-
-