模块  java.desktop
软件包  javax.print.attribute

Interface PrintJobAttributeSet

    • 方法详细信息

      • add

        boolean add​(Attribute attribute)
        如果指定的属性值尚不存在,则将其添加到此属性集中,首先删除与指定属性值相同的属性类别中的任何现有值(可选操作)。
        Specified by:
        add在接口 AttributeSet
        参数
        attribute - 要添加到此属性集的属性值
        结果
        true如果此属性集因调用而更改,即给定的属性值尚未是此属性集的成员
        异常
        UnmodifiableSetException - 如果此属性集不支持 add()操作
        ClassCastException - 如果attribute不是接口PrintJobAttribute的实例
        NullPointerException - 如果 attributenull
      • addAll

        boolean addAll​(AttributeSet attributes)
        将指定集中的所有元素添加到此属性。 结果与add(Attribute)操作已连续应用于指定集合中的每个元素的操作相同。 如果指定集中的任何类别都不与此属性集中的任何类别相同,则addAll()操作会有效地修改此属性集,以使其值为两个集合的集。

        如果在操作过程中修改了指定的集,则未指定addAll()操作的行为。

        如果addAll()操作抛出异常,则对此属性集的状态的影响取决于实现; 在异常点之前的指定集合中的元素可能已添加或未添加到此属性集中。

        Specified by:
        addAll in interface AttributeSet
        参数
        attributes - attributes其元素添加到此属性集
        结果
        true如果此属性集因调用而更改
        异常
        UnmodifiableSetException - 如果此属性集不支持 addAll()方法
        ClassCastException - 如果指定集中的某个元素不是接口的实例PrintJobAttribute
        NullPointerException - 如果指定的集是 null
        另请参见:
        add(Attribute)