JavaTM Platform
Standard Ed. 6

javax.print.attribute
�� HashAttributeSet

java.lang.Object
  �̳��� javax.print.attribute.HashAttributeSet
������ʵ�ֵĽӿڣ�
Serializable, AttributeSet
ֱ����֪���ࣺ
HashDocAttributeSet, HashPrintJobAttributeSet, HashPrintRequestAttributeSet, HashPrintServiceAttributeSet

public class HashAttributeSet
extends Object
implements AttributeSet, Serializable

�� HashAttributeSet �ṩ���й�ϣӳ�������� AttributeSet ʵ�֡�

������
�������

���췽��ժҪ
  HashAttributeSet()
          ����һ���µġ������Լ���
  HashAttributeSet(Attribute attribute)
          ����һ�����ʹ�ø����������������Լ���
  HashAttributeSet(Attribute[] attributes)
          ����һ�����ʹ�ø��������е�ֵ���������Լ���
protected HashAttributeSet(Attribute[] attributes, Class<?> interfaceName)
          ����һ���µ����Լ������и����Լ��ij�Ա���ڸ����Ľӿڡ�
protected HashAttributeSet(Attribute attribute, Class<?> interfaceName)
          ����һ�����ʹ�ø����������������Լ������и����Լ��ij�Ա���ڸ����Ľӿڡ�
  HashAttributeSet(AttributeSet attributes)
          ����һ�����ʹ�ø��������е�ֵ���������Լ���
protected HashAttributeSet(AttributeSet attributes, Class<?> interfaceName)
          ����һ�����ʹ�ø��������е�ֵ���������Լ������и����Լ��ij�Ա���ڸ����Ľӿڡ�
protected HashAttributeSet(Class<?> interfaceName)
          ����һ���µĿ����Լ������и����Լ��ij�Ա���ڸ����Ľӿڡ�
 
����ժҪ
 boolean add(Attribute attribute)
          ���ָ�������Բ����ڣ��������ӵ������Լ��У������������Ƴ���ָ������ֵ��ͬ����������е��κ��������ԡ�
 boolean addAll(AttributeSet attributes)
          ��ָ�������е�����Ԫ�����ӵ��������С�
 void clear()
          �Ӵ����Լ����Ƴ��������ԡ�
 boolean containsKey(Class<?> category)
          ��������Լ�����ָ���������ԣ��򷵻� true��
 boolean containsValue(Attribute attribute)
          ��������Լ��������������ԣ��򷵻� true��
 boolean equals(Object object)
          �Ƚ�ָ���Ķ���������Լ�������ԡ�
 Attribute get(Class<?> category)
          ���ش����Լ��ڸ�������������а���������ֵ��
 int hashCode()
          ���ش����Լ��Ĺ�ϣ��ֵ��
 boolean isEmpty()
          ��������Լ��������κ����ԣ��򷵻� true��
 boolean remove(Attribute attribute)
          �Ӵ����Լ��Ƴ�ָ�������ԣ�������ڣ���
 boolean remove(Class<?> category)
          �Ӵ����Լ��Ƴ��������κ����ԣ�������ڣ���
 int size()
          ���ش����Լ������Ե�������
 Attribute[] toArray()
          ���ش˼����а��������Ե����顣
 
���� java.lang.Object �̳еķ���
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

���췽����ϸ��Ϣ

HashAttributeSet

public HashAttributeSet()
����һ���µġ������Լ���


HashAttributeSet

public HashAttributeSet(Attribute attribute)
����һ�����ʹ�ø����������������Լ���

������
attribute - Ҫ���ӵ��˼��ϵ�����ֵ��
�׳���
NullPointerException - ��δ�������쳣����� attribute Ϊ null�����׳����쳣��

HashAttributeSet

public HashAttributeSet(Attribute[] attributes)
����һ�����ʹ�ø��������е�ֵ���������Լ���ͨ���� attributes �����е�Ԫ�ش����� 0 ��ʼ��˳�����ӵ��ü���������µ����Լ�����ˣ��������������ظ�������ֵ�������������������Ԫ�ؿ����滻ǰ�������Ԫ�ء�

������
attributes - Ҫ���ӵ��ü��ϵ�����ֵ�����顣���Ϊ null������һ�������Լ���
�׳���
NullPointerException - ��δ�������쳣����� attributes ���κ�Ԫ��Ϊ null�����׳����쳣��

HashAttributeSet

public HashAttributeSet(AttributeSet attributes)
����һ�����ʹ�ø��������е�ֵ���������Լ���

������
attributes - ���г�ʼ���˼��ϵ����Լ������Ϊ null������һ�������Լ���

HashAttributeSet

protected HashAttributeSet(Class<?> interfaceName)
����һ���µĿ����Լ������и����Լ��ij�Ա���ڸ����Ľӿڡ�

������
interfaceName - �����Լ������г�Ա��������ʵ���Ľӿڡ������ǽӿ� Attribute �����ӽӿڡ�
�׳���
NullPointerException - ��� interfaceName Ϊ null��

HashAttributeSet

protected HashAttributeSet(Attribute attribute,
                           Class<?> interfaceName)
����һ�����ʹ�ø����������������Լ������и����Լ��ij�Ա���ڸ����Ľӿڡ�

������
attribute - Ҫ���ӵ��˼��ϵ�����ֵ��
interfaceName - �����Լ������г�Ա��������ʵ���Ľӿڡ������ǽӿ� Attribute �����ӽӿڡ�
�׳���
NullPointerException - ��δ�������쳣����� attribute Ϊ null�����׳����쳣��
NullPointerException - ��� interfaceName Ϊ null��
ClassCastException - ��δ�������쳣����� attribute ���� interfaceName ��һ��ʵ�������׳����쳣��

HashAttributeSet

protected HashAttributeSet(Attribute[] attributes,
                           Class<?> interfaceName)
����һ���µ����Լ������и����Լ��ij�Ա���ڸ����Ľӿڡ�ͨ���� attributes �����е�Ԫ�ش����� 0 ��ʼ��˳�����ӵ��ü���������µ����Լ�����ˣ��������������ظ�������ֵ�������������������Ԫ�ؿ����滻ǰ�������Ԫ�ء�

������
attributes - Ҫ���ӵ��ü��ϵ�����ֵ�����顣���Ϊ null������һ�������Լ���
interfaceName - �����Լ������г�Ա��������ʵ���Ľӿڡ������ǽӿ� Attribute �����ӽӿڡ�
�׳���
NullPointerException - ��δ�������쳣����� attributes ���κ�Ԫ��Ϊ null�����׳����쳣��
NullPointerException - ��� interfaceName Ϊ null��
ClassCastException - ��δ�������쳣����� attributes ��Ԫ�ز��� interfaceName ��һ��ʵ�������׳����쳣��

HashAttributeSet

protected HashAttributeSet(AttributeSet attributes,
                           Class<?> interfaceName)
����һ�����ʹ�ø��������е�ֵ���������Լ������и����Լ��ij�Ա���ڸ����Ľӿڡ�

������
attributes - Ҫ��ʼ���ü��ϵ�����ֵ�ļ��ϡ����Ϊ null������һ�������Լ���
interfaceName - �����Լ������г�Ա��������ʵ���Ľӿڡ������ǽӿ� Attribute �����ӽӿڡ�
�׳���
ClassCastException - ��δ�������쳣����� attributes ��Ԫ�ز��� interfaceName ��һ��ʵ�������׳����쳣��
������ϸ��Ϣ

get

public Attribute get(Class<?> category)
���ش����Լ��ڸ�������������а���������ֵ����������Լ��ڸ�������������в������κ�����ֵ���򷵻� null��

ָ���ߣ�
�ӿ� AttributeSet �е� get
������
category - �����������������ֵ�����������������ʵ�ֽӿ� Attribute �� Class��
���أ�
�����Լ��а����ĸ�����������е�����ֵ����������Լ��ڸ�������������в������κ�����ֵ���򷵻� null��
�׳���
NullPointerException - ��δ�������쳣����� category Ϊ null�����׳����쳣��
ClassCastException - ��δ�������쳣����� category ����ʵ�ֽӿ� Attribute �� Class�����׳����쳣��

add

public boolean add(Attribute attribute)
���ָ�������Բ����ڣ��������ӵ������Լ��У������������Ƴ���ָ������ֵ��ͬ����������е��κ��������ԡ�

ָ���ߣ�
�ӿ� AttributeSet �е� add
������
attribute - Ҫ���ӵ������Լ�������ֵ��
���أ�
��������Լ����ڵ��ö������ı䣨��������������ֵ�����Ǵ����Լ��ij�Ա�����򷵻� true��
�׳���
NullPointerException - ��δ�������쳣����� attribute Ϊ null�����׳����쳣��
UnmodifiableSetException - ��δ�������쳣����������Լ���֧�� add() ���������׳����쳣��

remove

public boolean remove(Class<?> category)
�Ӵ����Լ��Ƴ��������κ����ԣ�������ڣ������ category Ϊ null���� remove() ��ִ���κβ����������� false��

ָ���ߣ�
�ӿ� AttributeSet �е� remove
������
category - Ҫ�Ӵ����Լ��Ƴ����������
���أ�
��������Լ����ڵ��ö������ı䣨����������������Ѿ���Ϊ�����Լ��ij�Ա�����򷵻� true��
�׳���
UnmodifiableSetException - ��δ�������쳣����������Լ���֧�� remove() ���������׳����쳣��

remove

public boolean remove(Attribute attribute)
�Ӵ����Լ��Ƴ�ָ�������ԣ�������ڣ������ attribute Ϊ null���� remove() ��ִ���κβ����������� false��

ָ���ߣ�
�ӿ� AttributeSet �е� remove
������
attribute - �Ӵ����Լ��Ƴ�������ֵ��
���أ�
��������Լ����ڵ��ö������ı䣨��������������ֵ�Ѿ���Ϊ�����Լ��ij�Ա�����򷵻� true��
�׳���
UnmodifiableSetException - ��δ�������쳣����������Լ���֧�� remove() ���������׳����쳣��

containsKey

public boolean containsKey(Class<?> category)
��������Լ�����ָ���������ԣ��򷵻� true��

ָ���ߣ�
�ӿ� AttributeSet �е� containsKey
������
category - ���������Ƿ�����ڴ����Լ��е����
���أ�
��������Լ�����ָ������һ������ֵ���򷵻� true��

containsValue

public boolean containsValue(Attribute attribute)
��������Լ��������������ԣ��򷵻� true��

ָ���ߣ�
�ӿ� AttributeSet �е� containsValue
������
attribute - ���������Ƿ�����ڴ����Լ��е�ֵ��
���أ�
��������Լ���������������ֵ���򷵻� true��

addAll

public boolean addAll(AttributeSet attributes)
��ָ�������е�����Ԫ�����ӵ��������С��ý����ʹ��ָ�������е�ÿ��Ԫ�ؽ� add(Attribute) �����ɹ���Ӧ�õ������Լ�����ͬ��������ڽ��д˲�����ͬʱ�޸���ָ���ļ��ϣ��� addAll(AttributeSet) ��������Ϊ�Dz�ȷ���ġ�

��� addAll(AttributeSet) �����׳�һ���쳣����Դ����Լ�״̬��Ӱ��ȡ����ʵ�ַ��������쳣��֮ǰ����һ����ָ�������е�Ԫ�����ӵ��˴����Լ���

ָ���ߣ�
�ӿ� AttributeSet �е� addAll
������
attributes - Ҫ����Ԫ�����ӵ������Լ��е����ԡ�
���أ�
��������Լ����ڵ��ö������ı䣬�򷵻� true��
�׳���
UnmodifiableSetException - ��δ�������쳣����������Լ���֧�� addAll(AttributeSet) ���������׳����쳣��
NullPointerException - ��δ�������쳣�����ָ�������е�ijһԪ��Ϊ null����ü���Ϊ null�����׳����쳣��
������
add(Attribute)

size

public int size()
���ش����Լ������Ե���������������Լ�������Ԫ�ض��� Integer.MAX_VALUE ���򷵻� Integer.MAX_VALUE��

ָ���ߣ�
�ӿ� AttributeSet �е� size
���أ�
�����Լ������Ե�������

toArray

public Attribute[] toArray()
�ӽӿ� AttributeSet ���Ƶ�����
���ش˼����а��������Ե����顣

ָ���ߣ�
�ӿ� AttributeSet �е� toArray
���أ�
��Ϊ��������ڴ˼����е����ԣ���� AttributeSet Ϊ�գ��򷵻��㳤�ȡ�

clear

public void clear()
�Ӵ����Լ����Ƴ��������ԡ�

ָ���ߣ�
�ӿ� AttributeSet �е� clear
�׳���
UnmodifiableSetException - ��δ�������쳣����������Լ���֧�� clear() ���������׳����쳣��

isEmpty

public boolean isEmpty()
��������Լ��������κ����ԣ��򷵻� true��

ָ���ߣ�
�ӿ� AttributeSet �е� isEmpty
���أ�
��������Լ��������κ����ԣ��򷵻� true��

equals

public boolean equals(Object object)
�Ƚ�ָ���Ķ���������Լ�������ԡ���������Ķ���Ҳ��һ�����Լ��������������Լ�������ͬ�������������ֵ��ӳ���ϵ���򷵻� true����ȷ���� equals() �����ܿ�Խ AttributeSet �ӿڵIJ�ͬʵ���������С�

ָ���ߣ�
�ӿ� AttributeSet �е� equals
���ǣ�
�� Object �е� equals
������
object - Ҫ������Լ���������ԱȽϵĶ���
���أ�
���ָ��������ڴ����Լ����򷵻� true��
������
Object.hashCode(), Hashtable

hashCode

public int hashCode()
���ش����Լ��Ĺ�ϣ��ֵ�����Լ��Ĺ�ϣ�뱻����Ϊ AttributeSet ��ÿ����Ŀ�Ĺ�ϣ����ܺ͡���ȷ���� t1.equals(t2) ��ζ�����κ��������Լ� t1 �� t2 ���ԣ������� t1.hashCode()==t2.hashCode()������ Object.hashCode() ��ͨ��Э����Ҫ��ġ�

ָ���ߣ�
�ӿ� AttributeSet �е� hashCode
���ǣ�
�� Object �е� hashCode
���أ�
�����Լ��Ĺ�ϣ��ֵ��
������
Object.equals(java.lang.Object), Hashtable

JavaTM Platform
Standard Ed. 6

�ύ��������
�йظ���� API �ο����ϺͿ�����Ա�ĵ�������� Java SE ������Ա�ĵ������ĵ���������ϸ�ġ����򿪷���Ա���������Լ�������������ﶨ�塢ʹ�ü��ɺ͹�������ʾ����

��Ȩ���� 2007 Sun Microsystems, Inc. ��������Ȩ���� ����������֤��������������ĵ����·ַ�������