public class CosPdfDictionary extends CosPdfPrimitive implements com.aspose.ms.System.Collections.Generic.IGenericDictionary<String,ICosPdfPrimitive>
A class for accessing an object's dictionary.
Constructor and Description |
---|
CosPdfDictionary(Resources resources)
Creates a dictionary from 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 |
addItem(com.aspose.ms.System.Collections.Generic.KeyValuePair<String,ICosPdfPrimitive> stringICosPdfPrimitiveKeyValuePair)
Add item pair.
|
void |
addItem(String s,
ICosPdfPrimitive iCosPdfPrimitive)
Add item.
|
void |
clear()
Removes all items from the
CosPdfDictionary . |
boolean |
contains(com.aspose.ms.System.Collections.Generic.KeyValuePair<String,ICosPdfPrimitive> item)
Determines whether the
CosPdfDictionary contains a specific value. |
boolean |
containsItem(com.aspose.ms.System.Collections.Generic.KeyValuePair<String,ICosPdfPrimitive> stringICosPdfPrimitiveKeyValuePair)
Return true if contains item
|
boolean |
containsKey(String key)
Determines whether the
CosPdfDictionary contains an element with the specified key. |
void |
copyTo(com.aspose.ms.System.Collections.Generic.KeyValuePair<String,ICosPdfPrimitive>[] array,
int arrayIndex)
|
void |
copyToTArray(com.aspose.ms.System.Collections.Generic.KeyValuePair<String,ICosPdfPrimitive>[] keyValuePairs,
int i)
Copy To Array
|
static CosPdfDictionary |
createEmptyDictionary(Document document)
Creates an empty dictionary that will be attached to the document.
|
static CosPdfDictionary |
createEmptyDictionary(Page page)
Creates an empty dictionary that will be attached to the page.
|
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 CosPdfDictionary . |
boolean |
isReadOnly()
Gets a value indicating whether the
CosPdfDictionary 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
CosPdfDictionary . |
boolean |
remove(String key)
Removes the element with the specified key from the
CosPdfDictionary . |
boolean |
removeItem(com.aspose.ms.System.Collections.Generic.KeyValuePair<String,ICosPdfPrimitive> stringICosPdfPrimitiveKeyValuePair)
Remove Item
|
boolean |
removeItemByKey(String s)
Remove item by key.
|
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
CosPdfDictionary . |
CosPdfDictionary |
toCosPdfDictionary()
Tries cast this instance to
CosPdfDictionary . |
boolean |
tryGetValue(String key,
ICosPdfPrimitive[] value)
For access to simple data type like string, name, bool, number.
|
boolean |
tryGetValue(String s,
Object[] objects)
Try to get value
|
toCosPdfBoolean, toCosPdfName, toCosPdfNumber, toCosPdfString
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forEach, spliterator
toString
public CosPdfDictionary(Resources resources)
Creates a dictionary from resources.
resources
- Resources with a dictionary for work.com.aspose.ms.System.ArgumentNullException
- The resources are null.public static CosPdfDictionary createEmptyDictionary(Page page)
Creates an empty dictionary that will be attached to the page.
page
- Result dictionary will be attached to this page.com.aspose.ms.System.ArgumentNullException
- The page is null.public static CosPdfDictionary createEmptyDictionary(Document document)
Creates an empty dictionary that will be attached to the document.
document
- Result dictionary will be attached to this document.com.aspose.ms.System.ArgumentNullException
- The document is 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.
getKeys
in interface com.aspose.ms.System.Collections.Generic.IGenericDictionary<String,ICosPdfPrimitive>
public final com.aspose.ms.System.Collections.Generic.IGenericCollection<ICosPdfPrimitive> getValues()
Gets an ICollection
containing the values in the CosPdfDictionary
.
getValues
in interface com.aspose.ms.System.Collections.Generic.IGenericDictionary<String,ICosPdfPrimitive>
public final int size()
Gets the number of elements contained in the CosPdfDictionary
.
size
in interface com.aspose.ms.System.Collections.Generic.IGenericCollection<com.aspose.ms.System.Collections.Generic.KeyValuePair<String,ICosPdfPrimitive>>
public final boolean isReadOnly()
Gets a value indicating whether the CosPdfDictionary
is read-only.
isReadOnly
in interface com.aspose.ms.System.Collections.Generic.IGenericCollection<com.aspose.ms.System.Collections.Generic.KeyValuePair<String,ICosPdfPrimitive>>
CosPdfDictionary
is read-only; otherwise, false.public void addItem(com.aspose.ms.System.Collections.Generic.KeyValuePair<String,ICosPdfPrimitive> stringICosPdfPrimitiveKeyValuePair)
Add item pair.
addItem
in interface com.aspose.ms.System.Collections.Generic.IGenericCollection<com.aspose.ms.System.Collections.Generic.KeyValuePair<String,ICosPdfPrimitive>>
stringICosPdfPrimitiveKeyValuePair
- KeyValuePair of String and ICosPdfPrimitivepublic final ICosPdfPrimitive get_Item(String key)
Gets or sets the element with the specified key.
get_Item
in interface com.aspose.ms.System.Collections.Generic.IGenericDictionary<String,ICosPdfPrimitive>
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.
set_Item
in interface com.aspose.ms.System.Collections.Generic.IGenericDictionary<String,ICosPdfPrimitive>
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 void addItem(String s, ICosPdfPrimitive iCosPdfPrimitive)
Add item.
addItem
in interface com.aspose.ms.System.Collections.Generic.IGenericDictionary<String,ICosPdfPrimitive>
s
- String valueiCosPdfPrimitive
- ICosPdfPrimitive instancepublic final boolean containsKey(String key)
Determines whether the CosPdfDictionary
contains an element with the specified key.
containsKey
in interface com.aspose.ms.System.Collections.Generic.IGenericDictionary<String,ICosPdfPrimitive>
key
- The key to locate in the CosPdfDictionary
.CosPdfDictionary
contains an editable element with the key; otherwise, false.public boolean removeItemByKey(String s)
Remove item by key.
removeItemByKey
in interface com.aspose.ms.System.Collections.Generic.IGenericDictionary<String,ICosPdfPrimitive>
s
- String valuepublic boolean tryGetValue(String s, Object[] objects)
Try to get value
tryGetValue
in interface com.aspose.ms.System.Collections.Generic.IGenericDictionary<String,ICosPdfPrimitive>
s
- String valueobjects
- array of Objectspublic final boolean remove(String key)
Removes the element with the specified key from the CosPdfDictionary
.
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 CosPdfDictionary
.
clear
in interface com.aspose.ms.System.Collections.Generic.IGenericCollection<com.aspose.ms.System.Collections.Generic.KeyValuePair<String,ICosPdfPrimitive>>
public boolean containsItem(com.aspose.ms.System.Collections.Generic.KeyValuePair<String,ICosPdfPrimitive> stringICosPdfPrimitiveKeyValuePair)
containsItem
in interface com.aspose.ms.System.Collections.Generic.IGenericCollection<com.aspose.ms.System.Collections.Generic.KeyValuePair<String,ICosPdfPrimitive>>
stringICosPdfPrimitiveKeyValuePair
- KeyValuePair instancepublic void copyToTArray(com.aspose.ms.System.Collections.Generic.KeyValuePair<String,ICosPdfPrimitive>[] keyValuePairs, int i)
copyToTArray
in interface com.aspose.ms.System.Collections.Generic.IGenericCollection<com.aspose.ms.System.Collections.Generic.KeyValuePair<String,ICosPdfPrimitive>>
keyValuePairs
- Array of KeyValuePair instancesi
- int valuepublic boolean removeItem(com.aspose.ms.System.Collections.Generic.KeyValuePair<String,ICosPdfPrimitive> stringICosPdfPrimitiveKeyValuePair)
Remove Item
removeItem
in interface com.aspose.ms.System.Collections.Generic.IGenericCollection<com.aspose.ms.System.Collections.Generic.KeyValuePair<String,ICosPdfPrimitive>>
stringICosPdfPrimitiveKeyValuePair
- KeyValuePair instancepublic final boolean contains(com.aspose.ms.System.Collections.Generic.KeyValuePair<String,ICosPdfPrimitive> item)
Determines whether the CosPdfDictionary
contains a specific value.
item
- The desired object.CosPdfDictionary
;
otherwise, false.public final void copyTo(com.aspose.ms.System.Collections.Generic.KeyValuePair<String,ICosPdfPrimitive>[] array, int arrayIndex)
Copies the elements of the CosPdfDictionary
to an Array
,
starting at a particular Array
index.
array
- The one-dimensional Array
that is the destination of the elements copied
from CosPdfDictionary
. 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 CosPdfDictionary
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 CosPdfDictionary
.
item
- The object to remove from the CosPdfDictionary
.CosPdfDictionary
;
otherwise, false. This method also returns false if item is not found in the
original CosPdfDictionary
.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.
iterator
in interface com.aspose.ms.System.Collections.Generic.IGenericEnumerable<com.aspose.ms.System.Collections.Generic.KeyValuePair<String,ICosPdfPrimitive>>
iterator
in interface com.aspose.ms.System.Collections.IEnumerable<com.aspose.ms.System.Collections.Generic.KeyValuePair<String,ICosPdfPrimitive>>
iterator
in interface Iterable<com.aspose.ms.System.Collections.Generic.KeyValuePair<String,ICosPdfPrimitive>>
public CosPdfDictionary toCosPdfDictionary()
Tries cast this instance to CosPdfDictionary
.
toCosPdfDictionary
in interface ICosPdfPrimitive
toCosPdfDictionary
in class CosPdfPrimitive
CosPdfDictionary
else CosPdfDictionary
.Copyright © 2025 Aspose. All Rights Reserved.