java.lang.Object
javax.swing.text.SimpleAttributeSet
- 所有已实现的接口:
Serializable,Cloneable,AttributeSet,MutableAttributeSet
public class SimpleAttributeSet extends Object implements MutableAttributeSet , Serializable , Cloneable
使用哈希表的 MutableAttributeSet 的直接实现。
Warning: 此类的序列化对象将与未来的 Swing 版本不兼容。当前的序列化支持适用于运行相同版本 Swing 的应用程序之间的短期存储或 RMI。从 1.4 开始,对所有 JavaBeans 的长期存储的支持已添加到 java.beans 包中。请参阅 XMLEncoder 。
-
内部类总结
在接口 javax.swing.text.AttributeSet 中声明的嵌套类/接口
AttributeSet.CharacterAttribute, AttributeSet.ColorAttribute, AttributeSet.FontAttribute, AttributeSet.ParagraphAttribute -
字段摘要
字段在接口 javax.swing.text.AttributeSet 中声明的字段
NameAttribute, ResolveAttribute -
构造方法总结
构造方法 -
方法总结
修饰符和类型方法描述voidaddAttribute(Object name, Object value) 向列表中添加一个属性。voidaddAttributes(AttributeSet attributes) 将一组属性添加到列表中。clone()克隆一组属性。booleancontainsAttribute(Object name, Object value) 检查属性列表是否包含指定的属性名称/值对。booleancontainsAttributes(AttributeSet attributes) 检查属性列表是否包含所有指定的名称/值对。复制属性。boolean将此对象与指定对象进行比较。getAttribute(Object name) 获取属性的值。int获取属性数量的计数。Enumeration<?>获取集合中属性的名称。获取解析父对象。inthashCode()返回这组属性的哈希码。boolean告知是否定义了给定的属性。booleanisEmpty()检查属性集是否为空。booleanisEqual(AttributeSet attr) 比较两个属性集。voidremoveAttribute(Object name) 从列表中删除一个属性。voidremoveAttributes(Enumeration<?> names) 从列表中删除一组属性。voidremoveAttributes(AttributeSet attributes) 从列表中删除一组属性。voidsetResolveParent(AttributeSet parent) 设置解析父级。toString()将属性集转换为字符串。
-
字段详细信息
-
EMPTY
一个空的属性集。
-
-
构造方法详细信息
-
SimpleAttributeSet
public SimpleAttributeSet()创建一个新的属性集。 -
SimpleAttributeSet
根据提供的属性集创建新的属性集。- 参数:
source- 属性集
-
-
方法详情
-
isEmpty
public boolean isEmpty()检查属性集是否为空。- 返回:
- 如果集合为空则为 true 否则为 false
-
getAttributeCount
public int getAttributeCount()获取属性数量的计数。- 指定者:
getAttributeCount在接口AttributeSet中- 返回:
- 伯爵
-
isDefined
告知是否定义了给定的属性。- 指定者:
isDefined在接口AttributeSet中- 参数:
attrName- 属性名称- 返回:
- 如果定义了属性,则为真
-
isEqual
比较两个属性集。- 指定者:
isEqual在接口AttributeSet中- 参数:
attr- 第二个属性集- 返回:
- 如果集合相等则为真,否则为假
-
copyAttributes
复制属性。- 指定者:
copyAttributes在接口AttributeSet中- 返回:
- 副本
-
getAttributeNames
获取集合中属性的名称。- 指定者:
getAttributeNames在接口AttributeSet中- 返回:
-
名称为
Enumeration
-
getAttribute
获取属性的值。- 指定者:
getAttribute在接口AttributeSet中- 参数:
name- 属性名称- 返回:
- 值
-
containsAttribute
检查属性列表是否包含指定的属性名称/值对。- 指定者:
containsAttribute在接口AttributeSet中- 参数:
name- 名字value- 值- 返回:
- 如果名称/值对在列表中则为真
-
containsAttributes
检查属性列表是否包含所有指定的名称/值对。- 指定者:
containsAttributes在接口AttributeSet中- 参数:
attributes- 属性列表- 返回:
- 如果列表包含所有名称/值对,则为真
-
addAttribute
向列表中添加一个属性。- 指定者:
addAttribute在接口MutableAttributeSet中- 参数:
name- 属性名称value- 属性值
-
addAttributes
将一组属性添加到列表中。- 指定者:
addAttributes在接口MutableAttributeSet中- 参数:
attributes- 要添加的属性集
-
removeAttribute
从列表中删除一个属性。- 指定者:
removeAttribute在接口MutableAttributeSet中- 参数:
name- 属性名称
-
removeAttributes
从列表中删除一组属性。- 指定者:
removeAttributes在接口MutableAttributeSet中- 参数:
names- 要删除的名称集
-
removeAttributes
从列表中删除一组属性。- 指定者:
removeAttributes在接口MutableAttributeSet中- 参数:
attributes- 要删除的属性集
-
getResolveParent
获取解析父对象。如果未在本地定义属性,则这是要解析的属性集。如果没有其他属性集可以解析,则此值为 null。- 指定者:
getResolveParent在接口AttributeSet中- 返回:
- 父级
-
setResolveParent
设置解析父级。- 指定者:
setResolveParent在接口MutableAttributeSet中- 参数:
parent- 父母
-
clone
克隆一组属性。 -
hashCode
public int hashCode()返回这组属性的哈希码。 -
equals
将此对象与指定对象进行比较。如果对象是一组等效的属性,则结果为true。 -
toString
将属性集转换为字符串。
-