|
JavaTM 2 Platform Standard Ed. 6 |
|||||||||
| 上一個類別 下一個類別 | 框架 無框架 | |||||||||
| 摘要: 巢狀 | 欄位 | 建構子 | 方法 | 詳細資訊: 欄位 | 建構子 | 方法 | |||||||||
java.lang.Objectjavax.print.attribute.HashAttributeSet
public class HashAttributeSet
類別 HashAttributeSet 提供具有雜湊映射特徵的 AttributeSet 實作。
| 建構子摘要 | |
|---|---|
|
HashAttributeSet()
建構一個新的、空屬性集。 |
|
HashAttributeSet(Attribute attribute)
建構一個最初使用給定屬性填充的新屬性集。 |
|
HashAttributeSet(Attribute[] attributes)
建構一個最初使用給定陣列中的值填充的新屬性集。 |
protected |
HashAttributeSet(Attribute[] attributes,
Class<?> interfaceName)
建構一個新的屬性集,其中該屬性集的成員限於給定的介面。 |
protected |
HashAttributeSet(Attribute attribute,
Class<?> interfaceName)
建構一個最初使用給定屬性填充的新屬性集,其中該屬性集的成員限於給定的介面。 |
|
HashAttributeSet(AttributeSet attributes)
建構一個最初使用給定集合中的值填充的新屬性集。 |
protected |
HashAttributeSet(AttributeSet attributes,
Class<?> interfaceName)
建構一個最初使用給定集合中的值填充的新屬性集,其中該屬性集的成員限於給定的介面。 |
protected |
HashAttributeSet(Class<?> interfaceName)
建構一個新的空屬性集,其中該屬性集的成員限於給定的介面。 |
| 方法摘要 | |
|---|---|
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 |
| 建構子詳細資訊 |
|---|
public HashAttributeSet()
public HashAttributeSet(Attribute attribute)
attribute - 要添加到此集合的屬性值。
NullPointerException - (未經檢查的異常)如果 attribute 為 null,則拋出該異常。public HashAttributeSet(Attribute[] attributes)
attributes 陣列中的元素從索引 0 開始按順序添加到該集合來填充新的屬性集。因此,如果該陣列包含重複的屬性值或屬性類別別,則後面的陣列元素可以替換前面的陣列元素。
attributes - 要添加到該集合的屬性值的陣列。如果為 null,則建構一個空屬性集。
NullPointerException - (未經檢查的異常)如果 attributes 的任何元素為 null,則拋出該異常。public HashAttributeSet(AttributeSet attributes)
attributes - 從中初始化此集合的屬性集。如果為 null,則建構一個空屬性集。protected HashAttributeSet(Class<?> interfaceName)
interfaceName - 此屬性集的所有成員必須是其實例的介面。假設是介面 Attribute 或其子介面。
NullPointerException - 如果 interfaceName 為 null。
protected HashAttributeSet(Attribute attribute,
Class<?> interfaceName)
attribute - 要添加到此集合的屬性值。interfaceName - 此屬性集的所有成員必須是其實例的介面。假設是介面 Attribute 或其子介面。
NullPointerException - (未經檢查的異常)如果 attribute 為 null,則拋出該異常。
NullPointerException - 如果 interfaceName 為 null。
ClassCastException - (未經檢查的異常)如果 attribute 不是 interfaceName 的一個實例,則拋出該異常。
protected HashAttributeSet(Attribute[] attributes,
Class<?> interfaceName)
attributes 陣列中的元素從索引 0 開始按順序添加到該集合來填充新的屬性集。因此,如果該陣列包含重複的屬性值或屬性類別別,則後面的陣列元素可以替換前面的陣列元素。
attributes - 要添加到該集合的屬性值的陣列。如果為 null,則建構一個空屬性集。interfaceName - 此屬性集的所有成員必須是其實例的介面。假設是介面 Attribute 或其子介面。
NullPointerException - (未經檢查的異常)如果 attributes 的任何元素為 null,則拋出該異常。
NullPointerException - 如果 interfaceName 為 null。
ClassCastException - (未經檢查的異常)如果 attributes 的元素不是 interfaceName 的一個實例,則拋出該異常。
protected HashAttributeSet(AttributeSet attributes,
Class<?> interfaceName)
attributes - 要初始化該集合的屬性值的集合。如果為 null,則建構一個空屬性集。interfaceName - 此屬性集的所有成員必須是其實例的介面。假設是介面 Attribute 或其子介面。
ClassCastException - (未經檢查的異常)如果 attributes 的元素不是 interfaceName 的一個實例,則拋出該異常。| 方法詳細資訊 |
|---|
public Attribute get(Class<?> category)
AttributeSet 中的 getcategory - 將返回其關聯的屬性值的屬性類別別。它必須是實作介面 Attribute 的 Class。
NullPointerException - (未經檢查的異常)如果 category 為 null,則拋出該異常。
ClassCastException - (未經檢查的異常)如果 category 不是實作介面 Attribute 的 Class,則拋出該異常。public boolean add(Attribute attribute)
AttributeSet 中的 addattribute - 要添加到此屬性集的屬性值。
NullPointerException - (未經檢查的異常)如果 attribute 為 null,則拋出該異常。
UnmodifiableSetException - (未經檢查的異常)如果此屬性集不支持 add() 操作,則拋出該異常。public boolean remove(Class<?> category)
category 為 null,則 remove() 不執行任何操作,並返回 false。
AttributeSet 中的 removecategory - 要從此屬性集移除的屬性類別別。
UnmodifiableSetException - (未經檢查的異常)如果此屬性集不支持 remove() 操作,則拋出該異常。public boolean remove(Attribute attribute)
attribute 為 null,則 remove() 不執行任何操作,並返回 false。
AttributeSet 中的 removeattribute - 從此屬性集移除的屬性值。
UnmodifiableSetException - (未經檢查的異常)如果此屬性集不支持 remove() 操作,則拋出該異常。public boolean containsKey(Class<?> category)
AttributeSet 中的 containsKeycategory - 將測試其是否存在於此屬性集中的類別別。
public boolean containsValue(Attribute attribute)
AttributeSet 中的 containsValueattribute - 將測試其是否存在於此屬性集中的值。
public boolean addAll(AttributeSet attributes)
add(Attribute) 操作成功地應用到此屬性集中相同。如果正在進行此操作的同時修改了指定的集合,則 addAll(AttributeSet) 操作的行為是不確定的。
如果 addAll(AttributeSet) 操作拋出一個異常,則對此屬性集狀態的影響取決於實作方法;在異常點之前,不一定將指定集合中的元素添加到了此屬性集。
AttributeSet 中的 addAllattributes - 要將其元素添加到此屬性集中的屬性。
UnmodifiableSetException - (未經檢查的異常)如果此屬性集不支持 addAll(AttributeSet) 方法,則拋出該異常。
NullPointerException - (未經檢查的異常)如果指定集合中的某一元素為 null,或該集合為 null,則拋出該異常。add(Attribute)public int size()
AttributeSet 中的 sizepublic Attribute[] toArray()
AttributeSet 複製的描述
AttributeSet 中的 toArraypublic void clear()
AttributeSet 中的 clearUnmodifiableSetException - (未經檢查的異常)如果此屬性集不支持 clear() 操作,則拋出該異常。public boolean isEmpty()
AttributeSet 中的 isEmptypublic boolean equals(Object object)
AttributeSet 中的 equalsObject 中的 equalsobject - 要與此屬性集進行相等性比較的物件。
Object.hashCode(),
Hashtablepublic int hashCode()
Object.hashCode() 的通用協定所要求的。
AttributeSet 中的 hashCodeObject 中的 hashCodeObject.equals(java.lang.Object),
Hashtable
|
JavaTM 2 Platform Standard Ed. 6 |
|||||||||
| 上一個類別 下一個類別 | 框架 無框架 | |||||||||
| 摘要: 巢狀 | 欄位 | 建構子 | 方法 | 詳細資訊: 欄位 | 建構子 | 方法 | |||||||||
版權所有 2008 Sun Microsystems, Inc. 保留所有權利。請遵守GNU General Public License, version 2 only。