java.lang.Object
org.sejda.sambox.cos.COSBase
org.sejda.sambox.cos.COSDictionary
- All Implemented Interfaces:
COSObjectable
- Direct Known Subclasses:
COSStream
This class represents a dictionary where name/value pairs reside.
- Author:
- Ben Litchfield
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaccept(COSVisitor visitor) Visitor pattern for the COS model objectsvoidaddAll(COSDictionary dic) This will add all of the dictionaries keys/values to this dictionary.voidclear()booleancontainsKey(String name) booleancontainsKey(COSName name) entrySet()booleangetBoolean(String key, boolean defaultValue) Convenience method that will get the dictionary object that is expected to be a cos boolean and convert it to a primitive boolean.booleangetBoolean(COSName key, boolean defaultValue) Convenience method that will get the dictionary object that is expected to be a COSBoolean and convert it to a primitive boolean.booleangetBoolean(COSName firstKey, COSName secondKey, boolean defaultValue) Convenience method that will get the dictionary object that is expected to be a COSBoolean and convert it to a primitive boolean.getCOSArray(COSName key) This is a convenience method that will get the dictionary object that is expected to be a COSArray.getCOSName(COSName key) Convenience method that will get the dictionary object that is expected to be a name.getCOSName(COSName key, COSName defaultValue) Convenience method that will get the dictionary object that is expected to be a name.Convenience method that will get the dictionary object that is expected to be a name and convert it to a string.Convenience method that will get the dictionary object that is expected to be a date.Convenience method that will get the dictionary object that is expected to be a name and convert it to a string.Convenience method that will get the dictionary object that is expected to be a date.This will get an object from this dictionary.<T extends COSBase>
TgetDictionaryObject(String key, Class<T> clazz) Get an object of the expected type from this dictionary.Get an object from this dictionary.<T extends COSBase>
TgetDictionaryObject(COSName key, Class<T> clazz) Get an object of the expected type from this dictionary.getDictionaryObject(COSName firstKey, COSName secondKey) This is a special case of getDictionaryObject that takes multiple keys, it will handle the situation where multiple keys could get the same value, ie if either CS or ColorSpace is used to get the colorspace.<T extends COSBase>
TgetDictionaryObject(COSName firstKey, COSName secondKey, Class<T> clazz) getEmbeddedDate(String embedded, String key) Convenience method that will get the dictionary object that is expected to be a name and convert it to a string.getEmbeddedDate(String embedded, String key, Calendar defaultValue) Convenience method that will get the dictionary object that is expected to be a date.getEmbeddedDate(String embedded, COSName key) Convenience method that will get the dictionary object that is expected to be a name and convert it to a string.getEmbeddedDate(String embedded, COSName key, Calendar defaultValue) Convenience method that will get the dictionary object that is expected to be a date.intgetEmbeddedInt(String embeddedDictionary, String key) Get an integer from an embedded dictionary.intgetEmbeddedInt(String embeddedDictionary, String key, int defaultValue) Get an integer from an embedded dictionary.intgetEmbeddedInt(String embeddedDictionary, COSName key) Get an integer from an embedded dictionary.intgetEmbeddedInt(String embeddedDictionary, COSName key, int defaultValue) Get an integer from an embedded dictionary.getEmbeddedString(String embedded, String key) Convenience method that will get the dictionary object that is expected to be a name and convert it to a string.getEmbeddedString(String embedded, String key, String defaultValue) Convenience method that will get the dictionary object that is expected to be a name and convert it to a string.getEmbeddedString(String embedded, COSName key) Convenience method that will get the dictionary object that is expected to be a name and convert it to a string.getEmbeddedString(String embedded, COSName key, String defaultValue) Convenience method that will get the dictionary object that is expected to be a name and convert it to a string.booleanGets the boolean value from the flags at the given bit position.floatConvenience method that will get the dictionary object that is expected to be an float.floatConvenience method that will get the dictionary object that is expected to be a float.floatConvenience method that will get the dictionary object that is expected to be an float.floatConvenience method that will get the dictionary object that is expected to be an float.intConvenience method that will get the dictionary object that is expected to be an int.intConvenience method that will get the dictionary object that is expected to be an integer.intConvenience method that will get the dictionary object that is expected to be an int.intConvenience method that will get the dictionary object that is expected to be an integer.intConvenience method that will get the dictionary object that is expected to be an integer.intConvenience method that will get the dictionary object that is expected to be an integer.This is a special case of getItem that takes multiple keys, it will handle the situation where multiple keys could get the same value, ie if either CS or ColorSpace is used to get the colorspace.getKeyForValue(COSBase value) Search in the map for the value that matches the parameter and return the first key that maps to that value.longConvenience method that will get the dictionary object that is expected to be an long.longConvenience method that will get the dictionary object that is expected to be an integer.longConvenience method that will get the dictionary object that is expected to be an long.longConvenience method that will get the dictionary object that is expected to be an integer.getNameAsString(String key) Convenience method that will get the dictionary object that is expected to be a name and convert it to a string.getNameAsString(String key, String defaultValue) Convenience method that will get the dictionary object that is expected to be a name and convert it to a string.getNameAsString(COSName key) Convenience method that will get the dictionary object that is expected to be a name and convert it to a string.getNameAsString(COSName key, String defaultValue) Convenience method that will get the dictionary object that is expected to be a name and convert it to a string.Convenience method that will get the dictionary object that is expected to be a name and convert it to a string.Convenience method that will get the dictionary object that is expected to be a name and convert it to a string.Convenience method that will get the dictionary object that is expected to be a name and convert it to a string.Convenience method that will get the dictionary object that is expected to be a name and convert it to a string.keySet()voidmerge(COSDictionary dic) Adds all of the dictionaries keys/values to this dictionary.voidAdds all of the dictionaries keys/values to this dictionary, but only if they don't already exist.voidputIfAbsent(COSName key, boolean value) voidputIfAbsent(COSName key, int value) voidputIfAbsent(COSName key, long value) voidputIfAbsent(COSName key, String value) voidputIfAbsent(COSName key, COSBase value) voidputIfAbsent(COSName key, COSObjectable value) voidremoveItem(COSName key) Remove an item for the dictionary.voidremoveItems(COSName... keys) Remove the items for the dictionary.voidsetBoolean(String key, boolean value) Set a boolean item in the dictionary.voidsetBoolean(COSName key, boolean value) Set a boolean 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, long value) Convenience method that will convert the value to a COSInteger object.voidsetEmbeddedInt(String embeddedDictionary, COSName key, long value) Convenience method that will convert the value to a COSInteger object.voidsetEmbeddedString(String embedded, String key, String value) Convenience method that will convert the value to a COSString object.voidsetEmbeddedString(String embedded, COSName key, String value) Convenience method that will convert the value to a COSString object.voidSets the given boolean value at bitPos in the flags.voidConvenience method that will convert the value to a COSFloat object.voidConvenience method that will convert the value to a COSFloat object.voidConvenience method that will convert the value to a COSInteger object.voidConvenience method that will convert the value to a COSInteger object.voidSet an item in the dictionary.voidsetItem(String key, COSObjectable value) Set the wrappedCOSBaseas item in the dictionary.voidSet an item in the dictionary.voidsetItem(COSName key, COSObjectable value) Set the wrappedCOSBaseas item in the dictionary.voidConvenience method that will convert the value to a COSInteger object.voidConvenience method that will convert the value to a COSInteger object.voidConvenience method that will convert the value to a COSName object.voidConvenience method that will convert the value to a COSName object.voidConvenience method that will convert the value to a COSString object.voidConvenience method that will convert the value to a COSString object.intsize()toString()Methods inherited from class org.sejda.sambox.cos.COSBase
getCOSObject, hasId, id, idIfAbsent
-
Field Details
-
items
The name-value pairs of this dictionary. The pairs are kept in the order they were added to the dictionary.
-
-
Constructor Details
-
COSDictionary
public COSDictionary() -
COSDictionary
Copy Constructor. This will make a shallow copy of this dictionary.- Parameters:
dict- The dictionary to copy.
-
-
Method Details
-
getKeyForValue
Search in the map for the value that matches the parameter and return the first key that maps to that value.- Parameters:
value- The value to search for in the map.- Returns:
- The key for the value in the map or null if it does not exist.
-
size
public int size()- Returns:
- The number of elements in the dictionary.
-
clear
public void clear() -
getDictionaryObject
This will get an object from this dictionary. If the object is a reference then it will dereference it. If the object is COSNull then null will be returned.- Parameters:
key- The key to the object that we are getting.- Returns:
- The object that matches the key.
-
getDictionaryObject
Get an object of the expected type from this dictionary. If the type is not compatible, null is returned- Parameters:
key-clazz-- Returns:
- The object that matches the key and the type or null.
-
getDictionaryObject
This is a special case of getDictionaryObject that takes multiple keys, it will handle the situation where multiple keys could get the same value, ie if either CS or ColorSpace is used to get the colorspace. This will get an object from this dictionary. If the object is a reference then it will dereference it and get it from the document. If the object is COSNull then null will be returned.- Parameters:
firstKey- The first key to try.secondKey- The second key to try.- Returns:
- The object that matches the key.
-
getDictionaryObject
public <T extends COSBase> T getDictionaryObject(COSName firstKey, COSName secondKey, Class<T> clazz) - Parameters:
firstKey-secondKey-clazz-- Returns:
- See Also:
-
getDictionaryObject
Get an object from this dictionary. If the object is a reference then it will dereference it. If the object is COSNull then null will be returned.- Parameters:
key- The key to the object that we are getting.- Returns:
- The object that matches the key or null.
-
getDictionaryObject
Get an object of the expected type from this dictionary. If the type is not compatible, null is returned- Parameters:
key-clazz-- Returns:
- The object that matches the key and the type or null.
-
setItem
Set an item in the dictionary. If value is null then the result will be the same as removeItem( key ).- Parameters:
key- The key to the dictionary object.value- The value to the dictionary object.
-
putIfAbsent
-
setItem
Set the wrappedCOSBaseas item in the dictionary. If value is null then the result will be the same as removeItem( key ).- Parameters:
key- The key to the dictionary object.value- The value to the dictionary object.
-
putIfAbsent
-
setItem
Set the wrappedCOSBaseas item in the dictionary. If value is null then the result will be the same as removeItem( key ).- Parameters:
key- The key to the dictionary object.value- The value to the dictionary object.
-
setBoolean
Set a boolean item in the dictionary.- Parameters:
key- The key to the dictionary object.value- The value to the dictionary object.
-
setBoolean
Set a boolean item in the dictionary.- Parameters:
key- The key to the dictionary object.value- The value to the dictionary object.
-
putIfAbsent
-
setItem
Set an item in the dictionary. If value is null then the result will be the same as removeItem( key ).- Parameters:
key- The key to the dictionary object.value- The value to the dictionary object.
-
setName
Convenience method that will convert the value to a COSName object. If it is null then the object will be removed.- Parameters:
key- The key to the object,value- The string value for the name.
-
setName
Convenience method that will convert the value to a COSName object. If it is null then the object will be removed.- 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.- Parameters:
key- The key to the date value.date- The date value.
-
setDate
Set the date object.- Parameters:
key- The key to the date.date- The date to set.
-
setEmbeddedDate
Set the value of a date entry in the dictionary.- Parameters:
embedded- The embedded dictionary.key- The key to the date value.date- The date value.
-
setEmbeddedDate
Set the date object.- Parameters:
embedded- The embedded dictionary.key- The key to the date.date- The date to set.
-
setString
Convenience method that will convert the value to a COSString object. If it is null then the object will be removed.- Parameters:
key- The key to the object,value- The string value for the name.
-
setString
Convenience method that will convert the value to a COSString object. If it is null then the object will be removed.- Parameters:
key- The key to the object,value- The string value for the name.
-
putIfAbsent
-
setEmbeddedString
Convenience method that will convert the value to a COSString object. If it is null then the object will be removed.- Parameters:
embedded- The embedded dictionary to set the item in.key- The key to the object,value- The string value for the name.
-
setEmbeddedString
Convenience method that will convert the value to a COSString object. If it is null then the object will be removed.- Parameters:
embedded- The embedded dictionary to set the item in.key- The key to the object,value- The string value for the name.
-
setInt
Convenience method that will convert the value to a COSInteger object.- Parameters:
key- The key to the object,value- The int value for the name.
-
setInt
Convenience method that will convert the value to a COSInteger object.- Parameters:
key- The key to the object,value- The int value for the name.
-
putIfAbsent
-
setLong
Convenience method that will convert the value to a COSInteger object.- Parameters:
key- The key to the object,value- The int value for the name.
-
setLong
Convenience method that will convert the value to a COSInteger object.- Parameters:
key- The key to the object,value- The int value for the name.
-
putIfAbsent
-
setEmbeddedInt
Convenience method that will convert the value to a COSInteger object.- Parameters:
embeddedDictionary- The embedded dictionary.key- The key to the object,value- The int value for the name.
-
setEmbeddedInt
Convenience method that will convert the value to a COSInteger object.- Parameters:
embeddedDictionary- The embedded dictionary.key- The key to the object,value- The int value for the name.
-
setFloat
Convenience method that will convert the value to a COSFloat object.- Parameters:
key- The key to the object,value- The int value for the name.
-
setFloat
Convenience method that will convert the value to a COSFloat object.- Parameters:
key- The key to the object,value- The int value for the name.
-
setFlag
Sets the given boolean value at bitPos in the flags.- 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.
-
getCOSName
Convenience method that will get the dictionary object that is expected to be a name. Null is returned if the entry does not exist in the dictionary.- Parameters:
key- The key to the item in the dictionary.- Returns:
- The COS name.
-
getCOSArray
This is a convenience method that will get the dictionary object that is expected to be a COSArray. Null is returned if the entry does not exist in the dictionary.- Parameters:
key- The key to the item in the dictionary.- Returns:
- The COSArray.
-
getCOSName
Convenience method that will get the dictionary object that is expected to be a name. Default is returned if the entry does not exist in the dictionary.- Parameters:
key- The key to the item in the dictionary.defaultValue- The value to return if the dictionary item is null.- Returns:
- The COS name.
-
getNameAsString
Convenience method that will get the dictionary object that is expected to be a name and convert it to a string. Null is returned if the entry does not exist in the dictionary.- Parameters:
key- The key to the item in the dictionary.- Returns:
- The name converted to a string.
-
getNameAsString
Convenience method that will get the dictionary object that is expected to be a name and convert it to a string. Null is returned if the entry does not exist in the dictionary.- Parameters:
key- The key to the item in the dictionary.- Returns:
- The name converted to a string.
-
getNameAsString
Convenience method that will get the dictionary object that is expected to be a name and convert it to a string.- Parameters:
key- The key to the item in the dictionary.defaultValue- The value to return if the dictionary item is null.- Returns:
- The name converted to a string.
-
getNameAsString
Convenience method that will get the dictionary object that is expected to be a name and convert it to a string.- Parameters:
key- The key to the item in the dictionary.defaultValue- The value to return if the dictionary item is null.- Returns:
- The name converted to a string.
-
getString
Convenience method that will get the dictionary object that is expected to be a name and convert it to a string. Null is returned if the entry does not exist in the dictionary.- Parameters:
key- The key to the item in the dictionary.- Returns:
- The name converted to a string.
-
getString
Convenience method that will get the dictionary object that is expected to be a name and convert it to a string. Null is returned if the entry does not exist in the dictionary.- Parameters:
key- The key to the item in the dictionary.- Returns:
- The name converted to a string.
-
getString
Convenience method that will get the dictionary object that is expected to be a name and convert it to a string.- Parameters:
key- The key to the item in the dictionary.defaultValue- The default value to return.- Returns:
- The name converted to a string.
-
getString
Convenience method that will get the dictionary object that is expected to be a name and convert it to a string.- Parameters:
key- The key to the item in the dictionary.defaultValue- The default value to return.- Returns:
- The name converted to a string.
-
getEmbeddedString
Convenience method that will get the dictionary object that is expected to be a name and convert it to a string. Null is returned if the entry does not exist in the dictionary.- Parameters:
embedded- The embedded dictionary.key- The key to the item in the dictionary.- Returns:
- The name converted to a string.
-
getEmbeddedString
Convenience method that will get the dictionary object that is expected to be a name and convert it to a string. Null is returned if the entry does not exist in the dictionary.- Parameters:
embedded- The embedded dictionary.key- The key to the item in the dictionary.- Returns:
- The name converted to a string.
-
getEmbeddedString
Convenience method that will get the dictionary object that is expected to be a name and convert it to a string. Null is returned if the entry does not exist in the dictionary.- Parameters:
embedded- The embedded dictionary.key- The key to the item in the dictionary.defaultValue- The default value to return.- Returns:
- The name converted to a string.
-
getEmbeddedString
Convenience method that will get the dictionary object that is expected to be a name and convert it to a string.- Parameters:
embedded- The embedded dictionary.key- The key to the item in the dictionary.defaultValue- The default value to return.- Returns:
- The name converted to a string.
-
getDate
Convenience method that will get the dictionary object that is expected to be a name and convert it to a string. Null is returned if the entry does not exist in the dictionary or if the date was invalid.- Parameters:
key- The key to the item in the dictionary.- Returns:
- The name converted to a date.
-
getDate
Convenience method that will get the dictionary object that is expected to be a name and convert it to a string. Null is returned if the entry does not exist in the dictionary or if the date was invalid.- Parameters:
key- The key to the item in the dictionary.- Returns:
- The name converted to a date.
-
getDate
Convenience method that will get the dictionary object that is expected to be a date. Null is returned if the entry does not exist in the dictionary or if the date was invalid.- Parameters:
key- The key to the item in the dictionary.defaultValue- The default value to return.- Returns:
- The name converted to a date.
-
getDate
Convenience method that will get the dictionary object that is expected to be a date. Null is returned if the entry does not exist in the dictionary or if the date was invalid.- Parameters:
key- The key to the item in the dictionary.defaultValue- The default value to return.- Returns:
- The name converted to a date.
-
getEmbeddedDate
Convenience method that will get the dictionary object that is expected to be a name and convert it to a string. Null is returned if the entry does not exist in the dictionary.- Parameters:
embedded- The embedded dictionary to get.key- The key to the item in the dictionary.- Returns:
- The name converted to a string.
-
getEmbeddedDate
Convenience method that will get the dictionary object that is expected to be a name and convert it to a string. Null is returned if the entry does not exist in the dictionary.- Parameters:
embedded- The embedded dictionary to get.key- The key to the item in the dictionary.- Returns:
- The name converted to a string.
-
getEmbeddedDate
Convenience method that will get the dictionary object that is expected to be a date. Null is returned if the entry does not exist in the dictionary.- Parameters:
embedded- The embedded dictionary to get.key- The key to the item in the dictionary.defaultValue- The default value to return.- Returns:
- The name converted to a string.
-
getEmbeddedDate
Convenience method that will get the dictionary object that is expected to be a date. Null is returned if the entry does not exist in the dictionary.- Parameters:
embedded- The embedded dictionary to get.key- The key to the item in the dictionary.defaultValue- The default value to return.- Returns:
- The name converted to a string.
-
getBoolean
Convenience method that will get the dictionary object that is expected to be a cos boolean and convert it to a primitive boolean.- Parameters:
key- The key to the item in the dictionary.defaultValue- The value returned if the entry is null.- Returns:
- The value converted to a boolean.
-
getBoolean
Convenience method that will get the dictionary object that is expected to be a COSBoolean and convert it to a primitive boolean.- Parameters:
key- The key to the item in the dictionary.defaultValue- The value returned if the entry is null.- Returns:
- The entry converted to a boolean.
-
getBoolean
Convenience method that will get the dictionary object that is expected to be a COSBoolean and convert it to a primitive boolean.- Parameters:
firstKey- The first key to the item in the dictionary.secondKey- The second key to the item in the dictionary.defaultValue- The value returned if the entry is null.- Returns:
- The entry converted to a boolean.
-
getEmbeddedInt
Get an integer from an embedded dictionary. Useful for 1-1 mappings. default:-1- Parameters:
embeddedDictionary- The name of the embedded dictionary.key- The key in the embedded dictionary.- Returns:
- The value of the embedded integer.
-
getEmbeddedInt
Get an integer from an embedded dictionary. Useful for 1-1 mappings. default:-1- Parameters:
embeddedDictionary- The name of the embedded dictionary.key- The key in the embedded dictionary.- Returns:
- The value of the embedded integer.
-
getEmbeddedInt
Get an integer from an embedded dictionary. Useful for 1-1 mappings.- Parameters:
embeddedDictionary- The name of the embedded dictionary.key- The key in the embedded dictionary.defaultValue- The value if there is no embedded dictionary or it does not contain the key.- Returns:
- The value of the embedded integer.
-
getEmbeddedInt
Get an integer from an embedded dictionary. Useful for 1-1 mappings.- Parameters:
embeddedDictionary- The name of the embedded dictionary.key- The key in the embedded dictionary.defaultValue- The value if there is no embedded dictionary or it does not contain the key.- Returns:
- The value of the embedded integer.
-
getInt
Convenience method that will get the dictionary object that is expected to be an int. -1 is returned if there is no value.- Parameters:
key- The key to the item in the dictionary.- Returns:
- The integer value.
-
getInt
Convenience method that will get the dictionary object that is expected to be an int. -1 is returned if there is no value.- Parameters:
key- The key to the item in the dictionary.- Returns:
- The integer value..
-
getInt
Convenience method that will get the dictionary object that is expected to be an integer. If the dictionary value is null then the default Value will be returned.- Parameters:
key- The key to the item in the dictionary.defaultValue- The value to return if the dictionary item is null.- Returns:
- The integer value.
-
getInt
Convenience method that will get the dictionary object that is expected to be an integer. If the dictionary value is null then the default Value will be returned.- Parameters:
key- The key to the item in the dictionary.defaultValue- The value to return if the dictionary item is null.- Returns:
- The integer value.
-
getInt
Convenience method that will get the dictionary object that is expected to be an integer. If the dictionary value is null then the default Value -1 will be returned.- Parameters:
firstKey- The first key to the item in the dictionary.secondKey- The second key to the item in the dictionary.- Returns:
- The integer value.
-
getInt
Convenience method that will get the dictionary object that is expected to be an integer. If the dictionary value is null then the default Value will be returned.- Parameters:
firstKey- The first key to the item in the dictionary.secondKey- The second key to the item in the dictionary.defaultValue- The value to return if the dictionary item is null.- Returns:
- The integer value.
-
getLong
Convenience method that will get the dictionary object that is expected to be an long. -1 is returned if there is no value.- Parameters:
key- The key to the item in the dictionary.- Returns:
- The long value.
-
getLong
Convenience method that will get the dictionary object that is expected to be an long. -1 is returned if there is no value.- Parameters:
key- The key to the item in the dictionary.- Returns:
- The long value.
-
getLong
Convenience method that will get the dictionary object that is expected to be an integer. If the dictionary value is null then the default Value will be returned.- Parameters:
key- The key to the item in the dictionary.defaultValue- The value to return if the dictionary item is null.- Returns:
- The integer value.
-
getLong
Convenience method that will get the dictionary object that is expected to be an integer. If the dictionary value is null then the default Value will be returned.- Parameters:
key- The key to the item in the dictionary.defaultValue- The value to return if the dictionary item is null.- Returns:
- The integer value.
-
getFloat
Convenience method that will get the dictionary object that is expected to be an float. -1 is returned if there is no value.- Parameters:
key- The key to the item in the dictionary.- Returns:
- The float value.
-
getFloat
Convenience method that will get the dictionary object that is expected to be an float. -1 is returned if there is no value.- Parameters:
key- The key to the item in the dictionary.- Returns:
- The float value.
-
getFloat
Convenience method that will get the dictionary object that is expected to be a float. If the dictionary value is null then the default Value will be returned.- Parameters:
key- The key to the item in the dictionary.defaultValue- The value to return if the dictionary item is null.- Returns:
- The float value.
-
getFloat
Convenience method that will get the dictionary object that is expected to be an float. If the dictionary value is null then the default Value will be returned.- Parameters:
key- The key to the item in the dictionary.defaultValue- The value to return if the dictionary item is null.- Returns:
- The float value.
-
getFlag
Gets the boolean value from the flags at the given bit position.- Parameters:
field- The COSName of the field to get the flag from.bitFlag- the bitPosition to get the value from.- Returns:
- true if the number at bitPos is '1'
-
removeItem
Remove an item for the dictionary. This will do nothing of the object does not exist.- Parameters:
key- The key to the item to remove from the dictionary.
-
removeItems
Remove the items for the dictionary. This will do nothing of the object does not exist.- Parameters:
keys- The keys to the item to remove from the dictionary.
-
getItem
- Parameters:
key- The key to the object.- Returns:
- The item that matches the key.
-
getItem
- Parameters:
key- The key to the object.- Returns:
- The item that matches the key.
-
getItem
This is a special case of getItem that takes multiple keys, it will handle the situation where multiple keys could get the same value, ie if either CS or ColorSpace is used to get the colorspace. This will get an object from this dictionary.- Parameters:
firstKey- The first key to try.secondKey- The second key to try.- Returns:
- The object that matches the key.
-
keySet
- Returns:
- names of the entries in this dictionary. The returned set is in the order the entries were added to the dictionary.
-
entrySet
- Returns:
- name-value entries in this dictionary. The returned set is in the order the entries were added to the dictionary.
-
getValues
- Returns:
- All the values for the dictionary.
-
accept
Description copied from class:COSBaseVisitor pattern for the COS model objects- Specified by:
acceptin classCOSBase- Throws:
IOException
-
addAll
This will add all of the dictionaries keys/values to this dictionary.- Parameters:
dic- The dic to get the keys from.
-
containsKey
- Parameters:
name- The key to find in the map.- Returns:
- true if the map contains this key.
- See Also:
-
containsKey
- Parameters:
name- The key to find in the map.- Returns:
- true if the map contains this key.
- See Also:
-
mergeWithoutOverwriting
Adds 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.- Parameters:
dic- TheCOSDictionaryto get the keys from.
-
merge
Adds all of the dictionaries keys/values to this dictionary. If a key already exists in this dictionary the value is overridden.- Parameters:
dic- TheCOSDictionaryto get the keys from.
-
asUnmodifiableDictionary
- Returns:
- an unmodifiable view of this dictionary
-
duplicate
- Returns:
- a new
COSDictionarythat is a duplicate of this
-
toString
-