| 
 | JavaTM Platform Standard Ed. 6 | |||||||||
| 上一个类 下一个类 | 框架 无框架 | |||||||||
| 摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 | |||||||||
java.lang.Objectjavax.swing.text.AbstractDocument.AbstractElement
public abstract class AbstractDocument.AbstractElement
     实现元素的抽象部分。默认情况下,通过提供表示该元素当前属性集合的不可变部分的字段,元素支持这些属性。该元素本身可以实现 MutableAttributeSet,后者可以通过获取新的不可变集合来修改该集合。这些不可变集合是由与此文档相关的 AttributeContext 提供的。
 警告:此类的序列化对象将与以后的 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.AbstractElement(Element parent, AttributeSet a)创建新的 AbstractElement。 | |
| 方法摘要 | |
|---|---|
|  void | addAttribute(Object name, Object value)向该元素添加一个属性。 | 
|  void | addAttributes(AttributeSet attr)向该元素添加一个属性集合。 | 
| abstract  Enumeration | children()以 Enumeration形式返回接收方的子级。 | 
|  boolean | containsAttribute(Object name, Object value)检查是否定义了给定的属性名称/值。 | 
|  boolean | containsAttributes(AttributeSet attrs)检查该元素是否包含所有的属性。 | 
|  AttributeSet | copyAttributes()复制属性集合。 | 
|  void | dump(PrintStream psOut, int indentAmount)转储该元素层次结构的调试表示形式。 | 
| abstract  boolean | getAllowsChildren()如果接收方允许有子级,则返回 true。 | 
|  Object | getAttribute(Object attrName)获取属性值。 | 
|  int | getAttributeCount()获取所定义的属性数量。 | 
|  Enumeration<?> | getAttributeNames()获取所有属性的名称。 | 
|  AttributeSet | getAttributes()获取该元素的属性。 | 
|  TreeNode | getChildAt(int childIndex)在索引 childIndex处返回子级TreeNode。 | 
|  int | getChildCount()返回接受方所包含的子级 TreeNode的数量。 | 
|  Document | getDocument()获得基础模型。 | 
| abstract  Element | getElement(int index)获取子元素。 | 
| abstract  int | getElementCount()获取该元素子级的数量。 | 
| abstract  int | getElementIndex(int offset)获取最接近给定模型偏移量的子元素索引。 | 
| abstract  int | getEndOffset()获取该元素在此模型中的终止偏移量。 | 
|  int | getIndex(TreeNode node)返回接收方子级中 node的索引。 | 
|  String | getName()获取该元素的名称。 | 
|  TreeNode | getParent()返回接收方的父级 TreeNode。 | 
|  Element | getParentElement()获取该元素的父级。 | 
|  AttributeSet | getResolveParent()获取要解析的父级。 | 
| abstract  int | getStartOffset()获取该元素在此模型中的起始偏移量。 | 
|  boolean | isDefined(Object attrName)检查是否定义了给定的属性。 | 
|  boolean | isEqual(AttributeSet attr)检查两个属性集合是否相等。 | 
| abstract  boolean | isLeaf()检查该元素是否为叶元素。 | 
|  void | removeAttribute(Object name)从该集合中移除一个属性。 | 
|  void | removeAttributes(AttributeSet attrs)移除该元素的属性集合。 | 
|  void | removeAttributes(Enumeration<?> names)移除该元素的属性集合。 | 
|  void | setResolveParent(AttributeSet parent)设置要解析的父级。 | 
| 从类 java.lang.Object 继承的方法 | 
|---|
| clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
| 构造方法详细信息 | 
|---|
public AbstractDocument.AbstractElement(Element parent,
                                        AttributeSet a) 
  
parent - 父元素
     a - 该元素的属性
     | 方法详细信息 | 
|---|
public void dump(PrintStream psOut,
                 int indentAmount) 
  
psOut - 输出流
     indentAmount - 缩进级别 >= 0
     public int getAttributeCount()
AttributeSet 中的 
      getAttributeCount
     AttributeSet.getAttributeCount()
     public boolean isDefined(Object attrName)
AttributeSet 中的 
      isDefined
     attrName - 非 null 属性的名称 
     AttributeSet.isDefined(java.lang.Object)
     public boolean isEqual(AttributeSet attr)
AttributeSet 中的 
      isEqual
     attr - 要检查的属性集合 
     AttributeSet.isEqual(javax.swing.text.AttributeSet)
     public AttributeSet copyAttributes()
AttributeSet 中的 
      copyAttributes
     AttributeSet.copyAttributes()
     public Object getAttribute(Object attrName)
AttributeSet 中的 
      getAttribute
     attrName - 非 null 属性名称 
     AttributeSet.getAttribute(java.lang.Object)
     public Enumeration<?> getAttributeNames()
AttributeSet 中的 
      getAttributeNames
     AttributeSet.getAttributeNames()
     
public boolean containsAttribute(Object name,
                                 Object value) 
  
AttributeSet 中的 
      containsAttribute
     name - 非 null 属性名称
     value - 属性值 
     AttributeSet.containsAttribute(java.lang.Object, java.lang.Object)
     public boolean containsAttributes(AttributeSet attrs)
AttributeSet 中的 
      containsAttributes
     attr - 要检查的属性 
     AttributeSet.containsAttributes(javax.swing.text.AttributeSet)
     public AttributeSet getResolveParent()
AttributeSet 中的 
      getResolveParent
     null
     AttributeSet.getResolveParent()
     
public void addAttribute(Object name,
                         Object value) 
  
MutableAttributeSet 中的 
      addAttribute
     name - 非 null 属性名称
     value - 属性值
     MutableAttributeSet.addAttribute(java.lang.Object, java.lang.Object)
     public void addAttributes(AttributeSet attr)
MutableAttributeSet 中的 
      addAttributes
     attr - 要添加的属性
     MutableAttributeSet.addAttribute(java.lang.Object, java.lang.Object)
     public void removeAttribute(Object name)
MutableAttributeSet 中的 
      removeAttribute
     name - 非 null 属性名称
     MutableAttributeSet.removeAttribute(java.lang.Object)
     public void removeAttributes(Enumeration<?> names)
MutableAttributeSet 中的 
      removeAttributes
     names - 属性名称
     MutableAttributeSet.removeAttributes(java.util.Enumeration
        )
     public void removeAttributes(AttributeSet attrs)
MutableAttributeSet 中的 
      removeAttributes
     attr - 属性
     MutableAttributeSet.removeAttributes(java.util.Enumeration
        )
     public void setResolveParent(AttributeSet parent)
MutableAttributeSet 中的 
      setResolveParent
     parent - 父级,如果不存在,则返回 null
     MutableAttributeSet.setResolveParent(javax.swing.text.AttributeSet)
     public Document getDocument()
Element 中的 
      getDocument
     public Element getParentElement()
Element 中的 
      getParentElement
     public AttributeSet getAttributes()
Element 中的 
      getAttributes
     public String getName()
Element 中的 
      getName
     public abstract int getStartOffset()
Element 中的 
      getStartOffset
     Document, 
      AbstractDocument
     public abstract int getEndOffset()
Element 中的 
      getEndOffset
     Document, 
      AbstractDocument
     public abstract Element getElement(int index)
Element 中的 
      getElement
     index - 子索引,其值 >= 0 && < getElementCount() 
     public abstract int getElementCount()
Element 中的 
      getElementCount
     public abstract int getElementIndex(int offset)
Element 中的 
      getElementIndex
     offset - 偏移量 >= 0 
     public abstract boolean isLeaf()
Element 中的 
      isLeaf
     TreeNode 中的 
      isLeaf
     public TreeNode getChildAt(int childIndex)
childIndex 处返回子级 
    TreeNode。 
    
TreeNode 中的 
      getChildAt
     public int getChildCount()
TreeNode 的数量。 
    
TreeNode 中的 
      getChildCount
     TreeNodews 的数量
     public TreeNode getParent()
TreeNode。 
    
TreeNode 中的 
      getParent
     TreeNode
     public int getIndex(TreeNode node)
node 的索引。如果接收方中不包含 
    node,将返回 -1。 
    
TreeNode 中的 
      getIndex
     node - 感兴趣的位置 
     node 的索引,如果不存在,则返回 -1
     public abstract boolean getAllowsChildren()
TreeNode 中的 
      getAllowsChildren
     public abstract Enumeration children()
Enumeration 形式返回接收方的子级。 
    
TreeNode 中的 
      children
     Enumeration 形式的子级
     | 
 | JavaTM Platform Standard Ed. 6 | |||||||||
| 上一个类 下一个类 | 框架 无框架 | |||||||||
| 摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 | |||||||||
版权所有 2007 Sun Microsystems, Inc. 保留所有权利。 请遵守许可证条款。另请参阅文档重新分发政策。