public class SectionCollection extends NodeCollection
A Microsoft Word document can contain multiple sections. To create a section in a Microsoft Word, select the Insert/Break command and select a break type. The break specifies whether section starts on a new page or on the same page.
Programmatically inserting and removing sections can be used to customize documents produced during mail merge. If a document needs to have different content or parts of the content depending on some criteria, then you can create a "master" document that contains multiple sections and delete some of the sections before or after mail merge.
| Modifier and Type | Method and Description |
|---|---|
Node |
get(int index)
Retrieves a section at the given index.
|
Node[] |
toArray()
Copies all sections from the collection to a new array of sections.
|
add, clear, contains, getContainer, getCount, getCurrentNode, getNextMatchingNode, indexOf, insert, iterator, remove, removeAtpublic Node get(int 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.
get in class NodeCollectionindex - An index into the list of sections.Section value.public Node[] toArray()
toArray in class NodeCollection