模块 java.desktop

类 JobStateReasons

所有已实现的接口:
Serializable , Cloneable , Iterable<JobStateReason> , Collection<JobStateReason> , Set<JobStateReason> , Attribute , PrintJobAttribute

public final class JobStateReasons extends HashSet <JobStateReason > implements PrintJobAttribute
JobStateReasons 类是打印属性类,一组枚举值,它提供有关作业当前状态的附加信息,即增加作业的JobState 属性值的信息。

JobStateReason 的实例不会直接出现在打印作业的属性集中。相反,JobStateReasons 属性出现在打印作业的属性集中。 JobStateReasons 属性包含零个、一个或多个与打印作业状态相关的 JobStateReason 对象。当打印作业的相应条件变为真时,打印机向打印作业的 JobStateReasons 属性添加一个JobStateReason 对象,当相应条件变为假时,打印机再次删除JobStateReason 对象,而不管打印作业的整体JobState 是否也发生了变化。

JobStateReasons 继承自类 java.util.HashSet 的实现。与大多数打印属性一经构建便不可变不同,JobStateReasons 类被设计为可变的;您可以将 JobStateReason 对象添加到现有的 JobStateReasons 对象并再次删除它们。但是,与类 java.util.HashSet 一样,类 JobStateReasons 不是多线程安全的。如果 JobStateReasons 对象将被多个线程使用,请确保同步其操作(例如,使用从类 java.util.Collections 获得的同步集合视图)。

IPP 兼容性:每个单独的 JobStateReason 对象的 toString() 方法返回的字符串值给出了 IPP 关键字值。 getName() 返回的类别名称给出了 IPP 属性名称。

参见:
  • 构造方法详细信息

    • JobStateReasons

      public JobStateReasons()
      构造一个新的空作业状态原因属性;底层哈希集具有默认的初始容量和加载因子。
    • JobStateReasons

      public JobStateReasons(int initialCapacity)
      构造一个新的空作业状态原因属性;底层哈希集具有给定的初始容量和默认加载因子。
      参数:
      initialCapacity - 初始容量
      抛出:
      IllegalArgumentException - 如果初始容量为负
    • JobStateReasons

      public JobStateReasons(int initialCapacity, float loadFactor)
      构造一个新的空作业状态原因属性;底层哈希集具有给定的初始容量和负载因子。
      参数:
      initialCapacity - 初始容量
      loadFactor - 负载系数
      抛出:
      IllegalArgumentException - 如果初始容量为负
    • JobStateReasons

      public JobStateReasons(Collection <JobStateReason > collection)
      构造一个新的作业状态原因属性,其中包含与给定集合相同的 JobStateReason 对象。底层哈希集的初始容量和加载因子在超类构造函数 HashSet(Collection) 中指定。
      参数:
      collection - 要复制的集合
      抛出:
      NullPointerException - 如果 collectionnull 或者如果 collection 中的任何元素是 null
      ClassCastException - 如果 collection 中的任何元素不是类 JobStateReason 的实例
  • 方法详情

    • add

      public boolean add(JobStateReason  o)
      将指定的元素添加到此作业状态原因属性(如果尚不存在)。要添加的元素必须是类 JobStateReason 的实例。如果此作业状态原因属性已包含指定元素,则调用保持此作业状态原因属性不变并返回 false
      指定者:
      add 在接口 Collection<JobStateReason>
      指定者:
      add 在接口 Set<JobStateReason>
      重写:
      add 在类 HashSet<JobStateReason>
      参数:
      o - 要添加到此作业状态原因属性的元素
      返回:
      true 如果此作业状态原因属性尚未包含指定元素
      抛出:
      NullPointerException - 如果指定的元素是 null
      ClassCastException - 如果指定的元素不是类 JobStateReason 的实例
      自从:
      1.5
    • getCategory

      public final Class <? extends Attribute > getCategory()
      获取将用作此打印属性值的“类别”的打印属性类。

      对于类 JobStateReasons ,类别是类 JobStateReasons 本身。

      指定者:
      getCategory 在接口 Attribute
      返回:
      打印属性类(类别),类java.lang.Class 的一个实例
    • getName

      public final String  getName()
      获取此属性值是其实例的类别的名称。

      对于 JobStateReasons 类,类别名称是 "job-state-reasons"

      指定者:
      getName 在接口 Attribute
      返回:
      属性类别名称