public final class PrinterStateReasons extends HashMap<PrinterStateReason,Severity> implements PrintServiceAttribute
PrinterState属性をよりわかりやすくする情報を列挙値のセットとして提供する印刷属性クラスです。
PrinterStateReasonのインスタンスは印刷ジョブの属性セットでは直接使用されません。PrinterStateReasons属性が使用されます。PrinterStateReasons属性には、印刷サービスのステータスに関連するPrinterStateReasonオブジェクトがまったく含まれない場合もあり、1つ以上含まれる場合もあります。各PrinterStateReasonオブジェクトは、REPORT (重要度低)、WARNING、またはERROR (重要度高)のSeverityレベルにそれぞれ関連付けられます。プリンタは対応する条件がtrueになったときにPrinterStateReasonオブジェクトを印刷サービスのPrinterStateReasons属性に追加し、falseになったときにPrinterStateReasonオブジェクトを削除します。印刷サービス全体のPrinterStateオブジェクトの変更とは無関係にこの処理が行われます。
PrinterStateReasonsクラスはjava.util.HashMapクラスから実装を継承します。マップの各エントリは、Severityオブジェクト(値)にマッピングされたPrinterStateReasonオブジェクト(キー)で構成されます。
一度構築されてしまうと変更されないことが多い通常の印刷属性とは異なり、PrinterStateReasonsクラスは変更可能に設計されています。PrinterStateReasonオブジェクトを既存のPrinterStateReasonsオブジェクトに追加したり、再度削除したりできます。ただし、java.util.HashMapクラスと同じく、PrinterStateReasonsクラスもマルチ・スレッドに対して安全ではありません。PrinterStateReasonsオブジェクトがマルチ・スレッドで使用される場合、確実に操作を同期させてください。たとえばjava.util.Collectionsクラスから取得された同期化マップ・ビューを使用して同期させることができます。
IPP互換性: 各PrinterStateReasonオブジェクトおよび関連付けられたSeverityオブジェクトのtoString()メソッドで返される文字列値をハイフン("-")でつないだものが、IPPキーワード値を示します。getName()によって返されるカテゴリ名はIPP属性の名前を示します。
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>| コンストラクタと説明 |
|---|
PrinterStateReasons()
空のプリンタ状態理由属性を新しく構築します。基本となるハッシュ・マップは既定の初期容量と負荷係数を持ちます。
|
PrinterStateReasons(int initialCapacity)
空のプリンタ状態理由属性を新しく構築します。基本となるハッシュ・マップは指定された初期容量と既定の負荷係数を持ちます。
|
PrinterStateReasons(int initialCapacity, float loadFactor)
空のプリンタ状態理由属性を新しく構築します。基本となるハッシュ・マップは指定された初期容量と負荷係数を持ちます。
|
PrinterStateReasons(Map<PrinterStateReason,Severity> map)
指定されたマップと同じ
PrinterStateReasonからSeverityへのマッピングを持つプリンタ状態理由属性を新しく構築します。 |
| 修飾子と型 | メソッドと説明 |
|---|---|
Class<? extends Attribute> |
getCategory()
この印刷属性値の「カテゴリ」として使用される印刷属性クラスを返します。
|
String |
getName()
属性値がインスタンスとなるカテゴリの名前を返します。
|
Set<PrinterStateReason> |
printerStateReasonSet(Severity severity)
このPrinterStateReasons属性の指定された重要度レベルの各プリンタ状態理由属性から、変更不可能なセット・ビューを返します。
|
Severity |
put(PrinterStateReason reason, Severity severity)
指定されたプリンタ状態理由をこのプリンタ状態理由属性に追加し、同時に指定された重要度レベルに関連付けます。
|
clear, clone, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, forEach, get, getOrDefault, isEmpty, keySet, merge, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, valuesequals, hashCode, toStringpublic PrinterStateReasons()
public PrinterStateReasons(int initialCapacity)
initialCapacity - 初期容量。IllegalArgumentException - 初期容量が0よりも小さい場合。public PrinterStateReasons(int initialCapacity,
float loadFactor)
initialCapacity - 初期容量。loadFactor - 負荷係数。IllegalArgumentException - 初期容量が0よりも小さい場合。public PrinterStateReasons(Map<PrinterStateReason,Severity> map)
PrinterStateReasonからSeverityへのマッピングを持つプリンタ状態理由属性を新しく構築します。基本となるハッシュ・マップの初期容量と負荷係数はスーパー・クラスのコンストラクタHashMap(Map)で指定されます。map - コピー元のマップ。NullPointerException - 非チェック例外。mapがnullの場合、またはmapのいずれかのキーまたは値がnullの場合にスローされる。ClassCastException - (非チェック例外) mapのいずれかのキーがPrinterStateReasonクラスのインスタンスではない場合、またはmapのいずれかの値がSeverityクラスのインスタンスではない場合にスローされる。public Severity put(PrinterStateReason reason, Severity severity)
put、インタフェース: Map<PrinterStateReason,Severity>put、クラス: HashMap<PrinterStateReason,Severity>reason - プリンタ状態理由。これは、PrinterStateReasonクラスのインスタンスである必要があります。severity - プリンタ状態理由の重要度。これは、Severityクラスのインスタンスである必要があります。NullPointerException - 非チェック例外。reasonがnullの場合、またはseverityがnullの場合にスローされる。ClassCastException - (非チェック例外) reasonがPrinterStateReasonクラスのインスタンスではない場合、またはseverityがSeverityクラスのインスタンスではない場合にスローされる。public final Class<? extends Attribute> getCategory()
PrinterStateReasonsクラスの場合、カテゴリはPrinterStateReasonsクラス自身です。
getCategory、インタフェース: Attributejava.lang.Classクラスのインスタンス。public final String getName()
PrinterStateReasonsクラスの場合、カテゴリ名は"printer-state-reasons"です。
public Set<PrinterStateReason> printerStateReasonSet(Severity severity)
PrinterStateReasonオブジェクトです。セット・ビューに含まれる要素は、指定された重要度の値にマッピングされたPrinterStateReasonオブジェクトのみです。セット・ビューはこのPrinterStateReasons属性に連動しており、このPrinterStateReasons属性に対する変更がセット・ビューに反映されています。セット・ビューは要素の追加または削除をサポートしません。セット・ビューのイテレータは要素の削除をサポートしません。severity - 重要度レベル。Severityレベルの各PrinterStateReason属性のセット・ビュー。NullPointerException - 非チェック例外。severityがnullの場合にスローされる。 バグまたは機能を送信
詳細なAPIリファレンスおよび開発者ドキュメントについては、Java SEのドキュメントを参照してください。そのドキュメントには、概念的な概要、用語の定義、回避方法、有効なコード例などの、開発者を対象にしたより詳細な説明が含まれています。
Copyright© 1993, 2014, Oracle and/or its affiliates. All rights reserved.