java.lang.ObjectNodeCollection
com.aspose.words.SectionCollection
public class SectionCollection
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.
Property Getters/Setters Summary | ||
---|---|---|
int | getCount() | → inherited from NodeCollection |
Gets the number of nodes in the collection. | ||
Section | get(int index) | |
Retrieves a section at the given index. |
Method Summary | ||
---|---|---|
void | add(Node node) | → inherited from NodeCollection |
Adds a node to the end of the collection. | ||
void | clear() | → inherited from NodeCollection |
Removes all nodes from this collection and from the document. | ||
boolean | contains(Node node) | → inherited from NodeCollection |
Determines whether a node is in the collection. | ||
CompositeNode | getContainer() | → inherited from NodeCollection |
Reserved for internal use. | ||
Node | getNextMatchingNode(aspose.obfuscated.type curNode) | → inherited from NodeCollection |
Reserved for internal use. | ||
int | indexOf(Node node) | → inherited from NodeCollection |
Returns the zero-based index of the specified node. | ||
void | insert(int index, Node node) | → inherited from NodeCollection |
Inserts a node into the collection at the specified index. | ||
java.util.Iterator | iterator() | → inherited from NodeCollection |
Provides a simple "foreach" style iteration over the collection of nodes. | ||
void | remove(Node node) | → inherited from NodeCollection |
Removes the node from the collection and from the document. | ||
void | removeAt(int index) | → inherited from NodeCollection |
Removes the node at the specified index from the collection and from the document. | ||
Aspose.Words.Section[] | toArray() | |
Copies all sections from the collection to a new array of sections. |
Property Getters/Setters Detail |
---|
getCount | → inherited from NodeCollection |
public int getCount() |
get | |
public Section 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.
index
- An index into the list of sections.Method Detail |
---|
add | → inherited from NodeCollection |
public void add(Node node) |
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
node
- The node to be added to the end of the collection.clear | → inherited from NodeCollection |
public void clear() |
contains | → inherited from NodeCollection |
public boolean contains(Node node) |
This method performs a linear search; therefore, the average execution time is proportional to Count.
node
- The node to locate.getContainer | → inherited from NodeCollection |
public CompositeNode getContainer() |
getNextMatchingNode | → inherited from NodeCollection |
public Node getNextMatchingNode(aspose.obfuscated.type curNode) throws java.lang.Exception |
indexOf | → inherited from NodeCollection |
public int indexOf(Node node) |
This method performs a linear search; therefore, the average execution time is proportional to Count.
node
- The node to locate.insert | → inherited from NodeCollection |
public void insert(int index, Node node) |
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
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() |
remove | → inherited from NodeCollection |
public void remove(Node node) |
node
- The node to remove.removeAt | → inherited from NodeCollection |
public void removeAt(int index) |
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.Section[] toArray() |