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
final class UnmodifiableCOSDictionary extends COSDictionary
An unmodifiable COSDictionary.
-
-
Field Summary
-
Fields inherited from class org.apache.pdfbox.cos.COSDictionary
items
-
-
Constructor Summary
Constructors Constructor Description UnmodifiableCOSDictionary(COSDictionary dict)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddAll(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(java.lang.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.voidsetDate(java.lang.String key, java.util.Calendar date)Set the value of a date entry in the dictionary.voidsetDate(COSName key, java.util.Calendar date)Set the date object.voidsetEmbeddedDate(java.lang.String embedded, java.lang.String key, java.util.Calendar date)Set the value of a date entry in the dictionary.voidsetEmbeddedDate(java.lang.String embedded, COSName key, java.util.Calendar date)Set the date object.voidsetEmbeddedInt(java.lang.String embeddedDictionary, java.lang.String key, int value)This is a convenience method that will convert the value to a COSInteger object.voidsetEmbeddedInt(java.lang.String embeddedDictionary, COSName key, int value)This is a convenience method that will convert the value to a COSInteger object.voidsetEmbeddedString(java.lang.String embedded, java.lang.String key, java.lang.String value)This is a convenience method that will convert the value to a COSString object.voidsetEmbeddedString(java.lang.String embedded, COSName key, java.lang.String value)This is a convenience method that will convert the value to a COSString object.voidsetFlag(COSName field, int bitFlag, boolean value)Sets the given boolean value at bitPos in the flags.voidsetFloat(java.lang.String key, float value)This is a convenience method that will convert the value to a COSFloat object.voidsetFloat(COSName key, float value)This is a convenience method that will convert the value to a COSFloat object.voidsetInt(java.lang.String key, int value)This is a convenience method that will convert the value to a COSInteger object.voidsetInt(COSName key, int value)This is a convenience method that will convert the value to a COSInteger object.voidsetItem(java.lang.String key, COSBase value)This will set an item in the dictionary.voidsetItem(java.lang.String key, COSObjectable value)This will set an item in the dictionary.voidsetItem(COSName key, COSBase value)This will set an item in the dictionary.voidsetItem(COSName key, COSObjectable value)This will set an item in the dictionary.voidsetLong(java.lang.String key, long value)This is a convenience method that will convert the value to a COSInteger object.voidsetLong(COSName key, long value)This is a convenience method that will convert the value to a COSInteger object.voidsetName(java.lang.String key, java.lang.String value)This is a convenience method that will convert the value to a COSName object.voidsetName(COSName key, java.lang.String value)This 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.voidsetString(java.lang.String key, java.lang.String value)This is a convenience method that will convert the value to a COSString object.voidsetString(COSName key, java.lang.String value)This 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, toString
-
Methods inherited from class org.apache.pdfbox.cos.COSBase
getCOSObject, isDirect, setDirect
-
-
-
-
Constructor Detail
-
UnmodifiableCOSDictionary
UnmodifiableCOSDictionary(COSDictionary dict)
-
-
Method Detail
-
clear
public void clear()
This will clear all items in the map.- Overrides:
clearin classCOSDictionary
-
setItem
public void setItem(COSName key, COSBase value)
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
public void setItem(COSName key, COSObjectable value)
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
public void setItem(java.lang.String key, COSObjectable value)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
public void setBoolean(java.lang.String key, boolean value)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
public void setBoolean(COSName key, boolean value)
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
public void setItem(java.lang.String key, COSBase value)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
public void setName(java.lang.String key, java.lang.String value)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
public void setName(COSName key, java.lang.String value)
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
public void setDate(java.lang.String key, java.util.Calendar date)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
public void setDate(COSName key, java.util.Calendar date)
Set the date object.- Overrides:
setDatein classCOSDictionary- Parameters:
key- The key to the date.date- The date to set.
-
setEmbeddedDate
public void setEmbeddedDate(java.lang.String embedded, java.lang.String key, java.util.Calendar date)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
public void setEmbeddedDate(java.lang.String embedded, COSName key, java.util.Calendar date)Set the date object.- Overrides:
setEmbeddedDatein classCOSDictionary- Parameters:
embedded- The embedded dictionary.key- The key to the date.date- The date to set.
-
setString
public void setString(java.lang.String key, java.lang.String value)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
public void setString(COSName key, java.lang.String value)
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
public void setEmbeddedString(java.lang.String embedded, java.lang.String key, java.lang.String value)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
public void setEmbeddedString(java.lang.String embedded, COSName key, java.lang.String value)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
public void setInt(java.lang.String key, int value)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
public void setInt(COSName key, int value)
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
public void setLong(java.lang.String key, long value)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
public void setLong(COSName key, long value)
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
public void setEmbeddedInt(java.lang.String embeddedDictionary, java.lang.String key, int value)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
public void setEmbeddedInt(java.lang.String embeddedDictionary, COSName key, int value)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
public void setFloat(java.lang.String key, float value)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
public void setFloat(COSName key, float value)
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
public void removeItem(COSName key)
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
public void addAll(COSDictionary dic)
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
public void mergeInto(COSDictionary dic)
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
public void setFlag(COSName field, int bitFlag, boolean value)
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.
-
-