| 
 | JavaTM 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 Platform Standard Ed. 6 | |||||||||
| 上一个类 下一个类 | 框架 无框架 | |||||||||
| 摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 | |||||||||
版权所有 2007 Sun Microsystems, Inc. 保留所有权利。 请遵守许可证条款。另请参阅文档重新分发政策。