public class DictionaryEditor extends Hashtable<String,ICosPdfPrimitive>
A class for accessing an document's tree dictionary (document dictionary, page dictionary, resources dictionary).
Constructor and Description |
---|
DictionaryEditor(Document document) |
DictionaryEditor(Page page) |
DictionaryEditor(Resources resources) |
Modifier and Type | Method and Description |
---|---|
void |
add(com.aspose.ms.System.Collections.Generic.KeyValuePair<String,ICosPdfPrimitive> item)
Set
ICosPdfPrimitive to dictionary. |
void |
add(String key,
ICosPdfPrimitive value)
Set
ICosPdfPrimitive to dictionary. |
void |
clear()
Removes all items from the
DictionaryEditor . |
boolean |
contains(com.aspose.ms.System.Collections.Generic.KeyValuePair<String,ICosPdfPrimitive> item)
Determines whether the
DictionaryEditor contains a specific value. |
boolean |
containsKey(String key)
Determines whether the
DictionaryEditor contains an element with the specified key. |
void |
copyTo(com.aspose.ms.System.Collections.Generic.KeyValuePair<String,ICosPdfPrimitive>[] array,
int arrayIndex)
|
ICosPdfPrimitive |
get_Item(String key)
Gets or sets the element with the specified key.
|
com.aspose.ms.System.Collections.Generic.IGenericCollection<String> |
getAllKeys()
Full collection of keys.
|
com.aspose.ms.System.Collections.Generic.IGenericCollection<String> |
getKeys()
Collection of editable keys.
|
com.aspose.ms.System.Collections.Generic.IGenericCollection<ICosPdfPrimitive> |
getValues()
Gets an
ICollection containing the values in the DictionaryEditor . |
boolean |
isReadOnly()
Gets a value indicating whether the
DictionaryEditor is read-only. |
com.aspose.ms.System.Collections.Generic.IGenericEnumerator<com.aspose.ms.System.Collections.Generic.KeyValuePair<String,ICosPdfPrimitive>> |
iterator()
Returns an enumerator that iterates through the collection.
|
boolean |
remove(com.aspose.ms.System.Collections.Generic.KeyValuePair<String,ICosPdfPrimitive> item)
Removes the first occurrence of a specific object from the
DictionaryEditor . |
boolean |
remove(String key)
Removes the element with the specified key from the
DictionaryEditor . |
void |
set_Item(String key,
ICosPdfPrimitive value)
Gets or sets the element with the specified key.
|
int |
size()
Gets the number of elements contained in the
DictionaryEditor . |
boolean |
tryGetValue(String key,
ICosPdfPrimitive[] value)
For access to simple data type like string, name, bool, number.
|
clone, compute, computeIfAbsent, computeIfPresent, contains, containsKey, containsValue, elements, entrySet, equals, forEach, get, getOrDefault, hashCode, isEmpty, keys, keySet, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, toString, values
public DictionaryEditor(Page page)
page
- A page with a dictionary for work.com.aspose.ms.System.ArgumentNullException
- The page is null or page structure is broken.public DictionaryEditor(Document document)
document
- A document with a dictionary for work.com.aspose.ms.System.ArgumentNullException
- The document is null.public DictionaryEditor(Resources resources)
resources
- Resources with a dictionary for work.com.aspose.ms.System.ArgumentNullException
- The resources are null.public final com.aspose.ms.System.Collections.Generic.IGenericCollection<String> getAllKeys()
Full collection of keys. Contains editable and not editable keys.
public final com.aspose.ms.System.Collections.Generic.IGenericCollection<String> getKeys()
Collection of editable keys.
public final com.aspose.ms.System.Collections.Generic.IGenericCollection<ICosPdfPrimitive> getValues()
Gets an ICollection
containing the values in the DictionaryEditor
.
public final int size()
Gets the number of elements contained in the DictionaryEditor
.
size
in interface Map<String,ICosPdfPrimitive>
size
in class Hashtable<String,ICosPdfPrimitive>
public final boolean isReadOnly()
Gets a value indicating whether the DictionaryEditor
is read-only.
DictionaryEditor
is read-only; otherwise, false.public final ICosPdfPrimitive get_Item(String key)
Gets or sets the element with the specified key.
key
- The key of the element to get or set.com.aspose.ms.System.ArgumentNullException
- The key is null.com.aspose.ms.System.Collections.Generic.KeyNotFoundException
- The property is retrieved and key is not found.com.aspose.ms.System.ArgumentException
- Throw exception if key can't be edited/set.public final void set_Item(String key, ICosPdfPrimitive value)
Gets or sets the element with the specified key.
key
- The key of the element to get or set.value
- The ICosPdfPrimitive instancecom.aspose.ms.System.ArgumentNullException
- The key is null.com.aspose.ms.System.Collections.Generic.KeyNotFoundException
- The property is retrieved and key is not found.com.aspose.ms.System.ArgumentException
- Throw exception if key can't be edited/set.public final boolean containsKey(String key)
Determines whether the DictionaryEditor
contains an element with the specified key.
key
- The key to locate in the DictionaryEditor
.DictionaryEditor
contains an editable element with the key; otherwise, false.public final boolean remove(String key)
Removes the element with the specified key from the DictionaryEditor
.
key
- The key of the element to remove.public final boolean tryGetValue(String key, ICosPdfPrimitive[] value)
For access to simple data type like string, name, bool, number. Returns null for other types.
key
- Key valuevalue
- returns ICosPdfPrimitive
for key or null.ICosPdfPrimitive
is like string, name, bool, number.
Returns false for all other types.public final void add(String key, ICosPdfPrimitive value)
Set ICosPdfPrimitive
to dictionary.
key
- Key.value
- Value.com.aspose.ms.System.ArgumentException
- Throw exception if key/value can't be edited or removed.public final void add(com.aspose.ms.System.Collections.Generic.KeyValuePair<String,ICosPdfPrimitive> item)
Set ICosPdfPrimitive
to dictionary.
item
- The pair with a key and a value.com.aspose.ms.System.ArgumentException
- Throw exception if key/value can't be edited or removed.public final void clear()
Removes all items from the DictionaryEditor
.
clear
in interface Map<String,ICosPdfPrimitive>
clear
in class Hashtable<String,ICosPdfPrimitive>
public final boolean contains(com.aspose.ms.System.Collections.Generic.KeyValuePair<String,ICosPdfPrimitive> item)
Determines whether the DictionaryEditor
contains a specific value.
item
- The desired object.DictionaryEditor
;
otherwise, false.public final void copyTo(com.aspose.ms.System.Collections.Generic.KeyValuePair<String,ICosPdfPrimitive>[] array, int arrayIndex)
Copies the elements of the DictionaryEditor
to an Array
,
starting at a particular Array
index.
array
- The one-dimensional Array
that is the destination of the elements copied
from DictionaryEditor
. The Array
must have zero-based
indexing.arrayIndex
- The zero-based index in array at which copying begins.com.aspose.ms.System.ArgumentNullException
- The array is null.com.aspose.ms.System.ArgumentOutOfRangeException
- The arrayIndex is less than 0.com.aspose.ms.System.ArgumentException
- The number of elements in the source DictionaryEditor
is greater than the available space from arrayIndex to the end of the destination array.public final boolean remove(com.aspose.ms.System.Collections.Generic.KeyValuePair<String,ICosPdfPrimitive> item)
Removes the first occurrence of a specific object from the DictionaryEditor
.
item
- The object to remove from the DictionaryEditor
.DictionaryEditor
;
otherwise, false. This method also returns false if item is not found in the
original DictionaryEditor
.public final com.aspose.ms.System.Collections.Generic.IGenericEnumerator<com.aspose.ms.System.Collections.Generic.KeyValuePair<String,ICosPdfPrimitive>> iterator()
Returns an enumerator that iterates through the collection.
Copyright © 2025 Aspose. All Rights Reserved.