public class HashAttributeSet extends Object implements AttributeSet, Serializable
AttributeSet
hashattributeset实现一个哈希映射特性。
Modifier | Constructor and Description |
---|---|
|
HashAttributeSet()
构造一个新的、空的属性集。
|
|
HashAttributeSet(Attribute attribute)
构造一个新的属性集,最初填充给定的属性。
|
|
HashAttributeSet(Attribute[] attributes)
构造一个新的属性集,最初填充给定数组的值。
|
protected |
HashAttributeSet(Attribute[] attributes, 类<?> interfaceName)
构造一个新的属性集,属性集的成员仅限于给定的接口。
|
protected |
HashAttributeSet(Attribute attribute, 类<?> interfaceName)
构造一个新的属性集,最初填充了给定的属性,属性集的成员被限制在给定的接口。
|
|
HashAttributeSet(AttributeSet attributes)
构造一个新的属性集,从给定的集合开始填充值。
|
protected |
HashAttributeSet(AttributeSet attributes, 类<?> interfaceName)
构造一个新的属性集,从给定的属性集的成员被限制在给定的接口的给定的值中填充的值。
|
protected |
HashAttributeSet(类<?> interfaceName)
构造一个新的、空的属性集,属性集的成员仅限于给定的接口。
|
Modifier and Type | Method and Description |
---|---|
boolean |
add(Attribute attribute)
如果没有已存在,则将指定的属性添加到该属性集中,首先将属性类别中的任何现有的属性设置为指定的属性值。
|
boolean |
addAll(AttributeSet attributes)
将指定的集合中的所有元素添加到这个属性中。
|
void |
clear()
从这个属性集中移除所有的属性。
|
boolean |
containsKey(类<?> category)
返回
true如果这个属性集包含指定的类别属性。
|
boolean |
containsValue(Attribute attribute)
如果此属性设置
true返回包含给定属性。
|
boolean |
equals(Object object)
将指定的对象与此属性设置为相等。
|
Attribute |
get(类<?> category)
返回此属性集包含的属性值在给定的属性类别中的属性值。
|
int |
hashCode()
返回此属性集的哈希代码值。
|
boolean |
isEmpty()
如果此属性集不包含任何属性,则返回真。
|
boolean |
remove(Attribute attribute)
如果存在的话,从该属性集中移除指定的属性。
|
boolean |
remove(类<?> category)
如果存在的话,从这个属性设置这个类别的任何属性。
|
int |
size()
返回此属性集的属性的数目。
|
Attribute[] |
toArray()
返回此集合中包含的属性的数组。
|
public HashAttributeSet()
public HashAttributeSet(Attribute attribute)
attribute
属性值添加到组。
NullPointerException
-(unchecked异常)如果
attribute
空抛。
public HashAttributeSet(Attribute[] attributes)
attributes
阵列在序列集合中的元素,从指数0。因此,如果数组包含重复的属性值或属性类别,以后的数组元素可以替换早期的数组元素。
attributes
数组添加到集合。如果为空,则构造一个空的属性集。
NullPointerException
-(unchecked例外)如果
attributes
任何元素为null抛出。
public HashAttributeSet(AttributeSet attributes)
attributes
-属性集,这集初始化。如果为空,则构造一个空的属性集。
protected HashAttributeSet(类<?> interfaceName)
interfaceName
的接口的所有成员这个属性必须是一个实例。它被认为是界面
Attribute
或接口方法。
NullPointerException
-如果interfacename是空的。
protected HashAttributeSet(Attribute attribute, 类<?> interfaceName)
attribute
属性值添加到组。
interfaceName
的接口的所有成员这个属性必须是一个实例。它被认为是界面
Attribute
或接口方法。
NullPointerException
-(unchecked异常)如果
attribute
空抛。
NullPointerException
-如果interfacename是空的。
ClassCastException
-(unchecked例外)如果
attribute
不是
interfaceName
实例抛出。
protected HashAttributeSet(Attribute[] attributes, 类<?> interfaceName)
attributes
阵列在序列集合中的元素,从指数0。因此,如果数组包含重复的属性值或属性类别,以后的数组元素可以替换早期的数组元素。
attributes
数组属性值添加到组。如果为空,则构造一个空的属性集。
interfaceName
的接口的所有成员这个属性必须是一个实例。它被认为是界面
Attribute
或接口方法。
NullPointerException
-(unchecked例外)如果
attributes
任何元素为null抛出。
NullPointerException
-如果interfacename是空的。
ClassCastException
-(unchecked例外)如果
attributes
任何元素不是
interfaceName
实例抛出。
protected HashAttributeSet(AttributeSet attributes, 类<?> interfaceName)
attributes
-设置属性的值来初始化设置。如果为空,则构造一个空的属性集。
interfaceName
的接口的所有成员这个属性必须是一个实例。它被认为是界面
Attribute
或接口方法。
ClassCastException
-(unchecked例外)如果
attributes
任何元素不是
interfaceName
实例抛出。
public Attribute get(类<?> category)
get
接口
AttributeSet
category
属性类的相关属性值被返回。它必须是一个
类
实现接口
Attribute
。
NullPointerException
-(unchecked例外)如果
category
空抛。
ClassCastException
-(unchecked例外)如果
category
不是
类
实现接口
Attribute
扔。
public boolean add(Attribute attribute)
add
接口
AttributeSet
attribute
属性值被添加到这个属性设置。
NullPointerException
-(unchecked例外)如果
attribute
空抛。
UnmodifiableSetException
-(unchecked异常)如果这个属性设置不支持
add()
操作抛出。
public boolean remove(类<?> category)
category
是空的,然后
remove()
不返回
false。
remove
接口
AttributeSet
category
属性范畴是删除从这个属性设置。
UnmodifiableSetException
-(unchecked异常)如果这个属性设置不支持
remove()
操作抛出。
public boolean remove(Attribute attribute)
attribute
是空的,然后
remove()
不返回
false。
remove
接口
AttributeSet
attribute
属性值被删除从这个属性设置。
UnmodifiableSetException
-(unchecked异常)如果这个属性设置不支持
remove()
操作抛出。
public boolean containsKey(类<?> category)
containsKey
接口
AttributeSet
category
的该属性集的存在是进行测试。
public boolean containsValue(Attribute attribute)
containsValue
接口
AttributeSet
attribute
-它的存在价值进行测试。
public boolean addAll(AttributeSet attributes)
add(Attribute)
操作已经被应用到该属性集的每个元素依次从指定的设置相同。如果指定的设置是在操作进行改性的
addAll(AttributeSet)
操作行为是未定义的。
如果addAll(AttributeSet)
操作抛出异常,该属性集的状态的影响是依赖于实现的;元素从指定的集合点前的异常可能会或可能不会被添加到这个属性设置。
addAll
接口
AttributeSet
attributes
的元素被添加到这个属性设置。
UnmodifiableSetException
-(unchecked异常)如果这个属性设置不支持
addAll(AttributeSet)方法引发。
NullPointerException
-(unchecked异常)如果在指定集合的一些元素为null抛出,或设置为空。
add(Attribute)
public int size()
size
接口
AttributeSet
public Attribute[] toArray()
AttributeSet
toArray
接口
AttributeSet
public void clear()
clear
接口
AttributeSet
UnmodifiableSetException
-(unchecked异常)如果这个属性设置不支持
clear()
操作抛出。
public boolean isEmpty()
isEmpty
接口
AttributeSet
public boolean equals(Object object)
equals
接口
AttributeSet
equals
方法重写,继承类
Object
object
-比较与此属性设置平等。
Object.hashCode()
,
HashMap
public int hashCode()
Object.hashCode()
一般合同要求。
hashCode
接口
AttributeSet
hashCode
方法重写,继承类
Object
Object.equals(java.lang.Object)
,
System.identityHashCode(java.lang.Object)
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.