- 所有父级接口:
AttributeSet
- 所有已知的实现类:
HashPrintServiceAttributeSet
接口
PrintServiceAttributeSet 指定一组打印作业属性的接口,即实现接口PrintServiceAttribute 的打印属性。在打印服务 API 中,打印服务实例使用 PrintServiceAttributeSet 来报告打印服务的状态。
PrintServiceAttributeSet 只是一个 AttributeSet ,其构造函数和变异操作保证了一个额外的不变量,即 PrintServiceAttributeSet 中的所有属性值必须是接口 PrintServiceAttribute 的实例。 add(Attribute) 和 addAll(AttributeSet) 操作在下面重新指定以保证这个额外的不变量。
-
方法总结
修饰符和类型方法描述boolean如果指定的属性值不存在,则将指定的属性值添加到此属性集中,首先删除与指定的属性值相同的属性类别中的任何现有值(可选操作)。booleanaddAll(AttributeSet attributes) 将指定集中的所有元素添加到此属性。在接口 javax.print.attribute.AttributeSet 中声明的方法
clear, containsKey, containsValue, equals, get, hashCode, isEmpty, remove, remove, size, toArray
-
方法详情
-
add
如果指定的属性值不存在,则将指定的属性值添加到此属性集中,首先删除与指定的属性值相同的属性类别中的任何现有值(可选操作)。- 指定者:
add在接口AttributeSet中- 参数:
attribute- 要添加到此属性集中的属性值- 返回:
true如果此属性集因调用而更改,即给定的属性值还不是此属性集的成员- 抛出:
UnmodifiableSetException- 如果此属性集不支持add()操作ClassCastException- 如果attribute不是接口PrintServiceAttribute的实例NullPointerException- 如果attribute是null
-
addAll
将指定集中的所有元素添加到此属性。结果与add(Attribute)操作已连续应用到此属性集与指定集中的每个元素相同。如果指定集中的所有类别都与此属性集中的任何类别相同,addAll()操作会有效地修改此属性集,使其值为union两组中的。addAll()操作的行为是未指定的,如果指定的集合在操作过程中被修改。如果
addAll()操作抛出异常,则对该属性集状态的影响取决于实现;异常点之前指定集中的元素可能已添加到此属性集中,也可能未添加到此属性集中。- 指定者:
addAll在接口AttributeSet中- 参数:
attributes- 要将其元素添加到此属性集中- 返回:
true如果此属性集因调用而更改- 抛出:
UnmodifiableSetException- 如果此属性集不支持addAll()方法ClassCastException- 如果指定集合中的某些元素不是接口PrintServiceAttribute的实例NullPointerException- 如果指定的集合是null- 参见:
-