public interface AttributeSet
属性可以在层次结构中潜在地解决。如果一个键不在本地解析,并且解决父存在,则键将通过父。
MutableAttributeSet
Modifier and Type | Interface and Description |
---|---|
static interface |
AttributeSet.CharacterAttribute
此接口是预期将出现在任何属性键上的类型签名,这将有助于字符级别的演示文稿。
|
static interface |
AttributeSet.ColorAttribute
此接口是预期将出现在有助于呈现颜色的任何属性键上的类型签名。
|
static interface |
AttributeSet.FontAttribute
此接口是预期将出现在任何属性键上的类型签名,有助于确定使用何种字体来呈现某些文本。
|
static interface |
AttributeSet.ParagraphAttribute
此接口是预期将出现在任何属性键上的类型签名,这将有助于段落级演示文稿的出现。
|
Modifier and Type | Field and Description |
---|---|
static Object |
NameAttribute
属性名称用于命名属性集合的名称。
|
static Object |
ResolveAttribute
属性名称,用于标识属性的解析父组,如果定义了一个。
|
Modifier and Type | Method and Description |
---|---|
boolean |
containsAttribute(Object name, Object value)
返回
true 如果这集定义一个属性具有相同的名称和一个平等的价值。
|
boolean |
containsAttributes(AttributeSet attributes)
返回
true 如果这集定义的所有属性的给定值相等。
|
AttributeSet |
copyAttributes()
返回一个保证不随时间变化的属性集。
|
Object |
getAttribute(Object key)
获取给定属性的值。
|
int |
getAttributeCount()
返回在该集合中定义的属性的数量。
|
Enumeration<?> |
getAttributeNames()
返回一个枚举在集合中定义的属性的名称的枚举。
|
AttributeSet |
getResolveParent()
获取解决父。
|
boolean |
isDefined(Object attrName)
检查集合中是否有一个指定的值,而不通过另一个属性集解析。
|
boolean |
isEqual(AttributeSet attr)
确定两个属性集是否等价。
|
static final Object NameAttribute
static final Object ResolveAttribute
int getAttributeCount()
boolean isDefined(Object attrName)
attrName
-属性名称
boolean isEqual(AttributeSet attr)
attr
-属性集
AttributeSet copyAttributes()
Object getAttribute(Object key)
key
-属性绑定的非空的关键
null
如果没有找到
Enumeration<?> getAttributeNames()
Enumeration
的值可以是任何未被约束到一个特定的
Object
型。
此方法不会返回null
。一套没有任何属性,它返回一个空Enumeration
。
boolean containsAttribute(Object name, Object value)
true
如果这集定义一个属性具有相同的名称和一个平等的价值。如果在本地找不到这样的属性,则在解析父层次结构中搜索到该属性。
name
-非空属性名称
value
-价值
true
如果集定义的属性与平等的价值,无论是在本地或通过解决家长
NullPointerException
-如果
name
或
value
是
null
boolean containsAttributes(AttributeSet attributes)
true
如果这集定义的所有属性的给定值相等。如果在本地找不到属性,则在解析父层次结构中搜索该属性。
attributes
-属性对照组
true
定义所有的属性具有相同的值,可以在本地或通过其解决家长
null
attributes
NullPointerException
AttributeSet getResolveParent()
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2014, Oracle and/or its affiliates. All rights reserved.