Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER Copyright 2011 IBM. All rights reserved. Use is subject to license terms. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0. You can also obtain a copy of the License at http://odftoolkit.org/docs/license.txt Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. /
 
 
 package org.odftoolkit.simple.text;
 
 
ParagraphContainer is a container which maintains paragraph(s) as element(s). Paragraph(s) can be added and removed in this container.

 
 
 public interface ParagraphContainer {
Add paragraph at the end of the container with specified text content.

Parameters:
textContent - the text content
Returns:
an instance of paragraph
 
 	public Paragraph addParagraph(String textContent);

Remove paragraph from the container

Parameters:
para - the instance of paragraph
Returns:
true if the paragraph is removed successfully, false if errors happen.
 
 	public boolean removeParagraph(Paragraph para);

Get the ODF element which can have <text:p> as child element directly.

Returns:
- an ODF element which can have paragraph as child
 
Return an Iterator of the paragraph in this container.

Returns:
an Iterator of the paragraph in this container
 
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
 
 	public Paragraph getParagraphByIndex(int indexboolean 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
	public Paragraph getParagraphByReverseIndex(int reverseIndexboolean isEmptyParagraphSkipped);
New to GrepCode? Check out our FAQ X