HeaderFooterCollection

遗产: java.lang.Object, com.aspose.words.NodeCollection

public class HeaderFooterCollection extends NodeCollection

提供类型访问HeaderFooter的节点Section.

要了解更多信息,请访问Working with Headers and Footers文档文章。

最多可以有一个HeaderFooter

每个HeaderFooterTypeSection.

HeaderFooter对象可以以任何顺序出现在集合中。

方法

方法描述
add(Node node)将节点添加到集合的末尾。
clear()从此集合和文档中删除所有节点。
contains(Node node)确定节点是否在集合中。
equals(Object arg0)
get(int index)检索一个HeaderFooter在给定的指数。
getByHeaderFooterType(int headerFooterType)
getClass()
getContainer()
getCount()获取集合中的节点数。
getCurrentNode()
getNextMatchingNode(Node curNode)
hashCode()
indexOf(Node node)返回指定节点的从零开始的索引。
insert(int index, Node node)将节点插入到集合中指定索引处。
iterator()在节点集合上提供简单的“foreach”样式迭代。
linkToPrevious(boolean isLinkToPrevious)将所有页眉和页脚链接或取消链接到上一节中相应的页眉和页脚。
linkToPrevious(int headerFooterType, boolean isLinkToPrevious)
notify()
notifyAll()
remove(Node node)从集合和文档中删除节点。
removeAt(int index)从集合和文档中删除指定索引处的节点。
toArray()将集合中的所有 HeaderFoorter 复制到新的 HeaderFoorter 数组。
toString()
wait()
wait(long arg0)
wait(long arg0, int arg1)

add(Node node)

public void add(Node node)

将节点添加到集合的末尾。

该节点作为子节点插入到创建集合的节点对象中。

如果 newChild 已经在树中,则首先将其删除。

如果被插入的节点是从另一个文档创建的,你应该使用**M:Aspose.Words.DocumentBase.ImportNode(Aspose.Words.Node,System.Boolean,Aspose.Words.ImportFormatMode)**将节点导入当前文档。然后可以将导入的节点插入到当前文档中。

参数:

范围类型描述
nodeNode要添加到集合末尾的节点。

clear()

public void clear()

从此集合和文档中删除所有节点。

contains(Node node)

public boolean contains(Node node)

确定节点是否在集合中。

该方法执行线性搜索;因此,平均执行时间与计数成正比。

参数:

范围类型描述
nodeNode要定位的节点。

退货: boolean - 如果在集合中找到项目,则为真;否则,假的。

equals(Object arg0)

public boolean equals(Object arg0)

参数:

范围类型描述
arg0java.lang.Object

退货: 布尔值

get(int index)

public Node get(int index)

检索一个HeaderFooter在给定的指数。

该指数是从零开始的。

允许使用负索引,表示从集合的后面访问。例如 -1 表示最后一项,-2 表示倒数第二项,依此类推。

如果索引大于或等于列表中的项目数,则返回空引用。

如果索引为负且其绝对值大于列表中的项目数,则返回空引用。

参数:

范围类型描述
indexint集合中的索引。

退货: Node - 相应的HeaderFooter价值。

getByHeaderFooterType(int headerFooterType)

public HeaderFooter getByHeaderFooterType(int headerFooterType)

参数:

范围类型描述
headerFooterTypeint

退货: HeaderFooter

getClass()

public final native Class<?> getClass()

退货: java.lang.Class

getContainer()

public CompositeNode getContainer()

退货: CompositeNode

getCount()

public int getCount()

获取集合中的节点数。

退货: int - 集合中的节点数。

getCurrentNode()

public Node getCurrentNode()

退货: Node

getNextMatchingNode(Node curNode)

public Node getNextMatchingNode(Node curNode)

参数:

范围类型描述
curNodeNode

退货: Node

hashCode()

public native int hashCode()

退货: 整数

indexOf(Node node)

public int indexOf(Node node)

返回指定节点的从零开始的索引。

参数:

范围类型描述
nodeNode要定位的节点。

退货: int - 集合中节点的从零开始的索引(如果找到);否则,-1。

该方法执行线性搜索;因此,平均执行时间与计数成正比。

insert(int index, Node node)

public void insert(int index, Node node)

将节点插入到集合中指定索引处。

该节点作为子节点插入到创建集合的节点对象中。

如果索引等于或大于 Count,则将节点添加到集合的末尾。

如果索引为负且其绝对值大于Count,则将该节点添加到集合的末尾。

如果 newChild 已经在树中,则首先将其删除。

如果被插入的节点是从另一个文档创建的,你应该使用**M:Aspose.Words.DocumentBase.ImportNode(Aspose.Words.Node,System.Boolean,Aspose.Words.ImportFormatMode)**将节点导入当前文档。然后可以将导入的节点插入到当前文档中。

参数:

范围类型描述
indexint节点的从零开始的索引。允许使用负索引,表示从列表的后面访问。例如 -1 表示最后一个节点,-2 表示倒数第二个,依此类推。
nodeNode要插入的节点。

iterator()

public Iterator iterator()

在节点集合上提供简单的“foreach”样式迭代。

退货: java.util.Iterator - 一个迭代器。

linkToPrevious(boolean isLinkToPrevious)

public void linkToPrevious(boolean isLinkToPrevious)

将所有页眉和页脚链接或取消链接到上一节中相应的页眉和页脚。

如果任何页眉或页脚不存在,则自动创建它们。

参数:

范围类型描述
isLinkToPreviousbooleanTrue 将页眉和页脚链接到上一节; false 取消链接。

linkToPrevious(int headerFooterType, boolean isLinkToPrevious)

public void linkToPrevious(int headerFooterType, boolean isLinkToPrevious)

参数:

范围类型描述
headerFooterTypeint
isLinkToPreviousboolean

notify()

public final native void notify()

notifyAll()

public final native void notifyAll()

remove(Node node)

public void remove(Node node)

从集合和文档中删除节点。

参数:

范围类型描述
nodeNode要删除的节点。

removeAt(int index)

public void removeAt(int index)

从集合和文档中删除指定索引处的节点。

参数:

范围类型描述
indexint节点的从零开始的索引。允许使用负索引,表示从列表的后面访问。例如 -1 表示最后一个节点,-2 表示倒数第二个,依此类推。

toArray()

public HeaderFooter[] toArray()

将集合中的所有 HeaderFoorter 复制到新的 HeaderFoorter 数组。

退货: com.aspose.words.HeaderFooter[] - HeaderFoorter 的数组。

toString()

public String toString()

退货: java.lang.字符串

wait()

public final void wait()

wait(long arg0)

public final native void wait(long arg0)

参数:

范围类型描述
arg0long

wait(long arg0, int arg1)

public final void wait(long arg0, int arg1)

参数:

范围类型描述
arg0long
arg1int