public final class JobStateReasons extends HashSet<JobStateReason> implements PrintJobAttribute
JobState
attribute.
Instances of JobStateReason
do not appear in a Print
Job's attribute set directly. Rather, a JobStateReasons attribute appears in
the Print Job's attribute set. The JobStateReasons attribute contains zero,
one, or more than one JobStateReason
objects which
pertain to the Print Job's status. The printer adds a JobStateReason
object to the Print Job's JobStateReasons attribute when the
corresponding condition becomes true of the Print Job, and the printer
removes the JobStateReason
object again when the
corresponding condition becomes false, regardless of whether the Print Job's
overall JobState
also changed.
Class JobStateReasons inherits its implementation from class java.util.HashSet
. Unlike most printing attributes which
are immutable once constructed, class JobStateReasons is designed to be
mutable; you can add JobStateReason
objects to an
existing JobStateReasons object and remove them again. However, like class
java.util.HashSet
, class JobStateReasons is not
multiple thread safe. If a JobStateReasons object will be used by multiple
threads, be sure to synchronize its operations (e.g., using a synchronized
set view obtained from class java.util.Collections
).
IPP Compatibility: The string value returned by each individual JobStateReason
object's toString()
method gives
the IPP keyword value. The category name returned by getName()
gives the IPP attribute name.
Constructor and Description |
---|
JobStateReasons()
Construct a new, empty job state reasons attribute; the underlying hash
set has the default initial capacity and load factor.
|
JobStateReasons(Collection<JobStateReason> collection)
Construct a new job state reasons attribute that contains the same
JobStateReason objects as the given collection. |
JobStateReasons(int initialCapacity)
Construct a new, empty job state reasons attribute; the underlying hash
set has the given initial capacity and the default load factor.
|
JobStateReasons(int initialCapacity,
float loadFactor)
Construct a new, empty job state reasons attribute; the underlying hash
set has the given initial capacity and load factor.
|
Modifier and Type | Method and Description |
---|---|
boolean |
add(JobStateReason o)
Adds the specified element to this job state reasons attribute if it is
not already present.
|
Class<? extends Attribute> |
getCategory()
Get the printing attribute class which is to be used as the "category"
for this printing attribute value.
|
String |
getName()
Get the name of the category of which this attribute value is an
instance.
|
clear, clone, contains, isEmpty, iterator, remove, size
equals, hashCode, removeAll
addAll, containsAll, retainAll, toArray, toArray, toString
public JobStateReasons()
public JobStateReasons(int initialCapacity)
initialCapacity
- Initial capacity.IllegalArgumentException
- if the initial capacity is less
than zero.public JobStateReasons(int initialCapacity, float loadFactor)
initialCapacity
- Initial capacity.loadFactor
- Load factor.IllegalArgumentException
- if the initial capacity is less
than zero.public JobStateReasons(Collection<JobStateReason> collection)
JobStateReason
objects as the given collection.
The underlying hash set's initial capacity and load factor are as
specified in the superclass constructor HashSet(Collection)
.collection
- Collection to copy.NullPointerException
- (unchecked exception) Thrown if collection
is null or
if any element in collection
is null.ClassCastException
- (unchecked exception) Thrown if any element in
collection
is not an instance of class JobStateReason
.public boolean add(JobStateReason o)
JobStateReason
. If this job state reasons
attribute already contains the specified element, the call leaves this
job state reasons attribute unchanged and returns false.add
in interface Collection<JobStateReason>
add
in interface Set<JobStateReason>
add
in class HashSet<JobStateReason>
o
- Element to be added to this job state reasons attribute.NullPointerException
- (unchecked exception) Thrown if the specified element is null.ClassCastException
- (unchecked exception) Thrown if the specified element is not an
instance of class JobStateReason
.public final Class<? extends Attribute> getCategory()
For class JobStateReasons, the category is class JobStateReasons itself.
getCategory
in interface 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, 2015, Oracle and/or its affiliates. All rights reserved.