PrinterStateReasons is a printing attribute class, a set of
enumeration values, that provides additional information about the printer's
current state, i.e., information that augments the value of the printer's
PrinterState attribute.
Instances of PrinterStateReason do not appear in a
Print Service's attribute set directly. Rather, a PrinterStateReasons
attribute appears in the Print Service's attribute set. The
PrinterStateReasons attribute contains zero, one, or more than one
PrinterStateReason objects which pertain to the
Print Service's status, and each
PrinterStateReason object is associated with a
Severity level of REPORT (least severe),
WARNING, or ERROR (most severe). The printer adds a
PrinterStateReason object to the Print Service's
PrinterStateReasons attribute when the corresponding condition
becomes true of the printer, and the printer removes the
PrinterStateReason object again when the
corresponding condition becomes false, regardless of whether the Print
Service's overall PrinterState also changed.
Class PrinterStateReasons inherits its implementation from class
java.. Each entry in the map consists of a
PrinterStateReason object (key) mapping to a
Severity object (value):
Unlike most printing attributes which are immutable once constructed, class
PrinterStateReasons is designed to be mutable; you can add
PrinterStateReason objects to an existing
PrinterStateReasons object and remove them again. However, like class
java., class PrinterStateReasons is not
multiple thread safe. If a PrinterStateReasons object will be used by
multiple threads, be sure to synchronize its operations (e.g., using a
synchronized map view obtained from class java.).
IPP Compatibility: The string values returned by each individual
PrinterStateReason object's and the associated
Severity object's toString() methods, concatenated
together with a hyphen ("-") in between, gives the IPP keyword value.
The category name returned by getName() gives the IPP attribute name.
| Modifier and Type | Class and Description |
|---|---|
| private static class | |
| private static class |
| Modifier and Type | Field and Description |
|---|---|
| private static final long | serialVersionUID
Use serialVersionUID from JDK 1.4 for interoperability.
|
| Access | Constructor and Description |
|---|---|
| public | PrinterStateReasons()
Construct a new, empty printer state reasons attribute; the underlying hash map has the default initial capacity and load factor. |
| public | PrinterStateReasons(int
initial capacity initialCapacity)Construct a new, empty printer state reasons attribute; the underlying hash map has the given initial capacity and the default load factor. |
| public | PrinterStateReasons(int
initial capacity initialCapacity, float load factor loadFactor)Construct a new, empty printer state reasons attribute; the underlying hash map has the given initial capacity and load factor. |
| public | PrinterStateReasons(Map<PrinterStateReason, Severity>
map to copy map)Construct a new printer state reasons attribute that contains the same
|
| Modifier and Type | Method and Description |
|---|---|
| public final Class | Returns: printing attribute class (category), an instance of classjava.Implements javax. Get the printing attribute class which is to be used as the "category" for this printing attribute value. |
| public final String | Returns: attribute category nameImplements javax. Get the name of the category of which this attribute value is an instance. |
| public Set | printerStateReasonSet(Severity
severity level severity)Obtain an unmodifiable set view of the individual printer state reason
attributes at the given severity level in this
|
| public Severity | Returns: previous severity associated with the given printer state reason, ornull if the given printer state reason was not
presentprinter state reason. This must be an instance of class
reason, Severity PrinterStateReasonseverity of the printer state reason. This must be an
instance of class severity)SeverityOverrides java. Implements java. Adds the given printer state reason to this printer state reasons attribute, associating it with the given severity level. |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID Hides java. Use serialVersionUID from JDK 1.4 for interoperability. | |
| PrinterStateReasons | back to summary |
|---|---|
| public PrinterStateReasons() Construct a new, empty printer state reasons attribute; the underlying hash map has the default initial capacity and load factor. | |
| PrinterStateReasons | back to summary |
|---|---|
| public PrinterStateReasons(int initialCapacity) Construct a new, empty printer state reasons attribute; the underlying hash map has the given initial capacity and the default load factor.
| |
| PrinterStateReasons | back to summary |
|---|---|
| public PrinterStateReasons(int initialCapacity, float loadFactor) Construct a new, empty printer state reasons attribute; the underlying hash map has the given initial capacity and load factor.
| |
| PrinterStateReasons | back to summary |
|---|---|
| public PrinterStateReasons(Map<PrinterStateReason, Severity> map) Construct a new printer state reasons attribute that contains the same
| |
| getCategory | back to summary |
|---|---|
| public final Class Implements javax. Get the printing attribute class which is to be used as the "category" for this printing attribute value.
For class
| |
| getName | back to summary |
|---|---|
| public final String getName() Implements javax. Get the name of the category of which this attribute value is an instance.
For class | |
| printerStateReasonSet | back to summary |
|---|---|
| public Set Obtain an unmodifiable set view of the individual printer state reason
attributes at the given severity level in this
| |
| put | back to summary |
|---|---|
| public Severity put(PrinterStateReason reason, Severity severity) Overrides java. Implements java. Adds the given printer state reason to this printer state reasons attribute, associating it with the given severity level. If this printer state reasons attribute previously contained a mapping for the given printer state reason, the old value is replaced.
| |
| Modifier and Type | Field and Description |
|---|---|
| private Set | |
| private Severity |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public Iterator | iterator()
Implements abstract java. Implements java. Returns an iterator over the elements in this set. |
| public int | size()
Implements abstract java. Implements java. Returns the number of elements in this set (its cardinality). |
| myEntrySet | back to summary |
|---|---|
| private Set<Map. | |
| mySeverity | back to summary |
|---|---|
| private Severity mySeverity | |
| PrinterStateReasonSet | back to summary |
|---|---|
| public PrinterStateReasonSet(Severity severity, Set<Map. | |
| iterator | back to summary |
|---|---|
| public Iterator Implements abstract java. Implements java. Doc from java. Returns an iterator over the elements in this set. The elements are returned in no particular order (unless this set is an instance of some class that provides a guarantee).
| |
| size | back to summary |
|---|---|
| public int size() Implements abstract java. Implements java. Doc from java. Returns the number of elements in this set (its cardinality). If this
set contains more than
| |
| Modifier and Type | Field and Description |
|---|---|
| private Map. | |
| private Iterator | |
| private Severity |
| Access | Constructor and Description |
|---|---|
| public | PrinterStateReasonSetIterator(Severity severity, Iterator<Map.
|
| Modifier and Type | Method and Description |
|---|---|
| private void | |
| public boolean | |
| public PrinterStateReason | |
| public void | remove()
Overrides default java. Removes from the underlying collection the last element returned by this iterator (optional operation). |
| myEntry | back to summary |
|---|---|
| private Map. | |
| myIterator | back to summary |
|---|---|
| private Iterator<Map. | |
| mySeverity | back to summary |
|---|---|
| private Severity mySeverity | |
| PrinterStateReasonSetIterator | back to summary |
|---|---|
| public PrinterStateReasonSetIterator(Severity severity, Iterator<Map. | |
| goToNext | back to summary |
|---|---|
| private void goToNext() | |
| hasNext | back to summary |
|---|---|
| public boolean hasNext() Implements java. Doc from java. Returns
| |
| next | back to summary |
|---|---|
| public PrinterStateReason next() Implements java. Doc from java. Returns the next element in the iteration.
| |
| remove | back to summary |
|---|---|
| public void remove() Overrides default java. Doc from java. Removes from the underlying collection the last element returned
by this iterator (optional operation). This method can be called
only once per call to The behavior of an iterator is unspecified if the underlying collection is modified while the iteration is in progress in any way other than by calling this method, unless an overriding class has specified a concurrent modification policy.
The behavior of an iterator is unspecified if this method is called
after a call to the
| |