ParagraphCollection
概述
ParagraphCollection 是 Aspose.Slides FOSS 中用于 Java 的类。继承自:BaseCollection<IParagraph>、IParagraphCollection、ISlideComponent。
表示段落的集合。
此类提供 21 个用于在 Java 程序中处理 ParagraphCollection 对象的方法。可用的方法包括:ParagraphCollection、add、asIEnumerable、asIPresentationComponent、asISlideComponent、clear、contains、count、get、getParagraphs、getPresentation、getSlide,以及另外 8 个方法。安装 Aspose.Slides FOSS for Java 包后,所有公共成员对任何 Java 应用程序均可访问。属性:paragraphs、presentation、readOnly、slide。
属性
| 名称 | 类型 | 访问 | 描述 |
|---|---|---|---|
paragraphs | List<IParagraph> | 读取 | 构建并返回段落列表。 |
readOnly | boolean | 读取 | 获取只读的。 |
slide | IBaseSlide | 读取 | 获取幻灯片。 |
presentation | IPresentation | 读取 | 获取演示文稿。 |
方法
| 签名 | 描述 |
|---|---|
ParagraphCollection() | 创建一个空的 ParagraphCollection。 |
ParagraphCollection(paragraphs: List<IParagraph>) | 使用给定的初始段落创建一个 ParagraphCollection。 |
initInternal(txbodyElement: Element, slidePart: Object, parentSlide: IBaseSlide) → ParagraphCollection | 从 OOXML 文本主体元素初始化此集合。 |
getParagraphs() → List<IParagraph> | 构建并返回段落的列表。 |
get(index: int) → IParagraph | |
size() → int | |
count() → int | 返回段落的数量(size 的别名) |
isReadOnly() → boolean | 如果只读已设置,则返回 true。 |
asISlideComponent() → ISlideComponent | 将集合返回为一个 ISlideComponent |
asIEnumerable() → Iterable<IParagraph> | 返回一个可遍历段落的 Iterable |
asIPresentationComponent() → IPresentationComponent | 将集合返回为一个 IPresentationComponent |
getSlide() → IBaseSlide | 返回幻灯片。 |
getPresentation() → IPresentation | 返回演示。 |
add(value: IParagraph) | 将段落追加到集合的末尾 |
insert(index: int, value: IParagraph) | |
indexOf(item: IParagraph) → int | 返回给定段落的索引,如果不存在则返回 -1 |
contains(item: IParagraph) → boolean | 如果集合包含指定的段落,则返回 true |
clear() | |
removeAt(index: int) | 删除给定索引处的段落 |
remove(item: IParagraph) → boolean | 删除指定的段落并返回成功状态 |
iterator() → Iterator<IParagraph> | 提供一个遍历段落的迭代器 |