COSDictionary

COSDictionary

Overview

COSDictionary is a class in Aspose.Pdf FOSS for Java. Inherits from: COSBase, Iterable<Map.Entry<COSName, COSBase>>.

PDF dictionary object (§7.3.7, ISO 32000-1:2008).

Properties

NameTypeAccessDescription
emptybooleanReadReturns whether the dictionary is empty.
typeStringReadReturns the /Type value as a string (e.g.
subtypeStringReadReturns the /Subtype (or /S) value as a string, or null.
pathCOSBaseReadTraverses nested dictionaries by key path.
dirtybooleanReadReturns {@code true} if this object was modified since loading.
indirectbooleanReadReturns whether this object is an indirect object (has an object key).
objectKeyCOSObjectKeyReadReturns the indirect object key, or {@code null} for direct objects.

Methods

SignatureDescription
COSDictionary()Creates an empty dictionary.
COSDictionary(other: COSDictionary)Creates a dictionary as a shallow copy of another dictionary.
size()intReturns the number of entries.
isEmpty()booleanReturns whether the dictionary is empty.
containsKey(key: COSName)booleanReturns whether the dictionary contains the given key.
containsKey(key: String)booleanReturns whether the dictionary contains the given key (convenience method).
get(key: COSName)COSBaseReturns the value for the given key, or null.
get(key: String)COSBaseReturns the value for the given key (convenience method), or null.
set(key: COSName, value: COSBase)Sets a key-value pair.
set(key: String, value: COSBase)Sets a key-value pair (convenience method).
remove(key: COSName)COSBaseRemoves a key.
keySet()Set<COSName>Returns the set of keys.
values()Collection<COSBase>Returns the collection of values.
getInt(key: String, defaultValue: int)intReturns the value as an int, or the default.
getInt(key: COSName, defaultValue: int)intReturns the value as an int, or the default (COSName key variant).
getLong(key: String, defaultValue: long)longReturns the value as a long, or the default.
getFloat(key: String, defaultValue: float)floatReturns the value as a float, or the default.
getBoolean(key: String, defaultValue: boolean)booleanReturns the value as a boolean, or the default.
getNameAsString(key: String)StringReturns the value as a name string, or null.
getString(key: String)StringReturns the value as a decoded string, or null.
getDictionary(key: String)COSDictionaryReturns the value as a COSDictionary, or null.
getArray(key: String)COSArrayReturns the value as a COSArray, or null.
setInt(key: String, value: int)Sets an integer value.
setFloat(key: String, value: float)Sets a float value.
setBoolean(key: String, value: boolean)Sets a boolean value.
setName(key: String, nameValue: String)Sets a name value.
setString(key: String, stringValue: String)Sets a string value.
getType()StringReturns the /Type value as a string (e.g.
getSubtype()StringReturns the /Subtype (or /S) value as a string, or null.
getPath()COSBaseTraverses nested dictionaries by key path.
writeTo(os: OutputStream)
iterator()Iterator<Map.Entry<COSName, COSBase>>
accept(visitor: ICOSVisitor<T>)T
equals(o: Object)boolean
hashCode()int
toString()String
isDirty()booleanReturns {@code true} if this object was modified since loading.
setDirty(dirty: boolean)Sets the dirty flag on this object.
isIndirect()booleanReturns whether this object is an indirect object (has an object key).
getObjectKey()COSObjectKeyReturns the indirect object key, or {@code null} for direct objects.
setObjectKey(key: COSObjectKey)Sets the indirect object key.

See Also