public final class CommentCollection extends DomObject<CommentAuthor> implements ICommentCollection
Represents a collection of comments of one author.
| Modifier and Type | Method and Description |
|---|---|
IComment |
addComment(java.lang.String text,
ISlide slide,
java.awt.geom.Point2D.Float position,
java.util.Date creationTime)
Add new comment at the end of a collection.
|
IModernComment |
addModernComment(java.lang.String text,
ISlide slide,
IShape shape,
java.awt.geom.Point2D.Float position,
java.util.Date creationTime)
Add new modern comment at the end of a collection.
|
void |
clear()
Removes all comments from a collection.
|
void |
copyTo(com.aspose.ms.System.Array array,
int index)
Copies all elements from the collection to the specified array.
|
IComment |
findCommentByIdx(int idx)
Finds a comment in the collection by index.
|
IComment |
get_Item(int index)
Gets the element at the specified index.
|
java.lang.Object |
getSyncRoot()
Returns a synchronization root.
|
IComment |
insertComment(int index,
java.lang.String text,
ISlide slide,
java.awt.geom.Point2D.Float position,
java.util.Date creationTime)
Insert new comment to a collection at the specified index.
|
IModernComment |
insertModernComment(int index,
java.lang.String text,
ISlide slide,
IShape shape,
java.awt.geom.Point2D.Float position,
java.util.Date creationTime)
Insert new modern comment to a collection at the specified index.
|
boolean |
isSynchronized()
Returns a value indicating whether access to the collection is synchronized (thread-safe).
|
com.aspose.ms.System.Collections.Generic.IGenericEnumerator<IComment> |
iterator()
Returns an enumerator that iterates through the collection.
|
com.aspose.ms.System.Collections.Generic.IGenericEnumerator<IComment> |
iteratorJava()
Returns a java iterator for the entire collection.
|
void |
remove(IComment comment)
Removes the first occurrence of the specified comment in a collection.
|
void |
removeAt(int index)
Removes the element at the specified index in a collection.
|
int |
size()
Gets the number of elements actually contained in the collection.
|
IComment[] |
toArray()
Creates and returns an array with all comments.
|
IComment[] |
toArray(int startIndex,
int count)
Creates and returns an array with all comments from the specified range.
|
getParent_Immediatepublic final int size()
Gets the number of elements actually contained in the collection.
Read-only int.
size in interface com.aspose.ms.System.Collections.ICollection<IComment>public final IComment get_Item(int index)
Gets the element at the specified index.
Read-only Comment.
get_Item in interface ICommentCollectionpublic final IComment addComment(java.lang.String text, ISlide slide, java.awt.geom.Point2D.Float position, java.util.Date creationTime)
Add new comment at the end of a collection.
addComment in interface ICommentCollectiontext - Plain text of a new comment.slide - Slide in a presentation where to add a new comment.position - Position on a slide where to add a new comment.creationTime - Time of a comment creation.public final IModernComment addModernComment(java.lang.String text, ISlide slide, IShape shape, java.awt.geom.Point2D.Float position, java.util.Date creationTime)
Add new modern comment at the end of a collection.
Presentation pres = new Presentation(); try { ICommentAuthor newAuthor = pres.getCommentAuthors().addAuthor("Some Author", "SA"); newAuthor.getComments().addModernComment("This is modern comment", pres.getSlides().get_Item(0), null, new Point2D.Float(100, 100), new Date()); pres.save(outPptxFileName, SaveFormat.Pptx); } finally { if (pres != null) pres.dispose(); }
addModernComment in interface ICommentCollectiontext - Plain text of a new modern comment.slide - Slide in a presentation where to add a new modern comment.shape - Shape on a slide to which a new modern comment is associated.position - Position on a slide where to add a new modern comment.creationTime - Time of a modern comment creation.public final IComment insertComment(int index, java.lang.String text, ISlide slide, java.awt.geom.Point2D.Float position, java.util.Date creationTime)
Insert new comment to a collection at the specified index.
insertComment in interface ICommentCollectionindex - Index of the element in a collection at which comment should be inserted.text - Plain text of a new comment.slide - Slide in a presentation where to add a new comment.position - Position on a slide where to add a new comment.creationTime - Time of a comment creation.public final IModernComment insertModernComment(int index, java.lang.String text, ISlide slide, IShape shape, java.awt.geom.Point2D.Float position, java.util.Date creationTime)
Insert new modern comment to a collection at the specified index.
insertModernComment in interface ICommentCollectionindex - Index of the element in a collection at which modern comment should be inserted.text - Plain text of a new modern comment.slide - Slide in a presentation where to add a new modern comment.shape - Shape on a slide to which a new modern comment is associated.position - Position on a slide where to add a new modern comment.creationTime - Time of a modern comment creation.public final IComment[] toArray()
Creates and returns an array with all comments.
toArray in interface ICommentCollectionComment.public final IComment[] toArray(int startIndex, int count)
Creates and returns an array with all comments from the specified range.
toArray in interface ICommentCollectionstartIndex - An index of a first comment to return.count - A number of comments to return.Comment.public final void removeAt(int index)
Removes the element at the specified index in a collection.
removeAt in interface ICommentCollectionindex - The zero-based index of the element to remove.com.aspose.ms.System.ArgumentOutOfRangeException - Index is less than 0 or index is equal or greater than CountPptxEditException - Thrown if comment is already removed.public final void remove(IComment comment)
Removes the first occurrence of the specified comment in a collection.
remove in interface ICommentCollectioncomment - The comment to remove from a collection.com.aspose.ms.System.ArgumentNullException - If comment is nullPptxEditException - Thrown if comment is already removed.public final void clear()
Removes all comments from a collection.
clear in interface ICommentCollectionpublic final com.aspose.ms.System.Collections.Generic.IGenericEnumerator<IComment> iterator()
Returns an enumerator that iterates through the collection.
iterator in interface com.aspose.ms.System.Collections.Generic.IGenericEnumerable<IComment>iterator in interface com.aspose.ms.System.Collections.IEnumerable<IComment>iterator in interface java.lang.Iterable<IComment>IGenericEnumerator that can be used to iterate through the collection.public final com.aspose.ms.System.Collections.Generic.IGenericEnumerator<IComment> iteratorJava()
Returns a java iterator for the entire collection.
iteratorJava in interface IGenericCollection<IComment>Iterator for the entire collection.public final IComment findCommentByIdx(int idx)
Finds a comment in the collection by index.
idx - Unique index of a comment to find int.IComment.public final void copyTo(com.aspose.ms.System.Array array,
int index)
Copies all elements from the collection to the specified array.
copyTo in interface com.aspose.ms.System.Collections.ICollection<IComment>array - Target array.index - Starting index in the 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<IComment>public final java.lang.Object getSyncRoot()
Returns a synchronization root.
Read-only Object.
getSyncRoot in interface com.aspose.ms.System.Collections.ICollection<IComment>Copyright © 2004-2025 Aspose Pty Ltd. All Rights Reserved.