-
- All Superinterfaces:
-
AttributeSet
- 所有已知实现类:
-
HashDocAttributeSet
public interface DocAttributeSet extends AttributeSet
接口DocAttributeSet指定一组doc属性的接口,即实现接口DocAttribute的打印属性。 在Print Service API中,客户端使用DocAttributeSet指定单个doc的特征以及要应用于单个doc的打印作业设置。A
DocAttributeSet只是一个AttributeSet,其构造函数和变异操作保证了一个额外的不变量,即DocAttributeSet中的所有属性值必须是接口DocAttribute的实例。 下面重新指定add(Attribute)和addAll(AttributeSet)操作以保证此额外的不变量。
-
-
方法摘要
所有方法 实例方法 抽象方法 变量和类型 方法 描述 booleanadd(Attribute attribute)如果指定的属性值尚不存在,则将其添加到此属性集中,首先删除与指定属性值相同的属性类别中的任何现有值(可选操作)。booleanaddAll(AttributeSet attributes)将指定集中的所有元素添加到此属性。-
声明方法的接口 javax.print.attribute.AttributeSet
clear, containsKey, containsValue, equals, get, hashCode, isEmpty, remove, remove, size, toArray
-
-
-
-
方法详细信息
-
add
boolean add(Attribute attribute)
如果指定的属性值尚不存在,则将其添加到此属性集中,首先删除与指定属性值相同的属性类别中的任何现有值(可选操作)。- Specified by:
-
addin interfaceAttributeSet - 参数
-
attribute- 要添加到此属性集的属性值 - 结果
-
true如果此属性集因调用而更改,即给定的属性值尚未是此属性集的成员 - 异常
-
UnmodifiableSetException- 如果此属性集不支持add()操作 -
ClassCastException- 如果attribute不是接口DocAttribute的实例 -
NullPointerException- 如果attribute是null
-
addAll
boolean addAll(AttributeSet attributes)
将指定集中的所有元素添加到此属性。 结果与add(Attribute)操作已连续应用于指定集合中的每个元素的结果相同。 如果指定集中的任何类别都不与此属性集中的任何类别相同,则addAll()操作会有效地修改此属性集,以使其值为两个集合的并集。如果在操作正在进行时修改了指定的集,则未指定
addAll()操作的行为。如果
addAll()操作抛出异常,则对此属性集的状态的影响取决于实现; 在异常点之前的指定集合中的元素可能已添加或未添加到此属性集中。- Specified by:
-
addAll在界面AttributeSet - 参数
-
attributes- 其元素将添加到此属性集 - 结果
-
true如果此属性集因调用而更改 - 异常
-
UnmodifiableSetException- 如果此属性集不支持addAll()方法 -
ClassCastException- 如果指定集中的某个元素不是接口的实例DocAttribute -
NullPointerException- 如果指定的集是null - 另请参见:
-
add(Attribute)
-
-