Module java.desktop

Class 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对象。当相应条件对于打印作业变为真时,打印机会将一个JobStateReason对象添加到打印作业的JobStateReasons属性中,并且当相应条件变为假时,打印机会再次删除JobStateReason对象,而不管打印作业的整体JobState是否也发生了变化。

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

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

参见:
  • Constructor Details

    • 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的实例
  • Method Details

    • 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
      返回:
      属性类别名称