ParagraphCollection

Inheritance: java.lang.Object, com.aspose.slides.DomObject

All Implemented Interfaces: com.aspose.slides.IParagraphCollection

public final class ParagraphCollection extends DomObject<TextFrame> implements IParagraphCollection

Represents a collection of a paragraphs.

Methods

MethodDescription
getCount()Gets the number of elements actually contained in the collection.
isReadOnly()Gets a value indicating whether the IGenericCollection is read-only.
get_Item(int index)Gets the element at the specified index.
add(IParagraph value)Adds a Paragraph to the end of collection.
add(IParagraphCollection value)Adds a content of ParagraphCollection to the end of collection.
indexOf(IParagraph item)Determines the index of a specific item in the List.
insert(int index, IParagraph value)Inserts a Paragraph into the collection at the specified index.
insert(int index, IParagraphCollection value)Inserts a content of ParagraphCollection into the collection at the specified index.
clear()Removes all elements from the collection.
contains(IParagraph item)Determines whether the IGenericCollection contains a specific value.
copyTo(IParagraph[] array, int arrayIndex)Copies the elements of the IGenericCollection to an Array, starting at a particular Array index.
removeAt(int index)Removes the element at the specified index of the collection.
remove(IParagraph item)Removes the first occurrence of a specific object from the IGenericCollection.
iterator()Returns an enumerator that iterates through the collection.
iteratorJava()Returns a java iterator for the entire collection.
getSlide()Returns the parent slide of a paragraphs collection.
getPresentation()Returns the parent presentation of a paragraphs collection.
addFromHtml(String text)Adds text from specified html string to the collection.
addFromHtml(String text, IExternalResourceResolver resolver, String uri)Adds text from specified html string to the collection.
exportToHtml(int firstParagraphIndex, int paragraphsCount, ITextToHtmlConversionOptions options)Converts specifying paragraphs to the HTML and returns it as String object.

getCount()

public final int getCount()

Gets the number of elements actually contained in the collection. Read-only int.

Returns: int

isReadOnly()

public final boolean isReadOnly()

Gets a value indicating whether the IGenericCollection is read-only. Read-only boolean.

Returns: boolean - true if the IGenericCollection is read-only; otherwise, false.

get_Item(int index)

public final IParagraph get_Item(int index)

Gets the element at the specified index.

Parameters:

ParameterTypeDescription
indexint

Returns: IParagraph

add(IParagraph value)

public final void add(IParagraph value)

Adds a Paragraph to the end of collection.

Parameters:

ParameterTypeDescription
valueIParagraphThe Paragraph to be added to the end of the collection.

add(IParagraphCollection value)

public final int add(IParagraphCollection value)

Adds a content of ParagraphCollection to the end of collection.

Parameters:

ParameterTypeDescription
valueIParagraphCollectionThe ParagraphCollection to be added to the end of the collection.

Returns: int - The index at which the Paragraph has been added or -1 if there are nothing to add.

indexOf(IParagraph item)

public final int indexOf(IParagraph item)

Determines the index of a specific item in the List.

Parameters:

ParameterTypeDescription
itemIParagraphThe object to locate in the List.

Returns: int - The index of item if found in the list; otherwise, -1.

insert(int index, IParagraph value)

public final void insert(int index, IParagraph value)

Inserts a Paragraph into the collection at the specified index.

Parameters:

ParameterTypeDescription
indexintThe zero-based index at which Paragraph should be inserted.
valueIParagraphThe Paragraph to insert.

insert(int index, IParagraphCollection value)

public final void insert(int index, IParagraphCollection value)

Inserts a content of ParagraphCollection into the collection at the specified index.

Parameters:

ParameterTypeDescription
indexintThe zero-based index at which paragraphs should be inserted.
valueIParagraphCollectionThe paragraphs to insert.

clear()

public final void clear()

Removes all elements from the collection.

contains(IParagraph item)

public final boolean contains(IParagraph item)

Determines whether the IGenericCollection contains a specific value.

Parameters:

ParameterTypeDescription
itemIParagraphThe object to locate in the IGenericCollection.

Returns: boolean - true if item is found in the IGenericCollection; otherwise, false.

copyTo(IParagraph[] array, int arrayIndex)

public final void copyTo(IParagraph[] array, int arrayIndex)

Copies the elements of the IGenericCollection to an Array, starting at a particular Array index.

Parameters:

ParameterTypeDescription
arrayIParagraph[]The one-dimensional Array that is the destination of the elements copied from IGenericCollection. The Array must have zero-based indexing.
arrayIndexintThe zero-based index in array at which copying begins.

removeAt(int index)

public final void removeAt(int index)

Removes the element at the specified index of the collection.

Parameters:

ParameterTypeDescription
indexintThe zero-based index of the element to remove.

remove(IParagraph item)

public final boolean remove(IParagraph item)

Removes the first occurrence of a specific object from the IGenericCollection.

Parameters:

ParameterTypeDescription
itemIParagraphThe object to remove from the IGenericCollection.

Returns: boolean - true if item was successfully removed from the IGenericCollection; otherwise, false. This method also returns false if item is not found in the original IGenericCollection.

iterator()

public final System.Collections.Generic.IGenericEnumerator<IParagraph> iterator()

Returns an enumerator that iterates through the collection.

Returns: com.aspose.ms.System.Collections.Generic.IGenericEnumerator<com.aspose.slides.IParagraph> - A IGenericEnumerator that can be used to iterate through the collection.

iteratorJava()

public final System.Collections.Generic.IGenericEnumerator<IParagraph> iteratorJava()

Returns a java iterator for the entire collection.

Returns: com.aspose.ms.System.Collections.Generic.IGenericEnumerator<com.aspose.slides.IParagraph> - An java.util.Iterator for the entire collection.

getSlide()

public final IBaseSlide getSlide()

Returns the parent slide of a paragraphs collection. Read-only BaseSlide.

Returns: IBaseSlide

getPresentation()

public final IPresentation getPresentation()

Returns the parent presentation of a paragraphs collection. Read-only IPresentation.

Returns: IPresentation

addFromHtml(String text)

public final void addFromHtml(String text)

Adds text from specified html string to the collection.

Parameters:

ParameterTypeDescription
textjava.lang.StringHTML text.

addFromHtml(String text, IExternalResourceResolver resolver, String uri)

public final void addFromHtml(String text, IExternalResourceResolver resolver, String uri)

Adds text from specified html string to the collection.

Parameters:

ParameterTypeDescription
textjava.lang.StringHTML text.
resolverIExternalResourceResolverResolver callback object which resolves URIs and fetches referrenced objects.
urijava.lang.StringURI for adding HTML document. Used for resolving relative links.

Specifying resolver can potentially introduce a vulnurability. Use with caution. |

exportToHtml(int firstParagraphIndex, int paragraphsCount, ITextToHtmlConversionOptions options)

public final String exportToHtml(int firstParagraphIndex, int paragraphsCount, ITextToHtmlConversionOptions options)

Converts specifying paragraphs to the HTML and returns it as String object.

Parameters:

ParameterTypeDescription
firstParagraphIndexintFirst paragraph index int
paragraphsCountintParagraph count int
optionsITextToHtmlConversionOptionsConvert options ITextToHtmlConversionOptions

Returns: java.lang.String - Generated HTML.