|
JavaTM 2 Platform Standard Ed. 6 |
|||||||||
| 上一個類別 下一個類別 | 框架 無框架 | |||||||||
| 摘要: 巢狀 | 欄位 | 建構子 | 方法 | 詳細資訊: 欄位 | 建構子 | 方法 | |||||||||
java.lang.Objectjavax.swing.text.AbstractDocument.AbstractElement
javax.swing.text.AbstractDocument.BranchElement
public class AbstractDocument.BranchElement
實作一個套件含其他元素的復合元素。
警告:此類別的已序列化物件與以後的 Swing 版本不相容。當前的序列化支持適用於短期存儲或運行相同 Swing 版本的應用程序之間的 RMI。從 1.4 版本開始,已在 java.beans 套件中添加了支持所有 JavaBeansTM 長期存儲的功能。請參見 XMLEncoder。
| 巢狀類別摘要 |
|---|
| 從介面 javax.swing.text.AttributeSet 繼承的巢狀類別/介面 |
|---|
AttributeSet.CharacterAttribute, AttributeSet.ColorAttribute, AttributeSet.FontAttribute, AttributeSet.ParagraphAttribute |
| 欄位摘要 |
|---|
| 從介面 javax.swing.text.AttributeSet 繼承的欄位 |
|---|
NameAttribute, ResolveAttribute |
| 建構子摘要 | |
|---|---|
AbstractDocument.BranchElement(Element parent,
AttributeSet a)
建構最初不包含任何子元素的復合元素。 |
|
| 方法摘要 | |
|---|---|
Enumeration |
children()
以 Enumeration 的形式返回接收者的子級。 |
boolean |
getAllowsChildren()
如果接收者允許接收子元素,則返回 true。 |
Element |
getElement(int index)
獲得一個子元素。 |
int |
getElementCount()
獲得該元素的子元素數。 |
int |
getElementIndex(int offset)
獲得與給定模型偏移量最接近的子元素索引。 |
int |
getEndOffset()
獲得模型中該元素的結束偏移量。 |
String |
getName()
獲得元素名。 |
int |
getStartOffset()
獲得模型中該元素的起始偏移量。 |
boolean |
isLeaf()
檢查該元素是否為葉元素。 |
Element |
positionToElement(int pos)
獲得包含給定模型位置的子元素。 |
void |
replace(int offset,
int length,
Element[] elems)
使用新的元素集替換該內容。 |
String |
toString()
將該元素轉換為字元串。 |
| 從類別 java.lang.Object 繼承的方法 |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| 建構子詳細資訊 |
|---|
public AbstractDocument.BranchElement(Element parent,
AttributeSet a)
parent - 父元素a - 該元素的屬性| 方法詳細資訊 |
|---|
public Element positionToElement(int pos)
pos - 位置,該位置 >= 0
public void replace(int offset,
int length,
Element[] elems)
offset - 起始偏移量,該偏移量 >= 0length - 要替換的長度,該長度 >= 0elems - 新元素public String toString()
Object 中的 toStringpublic String getName()
Element 中的 getNameAbstractDocument.AbstractElement 中的 getNamepublic int getStartOffset()
Element 中的 getStartOffsetAbstractDocument.AbstractElement 中的 getStartOffsetDocument,
AbstractDocumentpublic int getEndOffset()
Element 中的 getEndOffsetAbstractDocument.AbstractElement 中的 getEndOffsetNullPointerException - 如果此元素沒有子元素Document,
AbstractDocumentpublic Element getElement(int index)
Element 中的 getElementAbstractDocument.AbstractElement 中的 getElementindex - 子元素的索引,該索引 >= 0 && < getElementCount()
public int getElementCount()
Element 中的 getElementCountAbstractDocument.AbstractElement 中的 getElementCountpublic int getElementIndex(int offset)
Element 中的 getElementIndexAbstractDocument.AbstractElement 中的 getElementIndexoffset - 偏移量,該偏移量 >= 0
public boolean isLeaf()
Element 中的 isLeafTreeNode 中的 isLeafAbstractDocument.AbstractElement 中的 isLeafpublic boolean getAllowsChildren()
TreeNode 中的 getAllowsChildrenAbstractDocument.AbstractElement 中的 getAllowsChildrenpublic Enumeration children()
Enumeration 的形式返回接收者的子級。
TreeNode 中的 childrenAbstractDocument.AbstractElement 中的 children
|
JavaTM 2 Platform Standard Ed. 6 |
|||||||||
| 上一個類別 下一個類別 | 框架 無框架 | |||||||||
| 摘要: 巢狀 | 欄位 | 建構子 | 方法 | 詳細資訊: 欄位 | 建構子 | 方法 | |||||||||
版權所有 2008 Sun Microsystems, Inc. 保留所有權利。請遵守GNU General Public License, version 2 only。