com.aspose.words
Class ParagraphCollection

java.lang.Object
  extended by NodeCollection
      extended by com.aspose.words.ParagraphCollection
All Implemented Interfaces:
java.lang.Iterable

public class ParagraphCollection 
extends NodeCollection

Provides typed access to a collection of Paragraph nodes.

Property Getters/Setters Summary
intgetCount()→ inherited from NodeCollection
           Gets the number of nodes in the collection.
Paragraphget(int index)
           Retrieves a Paragraph at the given index.
 
Method Summary
voidadd(Node node)→ inherited from NodeCollection
           Adds a node to the end of the collection.
voidclear()→ inherited from NodeCollection
           Removes all nodes from this collection and from the document.
booleancontains(Node node)→ inherited from NodeCollection
           Determines whether a node is in the collection.
CompositeNodegetContainer()→ inherited from NodeCollection
          Reserved for internal use.
NodegetNextMatchingNode(aspose.obfuscated.type curNode)→ inherited from NodeCollection
          Reserved for internal use.
intindexOf(Node node)→ inherited from NodeCollection
           Returns the zero-based index of the specified node.
voidinsert(int index, Node node)→ inherited from NodeCollection
           Inserts a node into the collection at the specified index.
java.util.Iteratoriterator()→ inherited from NodeCollection
           Provides a simple "foreach" style iteration over the collection of nodes.
voidremove(Node node)→ inherited from NodeCollection
           Removes the node from the collection and from the document.
voidremoveAt(int index)→ inherited from NodeCollection
           Removes the node at the specified index from the collection and from the document.
Aspose.Words.Paragraph[]toArray()
           Copies all paragraphs from the collection to a new array of paragraphs.
 

Property Getters/Setters Detail

getCount

→ inherited from NodeCollection
public int getCount()
Gets the number of nodes in the collection.

get

public Paragraph get(int index)
Retrieves a Paragraph at the given index.

The index is zero-based.

Negative indexes are allowed and indicate access from the back of the collection. For example -1 means the last item, -2 means the second before last and so on.

If index is greater than or equal to the number of items in the list, this returns a null reference.

If index is negative and its absolute value is greater than the number of items in the list, this returns a null reference.

Parameters:
index - An index into the collection.

Method Detail

add

→ inherited from NodeCollection
public void add(Node node)
Adds a node to the end of the collection.

The node is inserted as a child into the node object from which the collection was created.

If the newChild is already in the tree, it is first removed.

If the node being inserted was created from another document, you should use DocumentBase.importNode(com.aspose.words.Node,boolean,int) to import the node to the current document. The imported node can then be inserted into the current document.

Parameters:
node - The node to be added to the end of the collection.

clear

→ inherited from NodeCollection
public void clear()
Removes all nodes from this collection and from the document.

contains

→ inherited from NodeCollection
public boolean contains(Node node)
Determines whether a node is in the collection.

This method performs a linear search; therefore, the average execution time is proportional to Count.

Parameters:
node - The node to locate.
Returns:
True if item is found in the collection; otherwise, false.

getContainer

→ inherited from NodeCollection
public CompositeNode getContainer()
Reserved for internal use.

getNextMatchingNode

→ inherited from NodeCollection
public Node getNextMatchingNode(aspose.obfuscated.type curNode)
                        throws java.lang.Exception
Reserved for internal use.

indexOf

→ inherited from NodeCollection
public int indexOf(Node node)
Returns the zero-based index of the specified node.

This method performs a linear search; therefore, the average execution time is proportional to Count.

Parameters:
node - The node to locate.
Returns:
The zero-based index of the node within the collection, if found; otherwise, -1.

insert

→ inherited from NodeCollection
public void insert(int index, Node node)
Inserts a node into the collection at the specified index.

The node is inserted as a child into the node object from which the collection was created.

If the index is equal to or greater than Count, the node is added at the end of the collection.

If the index is negative and its absolute value is greater than Count, the node is added at the end of the collection.

If the newChild is already in the tree, it is first removed.

If the node being inserted was created from another document, you should use DocumentBase.importNode(com.aspose.words.Node,boolean,int) to import the node to the current document. The imported node can then be inserted into the current document.

Parameters:
index - The zero-based index of the node. Negative indexes are allowed and indicate access from the back of the list. For example -1 means the last node, -2 means the second before last and so on.
node - The node to insert.

iterator

→ inherited from NodeCollection
public java.util.Iterator iterator()
Provides a simple "foreach" style iteration over the collection of nodes.
Returns:
Iterator<Node>.

remove

→ inherited from NodeCollection
public void remove(Node node)
Removes the node from the collection and from the document.
Parameters:
node - The node to remove.

removeAt

→ inherited from NodeCollection
public void removeAt(int index)
Removes the node at the specified index from the collection and from the document.
Parameters:
index - The zero-based index of the node. Negative indexes are allowed and indicate access from the back of the list. For example -1 means the last node, -2 means the second before last and so on.

toArray

public Aspose.Words.Paragraph[] toArray()
Copies all paragraphs from the collection to a new array of paragraphs.
Returns:
An array of paragraphs.

See Also:
          Aspose.Words Documentation - the home page for the Aspose.Words Product Documentation.
          Aspose.Words Support Forum - our preferred method of support.