Package org.apache.pdfbox.pdmodel.common
Class COSDictionaryMap<K,V>
java.lang.Object
org.apache.pdfbox.pdmodel.common.COSDictionaryMap<K,V>
- All Implemented Interfaces:
Map<K,
V>
This is a Map that will automatically sync the contents to a COSDictionary.
-
Nested Class Summary
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCOSDictionaryMap
(Map<K, V> actualsMap, COSDictionary dicMap) Constructor for this map. -
Method Summary
Modifier and TypeMethodDescriptionvoid
clear()
boolean
containsKey
(Object key) boolean
containsValue
(Object value) static COSDictionary
This will take a map<java.lang.String,org.apache.pdfbox.pdmodel.COSObjectable> and convert it into a COSDictionary.static COSDictionaryMap<String,
Object> This will take a COS dictionary and convert it into COSDictionaryMap.entrySet()
boolean
int
hashCode()
boolean
isEmpty()
keySet()
void
int
size()
toString()
values()
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAll
-
Field Details
-
map
-
actuals
-
-
Constructor Details
-
COSDictionaryMap
Constructor for this map.- Parameters:
actualsMap
- The map with standard java objects as values.dicMap
- The map with COSBase objects as values.
-
-
Method Details
-
size
public int size() -
isEmpty
public boolean isEmpty() -
containsKey
- Specified by:
containsKey
in interfaceMap<K,
V>
-
containsValue
- Specified by:
containsValue
in interfaceMap<K,
V>
-
get
-
put
-
remove
-
putAll
-
clear
public void clear() -
keySet
-
values
-
entrySet
-
equals
-
toString
-
hashCode
public int hashCode() -
convert
This will take a map<java.lang.String,org.apache.pdfbox.pdmodel.COSObjectable> and convert it into a COSDictionary.- Parameters:
someMap
- A map containing COSObjectables- Returns:
- A proper COSDictionary
-
convertBasicTypesToMap
public static COSDictionaryMap<String,Object> convertBasicTypesToMap(COSDictionary map) throws IOException This will take a COS dictionary and convert it into COSDictionaryMap. All cos objects will be converted to their primitive form.- Parameters:
map
- The COS mappings.- Returns:
- A standard java map.
- Throws:
IOException
- If there is an error during the conversion.
-