Package org.apache.pdfbox.util
Class SmallMap<K,V>
java.lang.Object
org.apache.pdfbox.util.SmallMap<K,V>
- All Implemented Interfaces:
Map<K,V>
Deprecated.
will be removed in 4.0.0
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.
null is not supported for keys or values.
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()Deprecated.booleancontainsKey(Object key) Deprecated.booleancontainsValue(Object value) Deprecated.entrySet()Deprecated.private intDeprecated.Returns index of key within map-array or-1if key is not found (or key isnull).private intDeprecated.Returns index of value within map-array or-1if value is not found (or value isnull).Deprecated.booleanisEmpty()Deprecated.keySet()Deprecated.Returns a set view of the keys contained in this map.Deprecated.final voidDeprecated.Deprecated.intsize()Deprecated.values()Deprecated.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, waitMethods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, equals, forEach, getOrDefault, hashCode, merge, putIfAbsent, remove, replace, replace, replaceAll
-
Field Details
-
mapArr
Deprecated.stores key-value pair as 2 objects; key first; in case of empty map this might benull
-
-
Constructor Details
-
SmallMap
public SmallMap()Deprecated.Creates empty map. -
SmallMap
Deprecated.Creates map filled with entries from provided map.- Parameters:
initMap- the map whose mappings are to be placed in this map
-
-
Method Details
-
findKey
Deprecated.Returns index of key within map-array or-1if key is not found (or key isnull). -
findValue
Deprecated.Returns index of value within map-array or-1if value is not found (or value isnull). -
size
public int size()Deprecated. -
isEmpty
public boolean isEmpty()Deprecated. -
containsKey
Deprecated.- Specified by:
containsKeyin interfaceMap<K,V>
-
containsValue
Deprecated.- Specified by:
containsValuein interfaceMap<K,V>
-
get
Deprecated. -
put
Deprecated. -
remove
Deprecated. -
putAll
Deprecated. -
clear
public void clear()Deprecated. -
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
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.
-
entrySet
Deprecated.
-