public final class TagCollection extends java.lang.Object implements ITagCollection
Represents the collection of tags (user defined pairs of strings)
The following example shows how to add a tag to a PowerPoint Presentation.Presentation pres = new Presentation("pres.pptx"); try { ITagCollection tags = pres.getCustomData().getTags(); pres.getCustomData().getTags().add("MyTag", "My Tag Value"); } finally { if (pres != null) pres.dispose(); }
| Modifier and Type | Method and Description |
|---|---|
int |
add(java.lang.String name,
java.lang.String value)
Adds a new tag to collection.
|
void |
clear()
Removes all tags from the collection.
|
boolean |
contains(java.lang.String name)
Determines whether the collection contains a specific name.
|
void |
copyTo(com.aspose.ms.System.Array array,
int index)
Copies all elements from the collection into the specified array.
|
java.lang.String |
get_Item(java.lang.String name)
Returns or sets a key and a value pair of a tag.
|
java.lang.String |
getNameByIndex(int index)
Returns key of a tag at the specified index.
|
java.lang.String[] |
getNamesOfTags()
Returns names of tags.
|
java.lang.Object |
getSyncRoot()
Returns a synchronization root.
|
java.lang.String |
getValueByIndex(int index)
Returns value of a tag at the specified index.
|
int |
indexOfName(java.lang.String name)
Returns the zero-based index of the specified key in the collection.
|
boolean |
isSynchronized()
Returns a value indicating whether access to the collection is synchronized (thread-safe).
|
com.aspose.ms.System.Collections.Generic.IGenericEnumerator<com.aspose.ms.System.Collections.Generic.KeyValuePair<java.lang.String,java.lang.String>> |
iterator()
Returns an enumerator that iterates through the collection.
|
com.aspose.ms.System.Collections.Generic.IGenericEnumerator<com.aspose.ms.System.Collections.Generic.KeyValuePair<java.lang.String,java.lang.String>> |
iteratorJava()
Returns a java iterator for the entire collection.
|
void |
remove(java.lang.String name)
Removes the tag with a specified name from the collection.
|
void |
removeAt(int index)
Removes the tag at the specified index.
|
void |
set_Item(java.lang.String name,
java.lang.String value)
Returns or sets a key and a value pair of a tag.
|
int |
size()
Returns a number of tags in the collectoin.
|
public final int size()
Returns a number of tags in the collectoin.
Read-only int.
size in interface com.aspose.ms.System.Collections.ICollection<com.aspose.ms.System.Collections.Generic.KeyValuePair<java.lang.String,java.lang.String>>public final int add(java.lang.String name,
java.lang.String value)
Adds a new tag to collection.
add in interface ITagCollectionname - The name of the tag.value - The value of the tag.public final void remove(java.lang.String name)
Removes the tag with a specified name from the collection.
remove in interface ITagCollectionname - The name of tag to remove.public final int indexOfName(java.lang.String name)
Returns the zero-based index of the specified key in the collection.
indexOfName in interface ITagCollectionname - The name to locate in the collection.public final boolean contains(java.lang.String name)
Determines whether the collection contains a specific name.
contains in interface ITagCollectionname - The key to locate.public final void removeAt(int index)
Removes the tag at the specified index.
removeAt in interface ITagCollectionindex - The zero-based index of the tag to remove.public final void clear()
Removes all tags from the collection.
clear in interface ITagCollectionpublic final java.lang.String getValueByIndex(int index)
Returns value of a tag at the specified index.
getValueByIndex in interface ITagCollectionindex - Index of a tag to return.public final java.lang.String getNameByIndex(int index)
Returns key of a tag at the specified index.
getNameByIndex in interface ITagCollectionindex - Index of a tag to return.public final java.lang.String[] getNamesOfTags()
Returns names of tags.
getNamesOfTags in interface ITagCollectionpublic final java.lang.String get_Item(java.lang.String name)
Returns or sets a key and a value pair of a tag.
get_Item in interface ITagCollectionname - Key of a tag.public final void set_Item(java.lang.String name,
java.lang.String value)
Returns or sets a key and a value pair of a tag.
set_Item in interface ITagCollectionname - Key of a tag.public final void copyTo(com.aspose.ms.System.Array array,
int index)
Copies all elements from the collection into the specified array.
copyTo in interface com.aspose.ms.System.Collections.ICollection<com.aspose.ms.System.Collections.Generic.KeyValuePair<java.lang.String,java.lang.String>>array - Array to fill.index - Starting position in target array.public final boolean isSynchronized()
Returns a value indicating whether access to the collection is synchronized (thread-safe).
Read-only boolean.
isSynchronized in interface com.aspose.ms.System.Collections.ICollection<com.aspose.ms.System.Collections.Generic.KeyValuePair<java.lang.String,java.lang.String>>public final java.lang.Object getSyncRoot()
Returns a synchronization root.
Read-only Object.
getSyncRoot in interface com.aspose.ms.System.Collections.ICollection<com.aspose.ms.System.Collections.Generic.KeyValuePair<java.lang.String,java.lang.String>>public final com.aspose.ms.System.Collections.Generic.IGenericEnumerator<com.aspose.ms.System.Collections.Generic.KeyValuePair<java.lang.String,java.lang.String>> 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<java.lang.String,java.lang.String>>iterator in interface com.aspose.ms.System.Collections.IEnumerable<com.aspose.ms.System.Collections.Generic.KeyValuePair<java.lang.String,java.lang.String>>iterator in interface java.lang.Iterable<com.aspose.ms.System.Collections.Generic.KeyValuePair<java.lang.String,java.lang.String>>IGenericEnumerator that can be used to iterate through the collection.public final com.aspose.ms.System.Collections.Generic.IGenericEnumerator<com.aspose.ms.System.Collections.Generic.KeyValuePair<java.lang.String,java.lang.String>> iteratorJava()
Returns a java iterator for the entire collection.
iteratorJava in interface IGenericCollection<com.aspose.ms.System.Collections.Generic.KeyValuePair<java.lang.String,java.lang.String>>Iterator for the entire collection.Copyright © 2004-2025 Aspose Pty Ltd. All Rights Reserved.