|
JavaTM 2 Platform Standard Ed. 6 |
|||||||||
| 上一個類別 下一個類別 | 框架 無框架 | |||||||||
| 摘要: 巢狀 | 欄位 | 建構子 | 方法 | 詳細資訊: 欄位 | 建構子 | 方法 | |||||||||
java.lang.Objectjavax.print.attribute.AttributeSetUtilities
public final class AttributeSetUtilities
類別 AttributeSetUtilities 為操作 AttributeSets 提供靜態方法。
AttributeSet 的實作的操作。
AttributeSet S 的不可修改的視圖 U 為客戶機提供對 S 的“只讀”存取。U 上的查詢操作“遍歷”S;因此,S 中的更改會反映在 U 中。但是,任何修改 U 的嘗試都會導致 UnmodifiableSetException。如果屬性集物件 S 是可序列化的,則不可修改的視圖物件 U 將是可序列化的。
屬性集 S 的 同步視圖 V 為客戶機提供對 S 的同步(多執行緒安全)存取。V 的每個操作使用 V 本身作為鎖定物件進行同步,然後只調用 S 的相應操作。為了相互保證獨佔存取,通過 V 完成對 S 的所有存取非常重要。如果屬性集物件 S 是可序列化的,則同步視圖物件 V 將是可序列化的。
如 javax.print 的套件描述中提及的那樣,方法的 null 參考參數是不正確的,除非在該方法中將該參數明確記錄為具有有意義的解釋。與之相反的用法是不正確的編碼,可能立即或在稍後某一時間導致運行時異常。IllegalArgumentException 和 NullPointerException 是針對這種情況的典型的、可接受的運行時異常的範例。
| 從類別 java.lang.Object 繼承的方法 |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| 方法詳細資訊 |
|---|
public static AttributeSet unmodifiableView(AttributeSet attributeSet)
attributeSet - 底層屬性集。
attributeSet 的不可修改的視圖。
NullPointerException - 如果 attributeSet 為 null,則拋出該異常。public static DocAttributeSet unmodifiableView(DocAttributeSet attributeSet)
attributeSet - 底層文檔屬性集。
attributeSet 的不可修改的視圖。
NullPointerException - 如果 attributeSet 為 null,則拋出該異常。public static PrintRequestAttributeSet unmodifiableView(PrintRequestAttributeSet attributeSet)
attributeSet - 底層列印請求屬性集。
attributeSet 的不可修改的視圖。
NullPointerException - 如果 attributeSet 為 null,則拋出該異常。public static PrintJobAttributeSet unmodifiableView(PrintJobAttributeSet attributeSet)
attributeSet - 底層列印作業屬性集。
attributeSet 的不可修改的視圖。
NullPointerException - 如果 attributeSet 為 null,則拋出該異常。public static PrintServiceAttributeSet unmodifiableView(PrintServiceAttributeSet attributeSet)
attributeSet - 底層列印服務屬性集。
attributeSet 的不可修改的視圖。
NullPointerException - 如果 attributeSet 為 null,則拋出該異常。public static AttributeSet synchronizedView(AttributeSet attributeSet)
attributeSet - 底層屬性集。
attributeSet 的同步視圖。
NullPointerException - 如果 attributeSet 為 null,則拋出該異常。public static DocAttributeSet synchronizedView(DocAttributeSet attributeSet)
attributeSet - 底層文檔屬性集。
attributeSet 的同步視圖。
NullPointerException - 如果 attributeSet 為 null,則拋出該異常。public static PrintRequestAttributeSet synchronizedView(PrintRequestAttributeSet attributeSet)
attributeSet - 底層列印請求屬性集。
attributeSet 的同步視圖。
NullPointerException - 如果 attributeSet 為 null,則拋出該異常。public static PrintJobAttributeSet synchronizedView(PrintJobAttributeSet attributeSet)
attributeSet - 底層列印作業屬性集。
attributeSet 的同步視圖。
NullPointerException - 如果 attributeSet 為 null,則拋出該異常。public static PrintServiceAttributeSet synchronizedView(PrintServiceAttributeSet attributeSet)
attributeSet - 底層列印服務屬性集。
attributeSet 的同步視圖。
public static Class<?> verifyAttributeCategory(Object object,
Class<?> interfaceName)
Attribute 或其子介面)的 Class。
object - 要測試的物件。interfaceName - 該物件必須實作的介面。
object 是實作 interfaceName 的 Class,則返回的 object 向下轉型到型別 Class;否則拋出一個異常。
NullPointerException - (未經檢查的異常)如果 object 為 null,則拋出該異常。
ClassCastException - (未經檢查的異常)如果 object 不是實作 interfaceName 的 Class,則拋出該異常。
public static Attribute verifyAttributeValue(Object object,
Class<?> interfaceName)
Attribute 或其子介面)的一個實例。
object - 要測試的物件。interfaceName - 其物件必須是實例的介面的名稱。
object 是 interfaceName 的一個實例,則返回的 object 向下轉型到型別 Attribute;否則拋出一個異常。
NullPointerException - (未經檢查的異常)如果 object 為 null,則拋出該異常。
ClassCastException - (未經檢查的異常)如果 object 不是 interfaceName 的一個實例,則拋出該異常。
public static void verifyCategoryForValue(Class<?> category,
Attribute attribute)
category - 要測試的屬性類別別。attribute - 要測試的屬性值。
NullPointerException - (未經檢查的異常)如果 category 為 null,或者如果 attribute 為 null,則拋出該異常。
IllegalArgumentException - (未經檢查的異常)如果 category 不等於 attribute 的類別別,則拋出該異常。
|
JavaTM 2 Platform Standard Ed. 6 |
|||||||||
| 上一個類別 下一個類別 | 框架 無框架 | |||||||||
| 摘要: 巢狀 | 欄位 | 建構子 | 方法 | 詳細資訊: 欄位 | 建構子 | 方法 | |||||||||
版權所有 2008 Sun Microsystems, Inc. 保留所有權利。請遵守GNU General Public License, version 2 only。