JavaTM 2 Platform
Standard Ed. 6

javax.swing.text
类 StyleContext.SmallAttributeSet

java.lang.Object
  继承者 javax.swing.text.StyleContext.SmallAttributeSet
所有已实现的接口:
AttributeSet
正在封闭类:
StyleContext

public class StyleContext.SmallAttributeSet
extends Object
implements AttributeSet

此类可在数组中存储少量的属性。存储格式为键、值、键、值等等。集合的大小是数组的长度除以 2。默认情况下,这是以压缩可共享形式存储属性时所用的类。


嵌套类摘要
 
从接口 javax.swing.text.AttributeSet 继承的嵌套类/接口
AttributeSet.CharacterAttribute, AttributeSet.ColorAttribute, AttributeSet.FontAttribute, AttributeSet.ParagraphAttribute
 
字段摘要
 
从接口 javax.swing.text.AttributeSet 继承的字段
NameAttribute, ResolveAttribute
 
构造方法摘要
StyleContext.SmallAttributeSet(AttributeSet attrs)
           
StyleContext.SmallAttributeSet(Object[] attributes)
           
 
方法摘要
 Object clone()
          复制属性集。
 boolean containsAttribute(Object name, Object value)
          检查给定的属性名称/值是否已定义。
 boolean containsAttributes(AttributeSet attrs)
          检查属性集是否包含了所有给定的属性。
 AttributeSet copyAttributes()
          复制属性集。
 boolean equals(Object obj)
          将此对象与指定对象比较。
 Object getAttribute(Object key)
          获取属性的值。
 int getAttributeCount()
          返回定义的属性数。
 Enumeration<?> getAttributeNames()
          获取所有属性的名称。
 AttributeSet getResolveParent()
          如果未重写,解析父级默认为是解析父元素。
 int hashCode()
          返回此属性集的一个哈希代码。
 boolean isDefined(Object key)
          检查给定属性是否已定义。
 boolean isEqual(AttributeSet attr)
          检查两个属性集是否相等。
 String toString()
          返回表示键/值对的字符串
 
从类 java.lang.Object 继承的方法
finalize, getClass, notify, notifyAll, wait, wait, wait
 

构造方法详细信息

StyleContext.SmallAttributeSet

public StyleContext.SmallAttributeSet(Object[] attributes)

StyleContext.SmallAttributeSet

public StyleContext.SmallAttributeSet(AttributeSet attrs)
方法详细信息

toString

public String toString()
返回表示键/值对的字符串

覆盖:
Object 中的 toString
返回:
该对象的字符串表示形式。

hashCode

public int hashCode()
返回此属性集的一个哈希代码。

覆盖:
Object 中的 hashCode
返回:
此属性集的一个哈希代码值。
另请参见:
Object.equals(java.lang.Object), Hashtable

equals

public boolean equals(Object obj)
将此对象与指定对象比较。如果此对象是一个等同的属性集,则结果为 true

覆盖:
Object 中的 equals
参数:
obj - 要与之比较的对象。
返回:
如果对象相同,则返回 true;否则,返回 false
另请参见:
Object.hashCode(), Hashtable

clone

public Object clone()
复制属性集。因为该集合是不可变的,复制副本实际上就是同一个集合。

覆盖:
Object 中的 clone
返回:
属性集
另请参见:
Cloneable

getAttributeCount

public int getAttributeCount()
返回定义的属性数。

指定者:
接口 AttributeSet 中的 getAttributeCount
返回:
属性数
另请参见:
AttributeSet.getAttributeCount()

isDefined

public boolean isDefined(Object key)
检查给定属性是否已定义。

指定者:
接口 AttributeSet 中的 isDefined
参数:
key - 属性键
返回:
如果属性已定义,则返回 true
另请参见:
AttributeSet.isDefined(java.lang.Object)

isEqual

public boolean isEqual(AttributeSet attr)
检查两个属性集是否相等。

指定者:
接口 AttributeSet 中的 isEqual
参数:
attr - 所要检查的属性集
返回:
如果相同,返回 true
另请参见:
AttributeSet.isEqual(javax.swing.text.AttributeSet)

copyAttributes

public AttributeSet copyAttributes()
复制属性集。

指定者:
接口 AttributeSet 中的 copyAttributes
返回:
副本
另请参见:
AttributeSet.copyAttributes()

getAttribute

public Object getAttribute(Object key)
获取属性的值。

指定者:
接口 AttributeSet 中的 getAttribute
参数:
key - 属性名称
返回:
属性值
另请参见:
AttributeSet.getAttribute(java.lang.Object)

getAttributeNames

public Enumeration<?> getAttributeNames()
获取所有属性的名称。

指定者:
接口 AttributeSet 中的 getAttributeNames
返回:
属性名称
另请参见:
AttributeSet.getAttributeNames()

containsAttribute

public boolean containsAttribute(Object name,
                                 Object value)
检查给定的属性名称/值是否已定义。

指定者:
接口 AttributeSet 中的 containsAttribute
参数:
name - 属性名称
value - 属性值
返回:
如果名称/值已定义,则返回为 true
另请参见:
AttributeSet.containsAttribute(java.lang.Object, java.lang.Object)

containsAttributes

public boolean containsAttributes(AttributeSet attrs)
检查属性集是否包含了所有给定的属性。

指定者:
接口 AttributeSet 中的 containsAttributes
参数:
attr - 要检查的属性
返回:
如果该元素包含所有的属性,则返回 true
另请参见:
AttributeSet.containsAttributes(javax.swing.text.AttributeSet)

getResolveParent

public AttributeSet getResolveParent()
如果未重写,解析父级默认为是解析父元素。

指定者:
接口 AttributeSet 中的 getResolveParent
返回:
来自父级的属性
另请参见:
AttributeSet.getResolveParent()

JavaTM 2 Platform
Standard Ed. 6

提交错误或意见

版权所有 2008 Sun Microsystems, Inc. 保留所有权利。请遵守GNU General Public License, version 2 only