org.odftoolkit.simple.text
Interface ParagraphContainer

All Known Implementing Classes:
AbstractParagraphContainer, Cell, Section, Textbox, TextDocument

public interface ParagraphContainer

ParagraphContainer is a container which maintains paragraph(s) as element(s). Paragraph(s) can be added and removed in this container.

Since:
0.5
See Also:
Paragraph, TextDocument

Method Summary
 Paragraph addParagraph(String textContent)
          Add paragraph at the end of the container with specified text content.
 Paragraph getParagraphByIndex(int index, boolean isEmptyParagraphSkipped)
          Return a paragraph with a given index.
 Paragraph getParagraphByReverseIndex(int reverseIndex, boolean isEmptyParagraphSkipped)
          Return a paragraph with a given index.
 OdfElement getParagraphContainerElement()
          Get the ODF element which can have as child element directly.
 Iterator<Paragraph> getParagraphIterator()
          Return an Iterator of the paragraph in this container.
 boolean removeParagraph(Paragraph para)
          Remove paragraph from the container
 

Method Detail

addParagraph

Paragraph addParagraph(String textContent)
Add paragraph at the end of the container with specified text content.

Parameters:
textContent - - the text content
Returns:
an instance of paragraph

removeParagraph

boolean removeParagraph(Paragraph para)
Remove paragraph from the container

Parameters:
para - - the instance of paragraph
Returns:
true if the paragraph is removed successfully, false if errors happen.

getParagraphContainerElement

OdfElement getParagraphContainerElement()
Get the ODF element which can have as child element directly.

Returns:
- an ODF element which can have paragraph as child

getParagraphIterator

Iterator<Paragraph> getParagraphIterator()
Return an Iterator of the paragraph in this container.

Returns:
an Iterator of the paragraph in this container

getParagraphByIndex

Paragraph getParagraphByIndex(int index,
                              boolean isEmptyParagraphSkipped)
Return a paragraph with a given index.

An index of zero represents the first paragraph.

If empty paragraph is skipped, the empty paragraph won't be counted.

Parameters:
index - - the index started from 0.
isEmptyParagraphSkipped - - whether the empty paragraph is skipped or not
Returns:
the paragraph with a given index

getParagraphByReverseIndex

Paragraph getParagraphByReverseIndex(int reverseIndex,
                                     boolean isEmptyParagraphSkipped)
Return a paragraph with a given index. The index is in reverse order.

An index of zero represents the last paragraph.

If empty paragraph is skipped, the empty paragraph won't be counted.

Parameters:
reverseIndex - - the index started from 0 in reverse order.
isEmptyParagraphSkipped - - whether the empty paragraph is skipped or not
Returns:
the paragraph with a given index


Copyright © 2010-2017 The Apache Software Foundation. All Rights Reserved.