- 所有超级接口:
-
AttributeSet
- 所有已知实现类:
-
HashPrintServiceAttributeSet
接口
PrintServiceAttributeSet指定了一组打印作业属性的接口,即实现接口PrintServiceAttribute的打印属性。在打印服务API中,打印服务实例使用PrintServiceAttributeSet来报告打印服务的状态。
PrintServiceAttributeSet只是一个AttributeSet,其构造函数和变异操作保证了一个额外的不变量,即PrintServiceAttributeSet中的所有属性值必须是接口PrintServiceAttribute的实例。下面重新指定了add(Attribute)和addAll(AttributeSet)操作,以保证这个额外的不变量。
-
Method Summary
Modifier and TypeMethodDescriptionboolean如果尚未存在指定的属性值,则将指定的属性值添加到此属性集中,首先删除与指定属性值相同属性类别中的任何现有值(可选操作)。booleanaddAll(AttributeSet attributes) 将指定集合中的所有元素添加到此属性中。Methods declared in interface javax.print.attribute.AttributeSet
clear, containsKey, containsValue, equals, get, hashCode, isEmpty, remove, remove, size, toArray
-
Method Details
-
add
如果尚未存在指定的属性值,则将指定的属性值添加到此属性集中,首先删除与指定属性值相同属性类别中的任何现有值(可选操作)。- 指定者:
-
add在接口AttributeSet中 - 参数:
-
attribute- 要添加到此属性集中的属性值 - 返回:
-
true如果调用导致此属性集发生更改,即给定的属性值尚未是此属性集的成员 - 抛出:
-
UnmodifiableSetException- 如果此属性集不支持add()操作 -
ClassCastException- 如果attribute不是接口PrintServiceAttribute的实例 -
NullPointerException- 如果attribute为null
-
addAll
将指定集合中的所有元素添加到此属性中。结果与将add(Attribute)操作连续应用于指定集合中的每个元素时相同。如果指定集合中的任何类别与此属性集中的任何类别相同,则addAll()操作有效地修改此属性集,使其值为两个集合的并集。如果在操作进行时修改了指定集合,则
addAll()操作的行为是未指定的。如果
addAll()操作引发异常,则对此属性集状态的影响取决于实现;在异常点之前指定集合中的元素可能已添加到此属性集,也可能未添加。- 指定者:
-
addAll在接口AttributeSet中 - 参数:
-
attributes- 要添加到此属性集中的元素 - 返回:
-
true如果调用导致此属性集发生更改 - 抛出:
-
UnmodifiableSetException- 如果此属性集不支持addAll()方法 -
ClassCastException- 如果指定集合中的某个元素不是接口PrintServiceAttribute的实例 -
NullPointerException- 如果指定集合为null - 参见:
-