- すべての実装されたインタフェース:
Serializable
,Cloneable
,Map<PrinterStateReason,
,Severity> Attribute
,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属性の名前を示します。
- 関連項目:
-
ネストされたクラスのサマリー
クラス java.util.AbstractMapで宣言されたネストされたクラス/インタフェース
AbstractMap.SimpleEntry<K,
V>, AbstractMap.SimpleImmutableEntry<K, V> -
コンストラクタのサマリー
コンストラクタ説明空のプリンタ状態理由属性を新しく構築します。基本となるハッシュ・マップは既定の初期容量と負荷係数を持ちます。PrinterStateReasons
(int initialCapacity) 新しい空のプリンタ状態理由属性を作成します。基本となるハッシュ・マップには、指定された初期容量とデフォルトの負荷係数があります。PrinterStateReasons
(int initialCapacity, float loadFactor) 空のプリンタ状態理由属性を新しく構築します。基本となるハッシュ・マップは指定された初期容量と負荷係数を持ちます。指定されたマップと同じPrinterStateReason
からSeverity
へのマッピングを持つプリンタ状態理由属性を新しく構築します。 -
メソッドのサマリー
修飾子と型メソッド説明この印刷属性値の「カテゴリ」として使用される印刷属性クラスを返します。final String
getName()
属性値がインスタンスとなるカテゴリの名前を返します。printerStateReasonSet
(Severity severity) このPrinterStateReasons
属性で、指定された重大度の個々のプリンタ状態理由属性の変更不可能なセット・ビューを取得します。put
(PrinterStateReason reason, Severity severity) 指定されたプリンタ状態理由をこのプリンタ状態理由属性に追加し、同時に指定された重要度レベルに関連付けます。クラス java.util.HashMapで宣言されたメソッド
clear, clone, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, get, isEmpty, keySet, merge, newHashMap, putAll, remove, size, values
クラス java.util.AbstractMapで宣言されたメソッド
equals, hashCode, toString
インタフェース java.util.Mapで宣言されたメソッド
equals, forEach, getOrDefault, hashCode, putIfAbsent, remove, replace, replace, replaceAll
-
コンストラクタの詳細
-
PrinterStateReasons
public PrinterStateReasons()空のプリンタ状態理由属性を新しく構築します。基本となるハッシュ・マップは既定の初期容量と負荷係数を持ちます。 -
PrinterStateReasons
public PrinterStateReasons(int initialCapacity) 新しい空のプリンタ状態理由属性を作成します。基本となるハッシュ・マップには、指定された初期容量とデフォルトの負荷係数があります。- パラメータ:
initialCapacity
- 初期容量- 例外:
IllegalArgumentException
- 初期容量が負の場合
-
PrinterStateReasons
public PrinterStateReasons(int initialCapacity, float loadFactor) 空のプリンタ状態理由属性を新しく構築します。基本となるハッシュ・マップは指定された初期容量と負荷係数を持ちます。- パラメータ:
initialCapacity
- 初期容量loadFactor
- 負荷率- 例外:
IllegalArgumentException
- 初期容量が負の場合
-
PrinterStateReasons
public PrinterStateReasons(Map<PrinterStateReason, Severity> map) 指定されたマップと同じPrinterStateReason
からSeverity
へのマッピングを持つプリンタ状態理由属性を新しく構築します。 基本となるハッシュ・マップの初期容量と負荷係数はスーパー・クラスのコンストラクタHashMap(Map)
で指定されます。- パラメータ:
map
- マップをコピー- 例外:
NullPointerException
-map
がnull
の場合、またはmap
の任意のキーまたは値がnull
の場合ClassCastException
-map
のいずれかのキーがPrinterStateReason
クラスのインスタンスでない場合、またはmap
の値がSeverity
クラスのインスタンスでない場合
-
-
メソッドの詳細
-
put
public Severity put(PrinterStateReason reason, Severity severity) 指定されたプリンタ状態理由をこのプリンタ状態理由属性に追加し、同時に指定された重要度レベルに関連付けます。 このプリンタ状態理由属性に、指定されたプリンタ状態理由のマッピングが登録済の場合、その値が変更されます。- 定義:
- インタフェース
Map<PrinterStateReason,
内のSeverity> put
- オーバーライド:
- クラス
HashMap<PrinterStateReason,
のSeverity> put
- パラメータ:
reason
- プリンタ状態の理由。 これは、PrinterStateReason
クラスのインスタンスである必要がありますseverity
- プリンタの状態理由の重大度。 これは、Severity
クラスのインスタンスである必要があります- 戻り値:
- 指定されたプリンタ状態理由に関連する以前の重大度、または指定されたプリンタ状態理由が存在しない場合は
null
- 例外:
NullPointerException
-reason
がnull
またはseverity
がnull
の場合ClassCastException
-reason
がPrinterStateReason
クラスのインスタンスでない場合、またはseverity
がSeverity
クラスのインスタンスでない場合- 導入されたバージョン:
- 1.5
-
getCategory
この印刷属性値の「カテゴリ」として使用される印刷属性クラスを返します。クラス
PrinterStateReasons
の場合、カテゴリはクラスPrinterStateReasons
自体です。- 定義:
getCategory
、インタフェースAttribute
- 戻り値:
- 印刷属性クラス(category)、クラス
java.lang.Class
のインスタンス
-
getName
public final String getName()属性値がインスタンスとなるカテゴリの名前を返します。クラス
PrinterStateReasons
の場合、カテゴリ名は"printer-state-reasons"
です。 -
printerStateReasonSet
public Set<PrinterStateReason> printerStateReasonSet(Severity severity) このPrinterStateReasons
属性で、指定された重大度の個々のプリンタ状態理由属性の変更不可能なセット・ビューを取得します。 セット・ビューの各要素はPrinterStateReason
オブジェクトです。 セット・ビューに含まれる要素は、指定された重要度の値にマッピングされたPrinterStateReason
オブジェクトのみです。 セット・ビューはこのPrinterStateReasons
属性によってサポートされているため、このPrinterStateReasons
属性への変更はセット・ビューに反映されます。 セット・ビューは要素の追加または削除をサポートしません。 セット・ビューのイテレータは要素の削除をサポートしません。- パラメータ:
severity
- 重大度- 戻り値:
- 指定された
Severity
レベルで個々のPrinterStateReason
属性のビューを設定 - 例外:
NullPointerException
-severity
がnull
の場合
-