CommentCollection
Inheritance: java.lang.Object, com.aspose.slides.DomObject
All Implemented Interfaces: com.aspose.slides.ICommentCollection
public final class CommentCollection extends DomObject<CommentAuthor> implements ICommentCollection
Represents a collection of comments of one author.
Methods
Method | Description |
---|---|
size() | Gets the number of elements actually contained in the collection. |
get_Item(int index) | Gets the element at the specified index. |
addComment(String text, ISlide slide, PointF position, Date creationTime) | Add new comment at the end of a collection. |
addModernComment(String text, ISlide slide, IShape shape, PointF position, Date creationTime) | Add new modern comment at the end of a collection. |
insertComment(int index, String text, ISlide slide, PointF position, Date creationTime) | Insert new comment to a collection at the specified index. |
insertModernComment(int index, String text, ISlide slide, IShape shape, PointF position, Date creationTime) | Insert new modern comment to a collection at the specified index. |
toArray() | Creates and returns an array with all comments. |
toArray(int startIndex, int count) | Creates and returns an array with all comments from the specified range. |
removeAt(int index) | Removes the element at the specified index in a collection. |
remove(IComment comment) | Removes the first occurrence of the specified comment in a collection. |
clear() | Removes all comments from a collection. |
iterator() | Returns an enumerator that iterates through the collection. |
iteratorJava() | Returns a java iterator for the entire collection. |
findCommentByIdx(int idx) | Finds a comment in the collection by index. |
copyTo(System.Array array, int index) | Copies all elements from the collection to the specified array. |
isSynchronized() | Returns a value indicating whether access to the collection is synchronized (thread-safe). |
getSyncRoot() | Returns a synchronization root. |
size()
public final int size()
Gets the number of elements actually contained in the collection. Read-only int .
Returns: int
get_Item(int index)
public final IComment get_Item(int index)
Gets the element at the specified index. Read-only Comment.
Parameters:
Parameter | Type | Description |
---|---|---|
index | int |
Returns: IComment
addComment(String text, ISlide slide, PointF position, Date creationTime)
public final IComment addComment(String text, ISlide slide, PointF position, Date creationTime)
Add new comment at the end of a collection.
Parameters:
Parameter | Type | Description |
---|---|---|
text | java.lang.String | Plain text of a new comment. |
slide | ISlide | Slide in a presentation where to add a new comment. |
position | android.graphics.PointF | Position on a slide where to add a new comment. |
creationTime | java.util.Date | Time of a comment creation. |
Returns: IComment - Added comment.
addModernComment(String text, ISlide slide, IShape shape, PointF position, Date creationTime)
public final IModernComment addModernComment(String text, ISlide slide, IShape shape, PointF position, 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 android.graphics.PointF(100, 100), new Date()); pres.save(outPptxFileName, SaveFormat.Pptx); } finally { if (pres != null) pres.dispose(); }
Parameters:
Parameter | Type | Description |
---|---|---|
text | java.lang.String | Plain text of a new modern comment. |
slide | ISlide | Slide in a presentation where to add a new modern comment. |
shape | IShape | Shape on a slide to which a new modern comment is associated. |
position | android.graphics.PointF | Position on a slide where to add a new modern comment. |
creationTime | java.util.Date | Time of a modern comment creation. |
Returns: IModernComment - Added modern comment.
insertComment(int index, String text, ISlide slide, PointF position, Date creationTime)
public final IComment insertComment(int index, String text, ISlide slide, PointF position, Date creationTime)
Insert new comment to a collection at the specified index.
Parameters:
Parameter | Type | Description |
---|---|---|
index | int | Index of the element in a collection at which comment should be inserted. |
text | java.lang.String | Plain text of a new comment. |
slide | ISlide | Slide in a presentation where to add a new comment. |
position | android.graphics.PointF | Position on a slide where to add a new comment. |
creationTime | java.util.Date | Time of a comment creation. |
Returns: IComment - Inserted comment.
insertModernComment(int index, String text, ISlide slide, IShape shape, PointF position, Date creationTime)
public final IModernComment insertModernComment(int index, String text, ISlide slide, IShape shape, PointF position, Date creationTime)
Insert new modern comment to a collection at the specified index.
Parameters:
Parameter | Type | Description |
---|---|---|
index | int | Index of the element in a collection at which modern comment should be inserted. |
text | java.lang.String | Plain text of a new modern comment. |
slide | ISlide | Slide in a presentation where to add a new modern comment. |
shape | IShape | Shape on a slide to which a new modern comment is associated. |
position | android.graphics.PointF | Position on a slide where to add a new modern comment. |
creationTime | java.util.Date | Time of a modern comment creation. |
Returns: IModernComment - Inserted modern comment.
toArray()
public final IComment[] toArray()
Creates and returns an array with all comments.
Returns: com.aspose.slides.IComment[] - Array of Comment.
toArray(int startIndex, int count)
public final IComment[] toArray(int startIndex, int count)
Creates and returns an array with all comments from the specified range.
Parameters:
Parameter | Type | Description |
---|---|---|
startIndex | int | An index of a first comment to return. |
count | int | A number of comments to return. |
Returns: com.aspose.slides.IComment[] - Array of Comment.
removeAt(int index)
public final void removeAt(int index)
Removes the element at the specified index in a collection.
Parameters:
Parameter | Type | Description |
---|---|---|
index | int | The zero-based index of the element to remove. |
remove(IComment comment)
public final void remove(IComment comment)
Removes the first occurrence of the specified comment in a collection.
Parameters:
Parameter | Type | Description |
---|---|---|
comment | IComment | The comment to remove from a collection. |
clear()
public final void clear()
Removes all comments from a collection.
iterator()
public final System.Collections.Generic.IGenericEnumerator<IComment> iterator()
Returns an enumerator that iterates through the collection.
Returns: com.aspose.ms.System.Collections.Generic.IGenericEnumerator<com.aspose.slides.IComment> - A IGenericEnumerator that can be used to iterate through the collection.
iteratorJava()
public final System.Collections.Generic.IGenericEnumerator<IComment> iteratorJava()
Returns a java iterator for the entire collection.
Returns: com.aspose.ms.System.Collections.Generic.IGenericEnumerator<com.aspose.slides.IComment> - An java.util.Iterator for the entire collection.
findCommentByIdx(int idx)
public final IComment findCommentByIdx(int idx)
Finds a comment in the collection by index.
Parameters:
Parameter | Type | Description |
---|---|---|
idx | int | Unique index of a comment to find int . |
Returns: IComment - Found comment or null IComment.
copyTo(System.Array array, int index)
public final void copyTo(System.Array array, int index)
Copies all elements from the collection to the specified array.
Parameters:
Parameter | Type | Description |
---|---|---|
array | com.aspose.ms.System.Array | Target array. |
index | int | Starting index in the target array. |
isSynchronized()
public final boolean isSynchronized()
Returns a value indicating whether access to the collection is synchronized (thread-safe). Read-only boolean .
Returns: boolean
getSyncRoot()
public final Object getSyncRoot()
Returns a synchronization root. Read-only Object .
Returns: java.lang.Object