Class UnmodifiableCOSDictionary

All Implemented Interfaces:
COSUpdateInfo, COSObjectable

final class UnmodifiableCOSDictionary extends COSDictionary
An unmodifiable COSDictionary.
  • Constructor Details

    • UnmodifiableCOSDictionary

      UnmodifiableCOSDictionary(COSDictionary dict)
  • Method Details

    • clear

      public void clear()
      This will clear all items in the map.
      Overrides:
      clear in class COSDictionary
    • 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:
      setItem in class COSDictionary
      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:
      setItem in class COSDictionary
      Parameters:
      key - The key to the dictionary object.
      value - The value to the dictionary object.
    • setItem

      public void setItem(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:
      setItem in class COSDictionary
      Parameters:
      key - The key to the dictionary object.
      value - The value to the dictionary object.
    • setBoolean

      public void setBoolean(String key, boolean value)
      This will set an item in the dictionary.
      Overrides:
      setBoolean in class COSDictionary
      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:
      setBoolean in class COSDictionary
      Parameters:
      key - The key to the dictionary object.
      value - The value to the dictionary object.
    • setItem

      public void setItem(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:
      setItem in class COSDictionary
      Parameters:
      key - The key to the dictionary object.
      value - The value to the dictionary object.
    • setName

      public void setName(String key, 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:
      setName in class COSDictionary
      Parameters:
      key - The key to the object,
      value - The string value for the name.
    • setName

      public void setName(COSName key, 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:
      setName in class COSDictionary
      Parameters:
      key - The key to the object,
      value - The string value for the name.
    • setDate

      public void setDate(String key, Calendar date)
      Set the value of a date entry in the dictionary.
      Overrides:
      setDate in class COSDictionary
      Parameters:
      key - The key to the date value.
      date - The date value.
    • setDate

      public void setDate(COSName key, Calendar date)
      Set the date object.
      Overrides:
      setDate in class COSDictionary
      Parameters:
      key - The key to the date.
      date - The date to set.
    • setEmbeddedDate

      public void setEmbeddedDate(String embedded, String key, Calendar date)
      Set the value of a date entry in the dictionary.
      Overrides:
      setEmbeddedDate in class COSDictionary
      Parameters:
      embedded - The embedded dictionary.
      key - The key to the date value.
      date - The date value.
    • setEmbeddedDate

      public void setEmbeddedDate(String embedded, COSName key, Calendar date)
      Set the date object.
      Overrides:
      setEmbeddedDate in class COSDictionary
      Parameters:
      embedded - The embedded dictionary.
      key - The key to the date.
      date - The date to set.
    • setString

      public void setString(String key, 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:
      setString in class COSDictionary
      Parameters:
      key - The key to the object,
      value - The string value for the name.
    • setString

      public void setString(COSName key, 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:
      setString in class COSDictionary
      Parameters:
      key - The key to the object,
      value - The string value for the name.
    • setEmbeddedString

      public void setEmbeddedString(String embedded, String key, 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:
      setEmbeddedString in class COSDictionary
      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(String embedded, COSName key, 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:
      setEmbeddedString in class COSDictionary
      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(String key, int value)
      This is a convenience method that will convert the value to a COSInteger object.
      Overrides:
      setInt in class COSDictionary
      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:
      setInt in class COSDictionary
      Parameters:
      key - The key to the object,
      value - The int value for the name.
    • setLong

      public void setLong(String key, long value)
      This is a convenience method that will convert the value to a COSInteger object.
      Overrides:
      setLong in class COSDictionary
      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:
      setLong in class COSDictionary
      Parameters:
      key - The key to the object,
      value - The int value for the name.
    • setEmbeddedInt

      public void setEmbeddedInt(String embeddedDictionary, String key, int value)
      This is a convenience method that will convert the value to a COSInteger object.
      Overrides:
      setEmbeddedInt in class COSDictionary
      Parameters:
      embeddedDictionary - The embedded dictionary.
      key - The key to the object,
      value - The int value for the name.
    • setEmbeddedInt

      public void setEmbeddedInt(String embeddedDictionary, COSName key, int value)
      This is a convenience method that will convert the value to a COSInteger object.
      Overrides:
      setEmbeddedInt in class COSDictionary
      Parameters:
      embeddedDictionary - The embedded dictionary.
      key - The key to the object,
      value - The int value for the name.
    • setFloat

      public void setFloat(String key, float value)
      This is a convenience method that will convert the value to a COSFloat object.
      Overrides:
      setFloat in class COSDictionary
      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:
      setFloat in class COSDictionary
      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:
      removeItem in class COSDictionary
      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:
      addAll in class COSDictionary
      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:
      mergeInto in class COSDictionary
      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:
      setFlag in class COSDictionary
      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:
      setNeedToBeUpdated in interface COSUpdateInfo
      Overrides:
      setNeedToBeUpdated in class COSDictionary
      Parameters:
      flag - the update state.