Package org.apache.pdfbox.cos
Class UnmodifiableCOSDictionary
java.lang.Object
org.apache.pdfbox.cos.COSBase
org.apache.pdfbox.cos.COSDictionary
org.apache.pdfbox.cos.UnmodifiableCOSDictionary
- All Implemented Interfaces:
COSUpdateInfo,COSObjectable
An unmodifiable COSDictionary.
-
Field Summary
Fields inherited from class org.apache.pdfbox.cos.COSDictionary
items -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddAll(COSDictionary dic) This will add all of the dictionaries keys/values to this dictionary.voidclear()This will clear all items in the map.voidmergeInto(COSDictionary dic) This will add all of the dictionaries keys/values to this dictionary, but only if they don't already exist.voidremoveItem(COSName key) This will remove an item for the dictionary.voidsetBoolean(String key, boolean value) This will set an item in the dictionary.voidsetBoolean(COSName key, boolean value) This will set an item in the dictionary.voidSet the value of a date entry in the dictionary.voidSet the date object.voidsetEmbeddedDate(String embedded, String key, Calendar date) Set the value of a date entry in the dictionary.voidsetEmbeddedDate(String embedded, COSName key, Calendar date) Set the date object.voidsetEmbeddedInt(String embeddedDictionary, String key, int value) This is a convenience method that will convert the value to a COSInteger object.voidsetEmbeddedInt(String embeddedDictionary, COSName key, int value) This is a convenience method that will convert the value to a COSInteger object.voidsetEmbeddedString(String embedded, String key, String value) This is a convenience method that will convert the value to a COSString object.voidsetEmbeddedString(String embedded, COSName key, String value) This is a convenience method that will convert the value to a COSString object.voidSets the given boolean value at bitPos in the flags.voidThis is a convenience method that will convert the value to a COSFloat object.voidThis is a convenience method that will convert the value to a COSFloat object.voidThis is a convenience method that will convert the value to a COSInteger object.voidThis is a convenience method that will convert the value to a COSInteger object.voidThis will set an item in the dictionary.voidsetItem(String key, COSObjectable value) This will set an item in the dictionary.voidThis will set an item in the dictionary.voidsetItem(COSName key, COSObjectable value) This will set an item in the dictionary.voidThis is a convenience method that will convert the value to a COSInteger object.voidThis is a convenience method that will convert the value to a COSInteger object.voidThis is a convenience method that will convert the value to a COSName object.voidThis is a convenience method that will convert the value to a COSName object.voidsetNeedToBeUpdated(boolean flag) Set the update state of the dictionary for the COSWriter.voidThis is a convenience method that will convert the value to a COSString object.voidThis is a convenience method that will convert the value to a COSString object.Methods inherited from class org.apache.pdfbox.cos.COSDictionary
accept, asUnmodifiableDictionary, containsKey, containsKey, containsValue, entrySet, getBoolean, getBoolean, getBoolean, getCOSArray, getCOSDictionary, getCOSName, getCOSName, getCOSObject, getCOSStream, getDate, getDate, getDate, getDate, getDictionaryObject, getDictionaryObject, getDictionaryObject, getDictionaryObject, getEmbeddedDate, getEmbeddedDate, getEmbeddedDate, getEmbeddedDate, getEmbeddedInt, getEmbeddedInt, getEmbeddedInt, getEmbeddedInt, getEmbeddedString, getEmbeddedString, getEmbeddedString, getEmbeddedString, getFlag, getFloat, getFloat, getFloat, getFloat, getInt, getInt, getInt, getInt, getInt, getInt, getInt, getItem, getItem, getItem, getKeyForValue, getLong, getLong, getLong, getLong, getLong, getNameAsString, getNameAsString, getNameAsString, getNameAsString, getObjectFromPath, getString, getString, getString, getString, getValues, isNeedToBeUpdated, keySet, size, toStringMethods inherited from class org.apache.pdfbox.cos.COSBase
getCOSObject, isDirect, setDirect
-
Constructor Details
-
UnmodifiableCOSDictionary
UnmodifiableCOSDictionary(COSDictionary dict)
-
-
Method Details
-
clear
public void clear()This will clear all items in the map.- Overrides:
clearin classCOSDictionary
-
setItem
This will set an item in the dictionary. If value is null then the result will be the same as removeItem( key ).- Overrides:
setItemin classCOSDictionary- Parameters:
key- The key to the dictionary object.value- The value to the dictionary object.
-
setItem
This will set an item in the dictionary. If value is null then the result will be the same as removeItem( key ).- Overrides:
setItemin classCOSDictionary- Parameters:
key- The key to the dictionary object.value- The value to the dictionary object.
-
setItem
This will set an item in the dictionary. If value is null then the result will be the same as removeItem( key ).- Overrides:
setItemin classCOSDictionary- Parameters:
key- The key to the dictionary object.value- The value to the dictionary object.
-
setBoolean
This will set an item in the dictionary.- Overrides:
setBooleanin classCOSDictionary- Parameters:
key- The key to the dictionary object.value- The value to the dictionary object.
-
setBoolean
This will set an item in the dictionary.- Overrides:
setBooleanin classCOSDictionary- Parameters:
key- The key to the dictionary object.value- The value to the dictionary object.
-
setItem
This will set an item in the dictionary. If value is null then the result will be the same as removeItem( key ).- Overrides:
setItemin classCOSDictionary- Parameters:
key- The key to the dictionary object.value- The value to the dictionary object.
-
setName
This is a convenience method that will convert the value to a COSName object. If it is null then the object will be removed.- Overrides:
setNamein classCOSDictionary- Parameters:
key- The key to the object,value- The string value for the name.
-
setName
This is a convenience method that will convert the value to a COSName object. If it is null then the object will be removed.- Overrides:
setNamein classCOSDictionary- Parameters:
key- The key to the object,value- The string value for the name.
-
setDate
Set the value of a date entry in the dictionary.- Overrides:
setDatein classCOSDictionary- Parameters:
key- The key to the date value.date- The date value.
-
setDate
Set the date object.- Overrides:
setDatein classCOSDictionary- Parameters:
key- The key to the date.date- The date to set.
-
setEmbeddedDate
Set the value of a date entry in the dictionary.- Overrides:
setEmbeddedDatein classCOSDictionary- Parameters:
embedded- The embedded dictionary.key- The key to the date value.date- The date value.
-
setEmbeddedDate
Set the date object.- Overrides:
setEmbeddedDatein classCOSDictionary- Parameters:
embedded- The embedded dictionary.key- The key to the date.date- The date to set.
-
setString
This is a convenience method that will convert the value to a COSString object. If it is null then the object will be removed.- Overrides:
setStringin classCOSDictionary- Parameters:
key- The key to the object,value- The string value for the name.
-
setString
This is a convenience method that will convert the value to a COSString object. If it is null then the object will be removed.- Overrides:
setStringin classCOSDictionary- Parameters:
key- The key to the object,value- The string value for the name.
-
setEmbeddedString
This is a convenience method that will convert the value to a COSString object. If it is null then the object will be removed.- Overrides:
setEmbeddedStringin classCOSDictionary- Parameters:
embedded- The embedded dictionary to set the item in.key- The key to the object,value- The string value for the name.
-
setEmbeddedString
This is a convenience method that will convert the value to a COSString object. If it is null then the object will be removed.- Overrides:
setEmbeddedStringin classCOSDictionary- Parameters:
embedded- The embedded dictionary to set the item in.key- The key to the object,value- The string value for the name.
-
setInt
This is a convenience method that will convert the value to a COSInteger object.- Overrides:
setIntin classCOSDictionary- Parameters:
key- The key to the object,value- The int value for the name.
-
setInt
This is a convenience method that will convert the value to a COSInteger object.- Overrides:
setIntin classCOSDictionary- Parameters:
key- The key to the object,value- The int value for the name.
-
setLong
This is a convenience method that will convert the value to a COSInteger object.- Overrides:
setLongin classCOSDictionary- Parameters:
key- The key to the object,value- The int value for the name.
-
setLong
This is a convenience method that will convert the value to a COSInteger object.- Overrides:
setLongin classCOSDictionary- Parameters:
key- The key to the object,value- The int value for the name.
-
setEmbeddedInt
This is a convenience method that will convert the value to a COSInteger object.- Overrides:
setEmbeddedIntin classCOSDictionary- Parameters:
embeddedDictionary- The embedded dictionary.key- The key to the object,value- The int value for the name.
-
setEmbeddedInt
This is a convenience method that will convert the value to a COSInteger object.- Overrides:
setEmbeddedIntin classCOSDictionary- Parameters:
embeddedDictionary- The embedded dictionary.key- The key to the object,value- The int value for the name.
-
setFloat
This is a convenience method that will convert the value to a COSFloat object.- Overrides:
setFloatin classCOSDictionary- Parameters:
key- The key to the object,value- The int value for the name.
-
setFloat
This is a convenience method that will convert the value to a COSFloat object.- Overrides:
setFloatin classCOSDictionary- Parameters:
key- The key to the object,value- The int value for the name.
-
removeItem
This will remove an item for the dictionary. This will do nothing of the object does not exist.- Overrides:
removeItemin classCOSDictionary- Parameters:
key- The key to the item to remove from the dictionary.
-
addAll
This will add all of the dictionaries keys/values to this dictionary. Existing key/value pairs will be overwritten.- Overrides:
addAllin classCOSDictionary- Parameters:
dic- The dictionaries to get the key/value pairs from.
-
mergeInto
This will add all of the dictionaries keys/values to this dictionary, but only if they don't already exist. If a key already exists in this dictionary then nothing is changed.- Overrides:
mergeIntoin classCOSDictionary- Parameters:
dic- The dictionaries to get the keys from.
-
setFlag
Sets the given boolean value at bitPos in the flags.- Overrides:
setFlagin classCOSDictionary- Parameters:
field- The COSName of the field to set the value into.bitFlag- the bit position to set the value in.value- the value the bit position should have.
-
setNeedToBeUpdated
public void setNeedToBeUpdated(boolean flag) Set the update state of the dictionary for the COSWriter. This indicates whether an object is to be written when there is an incremental save.- Specified by:
setNeedToBeUpdatedin interfaceCOSUpdateInfo- Overrides:
setNeedToBeUpdatedin classCOSDictionary- Parameters:
flag- the update state.
-