javax.print.attribute.standard
Class PrinterStateReasons

java.lang.Object sample code for java.lang.Object definition code for java.lang.Object 
  extended by java.util.AbstractMap sample code for java.util.AbstractMap definition code for java.util.AbstractMap <K,V>
      extended by java.util.HashMap sample code for java.util.HashMap definition code for java.util.HashMap <PrinterStateReason sample code for javax.print.attribute.standard.PrinterStateReason definition code for javax.print.attribute.standard.PrinterStateReason ,Severity sample code for javax.print.attribute.standard.Severity definition code for javax.print.attribute.standard.Severity >
          extended by javax.print.attribute.standard.PrinterStateReasons
All Implemented Interfaces:
Serializable sample code for java.io.Serializable definition code for java.io.Serializable , Cloneable sample code for java.lang.Cloneable definition code for java.lang.Cloneable , Map sample code for java.util.Map definition code for java.util.Map <PrinterStateReason sample code for javax.print.attribute.standard.PrinterStateReason definition code for javax.print.attribute.standard.PrinterStateReason ,Severity sample code for javax.print.attribute.standard.Severity definition code for javax.print.attribute.standard.Severity >, Attribute sample code for javax.print.attribute.Attribute definition code for javax.print.attribute.Attribute , PrintServiceAttribute sample code for javax.print.attribute.PrintServiceAttribute definition code for javax.print.attribute.PrintServiceAttribute

public final class PrinterStateReasons
extends HashMap sample code for java.util.HashMap definition code for java.util.HashMap <PrinterStateReason sample code for javax.print.attribute.standard.PrinterStateReason definition code for javax.print.attribute.standard.PrinterStateReason ,Severity sample code for javax.print.attribute.standard.Severity definition code for javax.print.attribute.standard.Severity >
implements PrintServiceAttribute sample code for javax.print.attribute.PrintServiceAttribute definition code for javax.print.attribute.PrintServiceAttribute

Class 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 sample code for javax.print.attribute.standard.PrinterState definition code for javax.print.attribute.standard.PrinterState attribute.

Instances of PrinterStateReason sample code for javax.print.attribute.standard.PrinterStateReason definition code for javax.print.attribute.standard.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 sample code for javax.print.attribute.standard.PrinterStateReason definition code for javax.print.attribute.standard.PrinterStateReason objects which pertain to the Print Service's status, and each PrinterStateReason sample code for javax.print.attribute.standard.PrinterStateReason definition code for javax.print.attribute.standard.PrinterStateReason object is associated with a Severity sample code for javax.print.attribute.standard.Severity definition code for javax.print.attribute.standard.Severity level of REPORT (least severe), WARNING, or ERROR (most severe). The printer adds a PrinterStateReason sample code for javax.print.attribute.standard.PrinterStateReason definition code for javax.print.attribute.standard.PrinterStateReason object to the Print Service's PrinterStateReasons attribute when the corresponding condition becomes true of the printer, and the printer removes the PrinterStateReason sample code for javax.print.attribute.standard.PrinterStateReason definition code for javax.print.attribute.standard.PrinterStateReason object again when the corresponding condition becomes false, regardless of whether the Print Service's overall PrinterState sample code for javax.print.attribute.standard.PrinterState definition code for javax.print.attribute.standard.PrinterState also changed.

Class PrinterStateReasons inherits its implementation from class java.util.HashMap sample code for java.util.HashMap definition code for java.util.HashMap . Each entry in the map consists of a PrinterStateReason sample code for javax.print.attribute.standard.PrinterStateReason definition code for javax.print.attribute.standard.PrinterStateReason object (key) mapping to a Severity sample code for javax.print.attribute.standard.Severity definition code for javax.print.attribute.standard.Severity object (value):

Unlike most printing attributes which are immutable once constructed, class PrinterStateReasons is designed to be mutable; you can add PrinterStateReason sample code for javax.print.attribute.standard.PrinterStateReason definition code for javax.print.attribute.standard.PrinterStateReason objects to an existing PrinterStateReasons object and remove them again. However, like class java.util.HashMap sample code for java.util.HashMap definition code for java.util.HashMap , class PrinterStateReasons is bot 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.util.Collections sample code for java.util.Collections definition code for java.util.Collections ).

IPP Compatibility: The string values returned by each individual PrinterStateReason sample code for javax.print.attribute.standard.PrinterStateReason definition code for javax.print.attribute.standard.PrinterStateReason object's and the associated Severity sample code for javax.print.attribute.standard.Severity definition code for javax.print.attribute.standard.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.

See Also:
Serialized Form

Constructor Summary
PrinterStateReasons sample code for javax.print.attribute.standard.PrinterStateReasons.PrinterStateReasons() definition code for javax.print.attribute.standard.PrinterStateReasons.PrinterStateReasons() ()
          Construct a new, empty printer state reasons attribute; the underlying hash map has the default initial capacity and load factor.
PrinterStateReasons sample code for javax.print.attribute.standard.PrinterStateReasons.PrinterStateReasons(int) definition code for javax.print.attribute.standard.PrinterStateReasons.PrinterStateReasons(int) (int initialCapacity)
          super a new, empty printer state reasons attribute; the underlying hash map has the given initial capacity and the default load factor.
PrinterStateReasons sample code for javax.print.attribute.standard.PrinterStateReasons.PrinterStateReasons(int, float) definition code for javax.print.attribute.standard.PrinterStateReasons.PrinterStateReasons(int, float) (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 sample code for javax.print.attribute.standard.PrinterStateReasons.PrinterStateReasons(java.util.Map) definition code for javax.print.attribute.standard.PrinterStateReasons.PrinterStateReasons(java.util.Map) (Map sample code for java.util.Map definition code for java.util.Map <PrinterStateReason sample code for javax.print.attribute.standard.PrinterStateReason definition code for javax.print.attribute.standard.PrinterStateReason ,Severity sample code for javax.print.attribute.standard.Severity definition code for javax.print.attribute.standard.Severity > map)
          Construct a new printer state reasons attribute that contains the same PrinterStateReason sample code for javax.print.attribute.standard.PrinterStateReason definition code for javax.print.attribute.standard.PrinterStateReason -to-Severity sample code for javax.print.attribute.standard.Severity definition code for javax.print.attribute.standard.Severity mappings as the given map.
 
Method Summary
 Class sample code for java.lang.Class definition code for java.lang.Class <? extends Attribute sample code for javax.print.attribute.Attribute definition code for javax.print.attribute.Attribute > getCategory sample code for javax.print.attribute.standard.PrinterStateReasons.getCategory() definition code for javax.print.attribute.standard.PrinterStateReasons.getCategory() ()
          Get the printing attribute class which is to be used as the "category" for this printing attribute value.
 String sample code for java.lang.String definition code for java.lang.String getName sample code for javax.print.attribute.standard.PrinterStateReasons.getName() definition code for javax.print.attribute.standard.PrinterStateReasons.getName() ()
          Get the name of the category of which this attribute value is an instance.
 Set sample code for java.util.Set definition code for java.util.Set <PrinterStateReason sample code for javax.print.attribute.standard.PrinterStateReason definition code for javax.print.attribute.standard.PrinterStateReason > printerStateReasonSet sample code for javax.print.attribute.standard.PrinterStateReasons.printerStateReasonSet(javax.print.attribute.standard.Severity) definition code for javax.print.attribute.standard.PrinterStateReasons.printerStateReasonSet(javax.print.attribute.standard.Severity) (Severity sample code for javax.print.attribute.standard.Severity definition code for javax.print.attribute.standard.Severity  severity)
          Obtain an unmodifiable set view of the individual printer state reason attributes at the given severity level in this PrinterStateReasons attribute.
 Severity sample code for javax.print.attribute.standard.Severity definition code for javax.print.attribute.standard.Severity put sample code for javax.print.attribute.standard.PrinterStateReasons.put(javax.print.attribute.standard.PrinterStateReason, javax.print.attribute.standard.Severity) definition code for javax.print.attribute.standard.PrinterStateReasons.put(javax.print.attribute.standard.PrinterStateReason, javax.print.attribute.standard.Severity) (PrinterStateReason sample code for javax.print.attribute.standard.PrinterStateReason definition code for javax.print.attribute.standard.PrinterStateReason  reason, Severity sample code for javax.print.attribute.standard.Severity definition code for javax.print.attribute.standard.Severity  severity)
          Adds the given printer state reason to this printer state reasons attribute, associating it with the given severity level.
 
Methods inherited from class java.util.HashMap sample code for java.util.HashMap definition code for java.util.HashMap
clear sample code for java.util.HashMap.clear() definition code for java.util.HashMap.clear() , clone sample code for java.util.HashMap.clone() definition code for java.util.HashMap.clone() , containsKey sample code for java.util.HashMap.containsKey(java.lang.Object) definition code for java.util.HashMap.containsKey(java.lang.Object) , containsValue sample code for java.util.HashMap.containsValue(java.lang.Object) definition code for java.util.HashMap.containsValue(java.lang.Object) , entrySet sample code for java.util.HashMap.entrySet() definition code for java.util.HashMap.entrySet() , get sample code for java.util.HashMap.get(java.lang.Object) definition code for java.util.HashMap.get(java.lang.Object) , isEmpty sample code for java.util.HashMap.isEmpty() definition code for java.util.HashMap.isEmpty() , keySet sample code for java.util.HashMap.keySet() definition code for java.util.HashMap.keySet() , putAll sample code for java.util.HashMap.putAll(java.util.Map) definition code for java.util.HashMap.putAll(java.util.Map) , remove sample code for java.util.HashMap.remove(java.lang.Object) definition code for java.util.HashMap.remove(java.lang.Object) , size sample code for java.util.HashMap.size() definition code for java.util.HashMap.size() , values sample code for java.util.HashMap.values() definition code for java.util.HashMap.values()
 
Methods inherited from class java.util.AbstractMap sample code for java.util.AbstractMap definition code for java.util.AbstractMap
equals sample code for java.util.AbstractMap.equals(java.lang.Object) definition code for java.util.AbstractMap.equals(java.lang.Object) , hashCode sample code for java.util.AbstractMap.hashCode() definition code for java.util.AbstractMap.hashCode() , toString sample code for java.util.AbstractMap.toString() definition code for java.util.AbstractMap.toString()
 
Methods inherited from class java.lang.Object sample code for java.lang.Object definition code for java.lang.Object
finalize sample code for java.lang.Object.finalize() definition code for java.lang.Object.finalize() , getClass sample code for java.lang.Object.getClass() definition code for java.lang.Object.getClass() , notify sample code for java.lang.Object.notify() definition code for java.lang.Object.notify() , notifyAll sample code for java.lang.Object.notifyAll() definition code for java.lang.Object.notifyAll() , wait sample code for java.lang.Object.wait() definition code for java.lang.Object.wait() , wait sample code for java.lang.Object.wait(long) definition code for java.lang.Object.wait(long) , wait sample code for java.lang.Object.wait(long, int) definition code for java.lang.Object.wait(long, int)
 
Methods inherited from interface java.util.Map sample code for java.util.Map definition code for java.util.Map
equals sample code for java.util.Map.equals(java.lang.Object) definition code for java.util.Map.equals(java.lang.Object) , hashCode sample code for java.util.Map.hashCode() definition code for java.util.Map.hashCode()
 

Constructor Detail

PrinterStateReasons sample code for javax.print.attribute.standard.PrinterStateReasons() definition code for javax.print.attribute.standard.PrinterStateReasons()

public PrinterStateReasons()
Construct a new, empty printer state reasons attribute; the underlying hash map has the default initial capacity and load factor.


PrinterStateReasons sample code for javax.print.attribute.standard.PrinterStateReasons(int) definition code for javax.print.attribute.standard.PrinterStateReasons(int)

public PrinterStateReasons(int initialCapacity)
super a new, empty printer state reasons attribute; the underlying hash map has the given initial capacity and the default load factor.

Parameters:
initialCapacity - Initial capacity.
Throws:
IllegalArgumentException sample code for java.lang.IllegalArgumentException definition code for java.lang.IllegalArgumentException - if the initial capacity is less than zero.

PrinterStateReasons sample code for javax.print.attribute.standard.PrinterStateReasons(int, float) definition code for javax.print.attribute.standard.PrinterStateReasons(int, float)

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.

Parameters:
initialCapacity - Initial capacity.
loadFactor - Load factor.
Throws:
IllegalArgumentException sample code for java.lang.IllegalArgumentException definition code for java.lang.IllegalArgumentException - if the initial capacity is less than zero.

PrinterStateReasons sample code for javax.print.attribute.standard.PrinterStateReasons(java.util.Map<javax.print.attribute.standard.PrinterStateReason, javax.print.attribute.standard.Severity>) definition code for javax.print.attribute.standard.PrinterStateReasons(java.util.Map<javax.print.attribute.standard.PrinterStateReason, javax.print.attribute.standard.Severity>)

public PrinterStateReasons(Map sample code for java.util.Map definition code for java.util.Map <PrinterStateReason sample code for javax.print.attribute.standard.PrinterStateReason definition code for javax.print.attribute.standard.PrinterStateReason ,Severity sample code for javax.print.attribute.standard.Severity definition code for javax.print.attribute.standard.Severity > map)
Construct a new printer state reasons attribute that contains the same PrinterStateReason sample code for javax.print.attribute.standard.PrinterStateReason definition code for javax.print.attribute.standard.PrinterStateReason -to-Severity sample code for javax.print.attribute.standard.Severity definition code for javax.print.attribute.standard.Severity mappings as the given map. The underlying hash map's initial capacity and load factor are as specified in the superclass constructor HashMap(Map) sample code for java.util.HashMap.HashMap(java.util.Map) definition code for java.util.HashMap.HashMap(java.util.Map) .

Parameters:
map - Map to copy.
Throws:
NullPointerException sample code for java.lang.NullPointerException definition code for java.lang.NullPointerException - (unchecked exception) Thrown if map is null or if any key or value in map is null.
ClassCastException sample code for java.lang.ClassCastException definition code for java.lang.ClassCastException - (unchecked exception) Thrown if any key in map is not an instance of class PrinterStateReason sample code for javax.print.attribute.standard.PrinterStateReason definition code for javax.print.attribute.standard.PrinterStateReason or if any value in map is not an instance of class Severity sample code for javax.print.attribute.standard.Severity definition code for javax.print.attribute.standard.Severity .
Method Detail

put sample code for javax.print.attribute.standard.PrinterStateReasons.put(javax.print.attribute.standard.PrinterStateReason, javax.print.attribute.standard.Severity) definition code for javax.print.attribute.standard.PrinterStateReasons.put(javax.print.attribute.standard.PrinterStateReason, javax.print.attribute.standard.Severity)

public Severity sample code for javax.print.attribute.standard.Severity definition code for javax.print.attribute.standard.Severity  put(PrinterStateReason sample code for javax.print.attribute.standard.PrinterStateReason definition code for javax.print.attribute.standard.PrinterStateReason  reason,
                    Severity sample code for javax.print.attribute.standard.Severity definition code for javax.print.attribute.standard.Severity  severity)
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.

Specified by:
put sample code for java.util.Map.put(K, V) definition code for java.util.Map.put(K, V) in interface Map sample code for java.util.Map definition code for java.util.Map <PrinterStateReason sample code for javax.print.attribute.standard.PrinterStateReason definition code for javax.print.attribute.standard.PrinterStateReason ,Severity sample code for javax.print.attribute.standard.Severity definition code for javax.print.attribute.standard.Severity >
Overrides:
put sample code for java.util.HashMap.put(K, V) definition code for java.util.HashMap.put(K, V) in class HashMap sample code for java.util.HashMap definition code for java.util.HashMap <PrinterStateReason sample code for javax.print.attribute.standard.PrinterStateReason definition code for javax.print.attribute.standard.PrinterStateReason ,Severity sample code for javax.print.attribute.standard.Severity definition code for javax.print.attribute.standard.Severity >
Parameters:
reason - Printer state reason. This must be an instance of class PrinterStateReason sample code for javax.print.attribute.standard.PrinterStateReason definition code for javax.print.attribute.standard.PrinterStateReason .
severity - Severity of the printer state reason. This must be an instance of class Severity sample code for javax.print.attribute.standard.Severity definition code for javax.print.attribute.standard.Severity .
Returns:
Previous severity associated with the given printer state reason, or null if the given printer state reason was not present.
Throws:
NullPointerException sample code for java.lang.NullPointerException definition code for java.lang.NullPointerException - (unchecked exception) Thrown if reason is null or severity is null.
ClassCastException sample code for java.lang.ClassCastException definition code for java.lang.ClassCastException - (unchecked exception) Thrown if reason is not an instance of class PrinterStateReason sample code for javax.print.attribute.standard.PrinterStateReason definition code for javax.print.attribute.standard.PrinterStateReason or if severity is not an instance of class Severity sample code for javax.print.attribute.standard.Severity definition code for javax.print.attribute.standard.Severity .

getCategory sample code for javax.print.attribute.standard.PrinterStateReasons.getCategory() definition code for javax.print.attribute.standard.PrinterStateReasons.getCategory()

public final Class sample code for java.lang.Class definition code for java.lang.Class <? extends Attribute sample code for javax.print.attribute.Attribute definition code for javax.print.attribute.Attribute > getCategory()
Get the printing attribute class which is to be used as the "category" for this printing attribute value.

For class PrinterStateReasons, the category is class PrinterStateReasons itself.

Specified by:
getCategory sample code for javax.print.attribute.Attribute.getCategory() definition code for javax.print.attribute.Attribute.getCategory() in interface Attribute sample code for javax.print.attribute.Attribute definition code for javax.print.attribute.Attribute
Returns:
Printing attribute class (category), an instance of class java.lang.Class sample code for java.lang.Class definition code for java.lang.Class .

getName sample code for javax.print.attribute.standard.PrinterStateReasons.getName() definition code for javax.print.attribute.standard.PrinterStateReasons.getName()

public final String sample code for java.lang.String definition code for java.lang.String  getName()
Get the name of the category of which this attribute value is an instance.

For class PrinterStateReasons, the category name is "printer-state-reasons".

Specified by:
getName sample code for javax.print.attribute.Attribute.getName() definition code for javax.print.attribute.Attribute.getName() in interface Attribute sample code for javax.print.attribute.Attribute definition code for javax.print.attribute.Attribute
Returns:
Attribute category name.

printerStateReasonSet sample code for javax.print.attribute.standard.PrinterStateReasons.printerStateReasonSet(javax.print.attribute.standard.Severity) definition code for javax.print.attribute.standard.PrinterStateReasons.printerStateReasonSet(javax.print.attribute.standard.Severity)

public Set sample code for java.util.Set definition code for java.util.Set <PrinterStateReason sample code for javax.print.attribute.standard.PrinterStateReason definition code for javax.print.attribute.standard.PrinterStateReason > printerStateReasonSet(Severity sample code for javax.print.attribute.standard.Severity definition code for javax.print.attribute.standard.Severity  severity)
Obtain an unmodifiable set view of the individual printer state reason attributes at the given severity level in this PrinterStateReasons attribute. Each element in the set view is a PrinterStateReason sample code for javax.print.attribute.standard.PrinterStateReason definition code for javax.print.attribute.standard.PrinterStateReason object. The only elements in the set view are the PrinterStateReason sample code for javax.print.attribute.standard.PrinterStateReason definition code for javax.print.attribute.standard.PrinterStateReason objects that map to the given severity value. The set view is backed by this PrinterStateReasons attribute, so changes to this PrinterStateReasons attribute are reflected in the set view. The set view does not support element insertion or removal. The set view's iterator does not support element removal.

Parameters:
severity - Severity level.
Returns:
Set view of the individual PrinterStateReason sample code for javax.print.attribute.standard.PrinterStateReason definition code for javax.print.attribute.standard.PrinterStateReason attributes at the given Severity sample code for javax.print.attribute.standard.Severity definition code for javax.print.attribute.standard.Severity level.
Throws:
NullPointerException sample code for java.lang.NullPointerException definition code for java.lang.NullPointerException - (unchecked exception) Thrown if severity is null.