モジュール java.desktop

クラスPrinterStateReasons

java.lang.Object
すべての実装されたインタフェース:
Serializable, Cloneable, Map<PrinterStateReason,Severity>, Attribute, PrintServiceAttribute

public final class PrinterStateReasons extends HashMap<PrinterStateReason,Severity> implements PrintServiceAttribute
クラスPrinterStateReasonsは、プリンタの現在の状態(プリンタのPrinterState属性の値を増強する情報)に関する追加情報を提供する、一連の列挙値である印刷属性クラスです。

PrinterStateReasonのインスタンスは印刷ジョブの属性セットでは直接使用されません。 かわりに、印刷サービスの属性セットにPrinterStateReasons属性が表示されます。 PrinterStateReasons属性には、印刷サービスのステータスに関連する0、1または複数のPrinterStateReasonオブジェクトが含まれ、各PrinterStateReasonオブジェクトは、REPORT (最も厳しい)、WARNINGまたはERROR (最も厳しい)のSeverityレベルに関連付けられます。 プリンタは、対応する条件がプリンタのtrueになるとPrinterStateReasonオブジェクトを印刷サービスのPrinterStateReasons属性に追加し、印刷サービスの全体的なPrinterStateも変更されているかどうかに関係なく、対応する条件がfalseになると、プリンタはPrinterStateReasonオブジェクトを再度削除します。

PrinterStateReasonsクラスはjava.util.HashMapクラスから実装を継承します。 マップの各エントリは、Severityオブジェクト(値)にマッピングされたPrinterStateReasonオブジェクト(キー)で構成されます。

一度構築された不変であるほとんどの印刷属性とは異なり、クラスPrinterStateReasonsは変更可能に設計されています。PrinterStateReasonオブジェクトを既存のPrinterStateReasonsオブジェクトに追加して、それらを再度削除することができます。 ただし、クラスjava.util.HashMapと同様に、クラスPrinterStateReasonsは複数のスレッド・セーフではありません。 PrinterStateReasonsオブジェクトが複数のスレッドによって使用される場合は、その操作(たとえば、クラスjava.util.Collectionsから取得した同期マップ・ビューを使用して)を必ず同期させてください。

IPP互換性:PrinterStateReasonオブジェクトおよび関連付けられたSeverityオブジェクトのtoString()メソッドで返される文字列値をハイフン("-")でつないだものが、IPPキーワード値を示します。 getName()によって返されるカテゴリ名はIPP属性の名前を示します。

関連項目: