javax.print.attribute.standard
public final class: JobStateReasons [javadoc |
source]
java.lang.Object
java.util.AbstractCollection<E>
java.util.AbstractSet<E>
java.util.HashSet<JobStateReason>
javax.print.attribute.standard.JobStateReasons
All Implemented Interfaces:
PrintJobAttribute, Set, Cloneable, Serializable, Collection
Class JobStateReasons is a printing attribute class, a set of enumeration
values, that provides additional information about the job's current state,
i.e., information that augments the value of the job's
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: |
public JobStateReasons() {
super();
}
Construct a new, empty job state reasons attribute; the underlying hash
set has the default initial capacity and load factor. |
public JobStateReasons(int initialCapacity) {
super (initialCapacity);
}
Construct a new, empty job state reasons attribute; the underlying hash
set has the given initial capacity and the default load factor. Parameters:
initialCapacity - Initial capacity.
Throws:
IllegalArgumentException - if the initial capacity is less
than zero.
|
public JobStateReasons(Collection<JobStateReason> collection) {
super (collection);
}
Construct a new job state reasons attribute that contains the same
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) . Parameters:
collection - Collection to copy.
Throws:
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 .
- exception:
NullPointerException -
(unchecked exception) Thrown if collection is null or
if any element in collection is null.
|
public JobStateReasons(int initialCapacity,
float loadFactor) {
super (initialCapacity, loadFactor);
}
Construct a new, empty job state reasons attribute; the underlying hash
set has the given initial capacity and load factor. Parameters:
initialCapacity - Initial capacity.
loadFactor - Load factor.
Throws:
IllegalArgumentException - if the initial capacity is less
than zero.
|
Methods from java.util.AbstractCollection: |
---|
add, addAll, clear, contains, containsAll, isEmpty, iterator, remove, removeAll, retainAll, size, toArray, toArray, toString |
Methods from java.lang.Object: |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method from javax.print.attribute.standard.JobStateReasons Detail: |
public boolean add(JobStateReason o) {
if (o == null) {
throw new NullPointerException();
}
return super.add ((JobStateReason) o);
}
Adds the specified element to this job state reasons attribute if it is
not already present. The element to be added must be an instance of class
JobStateReason . If this job state reasons
attribute already contains the specified element, the call leaves this
job state reasons attribute unchanged and returns false. |
public final Class<Attribute> getCategory() {
return JobStateReasons.class;
}
Get the printing attribute class which is to be used as the "category"
for this printing attribute value.
For class JobStateReasons, the category is class JobStateReasons itself. |
public final String getName() {
return "job-state-reasons";
}
Get the name of the category of which this attribute value is an
instance.
For class JobStateReasons, the category
name is "job-state-reasons" . |