java.lang.Object
org.sejda.sambox.pdmodel.common.COSDictionaryMap<K,V>
- All Implemented Interfaces:
Map<K,V>
This is a Map that will automatically sync the contents to a COSDictionary.
- Author:
- Ben Litchfield
-
Nested Class Summary
-
Constructor Summary
ConstructorsConstructorDescriptionCOSDictionaryMap(Map<K, V> actualsMap, COSDictionary dicMap) Constructor for this map. -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()booleancontainsKey(Object key) booleancontainsValue(Object value) static COSDictionaryThis will take a map<String,COSObjectable> and convert it into a COSDictionary.static COSDictionaryMap<String,Object> This will take a COS dictionary and convert it into COSDictionaryMap.entrySet()booleaninthashCode()booleanisEmpty()keySet()voidintsize()toString()values()Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAll
-
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:
containsKeyin interfaceMap<K,V>
-
containsValue
- Specified by:
containsValuein 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<String,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.
-