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

MethodDescription
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, Point2D.Float position, Date creationTime)Add new comment at the end of a collection.
addModernComment(String text, ISlide slide, IShape shape, Point2D.Float position, Date creationTime)Add new modern comment at the end of a collection.
insertComment(int index, String text, ISlide slide, Point2D.Float position, Date creationTime)Insert new comment to a collection at the specified index.
insertModernComment(int index, String text, ISlide slide, IShape shape, Point2D.Float 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:

ParameterTypeDescription
indexint

Returns: IComment

addComment(String text, ISlide slide, Point2D.Float position, Date creationTime)

public final IComment addComment(String text, ISlide slide, Point2D.Float position, Date creationTime)

Add new comment at the end of a collection.

Parameters:

ParameterTypeDescription
textjava.lang.StringPlain text of a new comment.
slideISlideSlide in a presentation where to add a new comment.
positionjava.awt.geom.Point2D.FloatPosition on a slide where to add a new comment.
creationTimejava.util.DateTime of a comment creation.

Returns: IComment - Added comment.

addModernComment(String text, ISlide slide, IShape shape, Point2D.Float position, Date creationTime)

public final IModernComment addModernComment(String text, ISlide slide, IShape shape, Point2D.Float 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 Point2D.Float(100, 100), new Date());
     pres.save(outPptxFileName, SaveFormat.Pptx);
 } finally {
     if (pres != null) pres.dispose();
 }

Parameters:

ParameterTypeDescription
textjava.lang.StringPlain text of a new modern comment.
slideISlideSlide in a presentation where to add a new modern comment.
shapeIShapeShape on a slide to which a new modern comment is associated.
positionjava.awt.geom.Point2D.FloatPosition on a slide where to add a new modern comment.
creationTimejava.util.DateTime of a modern comment creation.

Returns: IModernComment - Added modern comment.

insertComment(int index, String text, ISlide slide, Point2D.Float position, Date creationTime)

public final IComment insertComment(int index, String text, ISlide slide, Point2D.Float position, Date creationTime)

Insert new comment to a collection at the specified index.

Parameters:

ParameterTypeDescription
indexintIndex of the element in a collection at which comment should be inserted.
textjava.lang.StringPlain text of a new comment.
slideISlideSlide in a presentation where to add a new comment.
positionjava.awt.geom.Point2D.FloatPosition on a slide where to add a new comment.
creationTimejava.util.DateTime of a comment creation.

Returns: IComment - Inserted comment.

insertModernComment(int index, String text, ISlide slide, IShape shape, Point2D.Float position, Date creationTime)

public final IModernComment insertModernComment(int index, String text, ISlide slide, IShape shape, Point2D.Float position, Date creationTime)

Insert new modern comment to a collection at the specified index.

Parameters:

ParameterTypeDescription
indexintIndex of the element in a collection at which modern comment should be inserted.
textjava.lang.StringPlain text of a new modern comment.
slideISlideSlide in a presentation where to add a new modern comment.
shapeIShapeShape on a slide to which a new modern comment is associated.
positionjava.awt.geom.Point2D.FloatPosition on a slide where to add a new modern comment.
creationTimejava.util.DateTime 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:

ParameterTypeDescription
startIndexintAn index of a first comment to return.
countintA 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:

ParameterTypeDescription
indexintThe 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:

ParameterTypeDescription
commentICommentThe 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:

ParameterTypeDescription
idxintUnique 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:

ParameterTypeDescription
arraycom.aspose.ms.System.ArrayTarget array.
indexintStarting 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