public final class JobStateReasons extends HashSet<JobStateReason> implements PrintJobAttribute
JobState属性值的信息。
JobStateReason的实例不会直接出现在打印作业的属性集中。 相反,JobStateReasons属性出现在打印作业的属性集中。 JobStateReasons属性包含与打印作业的状态有关的零个,一个或多个对象JobStateReason 。 当打印作业的相应条件变为true时,打印机会将JobStateReason对象添加到打印作业的JobStateReasons属性,而当对应条件变为false时,打印机将再次删除JobStateReason对象,而不管打印作业的整体JobState是否也改变。
JobStateReasons类继承自java.util.HashSet类的实现 。 与大多数不可修改的打印属性不同,JobStateReasons类被设计为可变的; 您可以将JobStateReason对象添加到现有的JobStateReasons对象中,然后再次删除。 但是,像java.util.HashSet类, JobStateReasons类不是多线程安全的。 如果多个线程使用JobStateReasons对象,请确保同步其操作(例如,使用从类别java.util.Collections获取的同步集视图)。
IPP兼容性:每个单独的JobStateReason对象的toString()方法返回的字符串值给出IPP关键字值。 由getName()返回的类别名称提供IPP属性名称。
| Constructor and Description |
|---|
JobStateReasons()
构造一个新的,空的作业状态原因属性;
底层哈希集具有默认的初始容量和负载因子。
|
JobStateReasons(Collection<JobStateReason> collection)
构造一个新的作业状态原因属性,其中包含与给定集合相同的 JobStateReason对象。
|
JobStateReasons(int initialCapacity)
构造一个新的,空的作业状态原因属性;
底层哈希集具有给定的初始容量和默认负载因子。
|
JobStateReasons(int initialCapacity, float loadFactor)
构造一个新的,空的作业状态原因属性;
底层哈希集具有给定的初始容量和负载因子。
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
add(JobStateReason o)
如果指定的元素不存在,则将此指定元素添加到此作业状态reason属性。
|
类<? extends Attribute> |
getCategory()
获取要用作此打印属性值的“类别”的打印属性类。
|
String |
getName()
获取此属性值是一个实例的类别的名称。
|
clear, clone, contains, isEmpty, iterator, remove, size, spliteratorequals, hashCode, removeAlladdAll, containsAll, retainAll, toArray, toArray, toStringfinalize, getClass, notify, notifyAll, wait, wait, waitaddAll, containsAll, equals, hashCode, removeAll, retainAll, toArray, toArrayparallelStream, removeIf, streampublic JobStateReasons()
public JobStateReasons(int initialCapacity)
initialCapacity - 初始容量。
IllegalArgumentException - 如果初始容量小于零。
public JobStateReasons(int initialCapacity,
float loadFactor)
initialCapacity - 初始容量。
loadFactor - 负载系数。
IllegalArgumentException - 如果初始容量小于零。
public JobStateReasons(Collection<JobStateReason> collection)
JobStateReason对象。
底层哈希集的初始容量和负载因子在超类构造函数HashSet(Collection)中指定 。
collection - 要复制的集合。
NullPointerException - (未经检查的异常)如果抛出该异常
collection为空,或者如果在任何元件
collection为空。
ClassCastException - (未经检查的异常)抛出,如果collection中的任何元素不是类JobStateReason的实例。
public boolean add(JobStateReason o)
JobStateReason类的实例。
如果此作业状态原因属性已经包含指定的元素,则该作业将保持此状态原因属性不变,并返回false 。
add在接口
Collection<JobStateReason>
add中的
Set<JobStateReason>
add在
HashSet<JobStateReason>类
o - 要添加到此作业状态的元素属性。
NullPointerException - (未经检查的异常)如果指定的元素为空,则抛出。
ClassCastException - (未选中的异常)如果指定的元素不是类JobStateReason的实例,则抛出 。
public final 类<? extends Attribute> getCategory()
对于JobStateReasons类,该类别是JobStateReasons类。
getCategory在接口
Attribute
java.lang.Class的一个实例。
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2014, Oracle and/or its affiliates. All rights reserved.