public interface Value extends Mirror
次に、値にアクセスする例をいくつか示します。
ObjectReference.getValue(Field)
- フィールドの値 StackFrame.getValue(LocalVariable)
- 変数の値 VirtualMachine.mirrorOf(double)
- ターゲット VM 内で JDI クライアントによって作成される ModificationWatchpointEvent.valueToBe()
- イベントで返される
次の表は、ターゲット VM 内の各値をミラーする際に使用される Value のサブインタフェースを示したものです。
PrimitiveValue のサブインタフェース |
|||
---|---|---|---|
値の種類 | 例 - ターゲット内での表現 |
次のインタフェースとして ミラー化される |
値Value.type() の Type |
boolean | true |
BooleanValue |
BooleanType |
byte | (byte)4 |
ByteValue |
ByteType |
char | 'a' |
CharValue |
CharType |
double | 3.1415926 |
DoubleValue |
DoubleType |
float | 2.5f |
FloatValue |
FloatType |
int | 22 |
IntegerValue |
IntegerType |
long | 1024L |
LongValue |
LongType |
short | (short)12 |
ShortValue |
ShortType |
void | |
VoidValue |
VoidType |
ObjectReference のサブインタフェース |
|||
値の種類 | 例 - ターゲット内での表現 |
次のインタフェースとして ミラー化される |
値Value.type() の Type |
クラスのインスタンス | this |
ObjectReference |
ClassType |
配列 | new int[5] |
ArrayReference |
ArrayType |
文字列 | "hello" |
StringReference |
ClassType |
スレッド | Thread.currentThread() |
ThreadReference |
ClassType |
スレッドグループ | Thread.currentThread() |
ThreadGroupReference |
ClassType |
java.lang.Class インスタンス |
this.getClass() |
ClassObjectReference |
ClassType |
クラスローダー | this.getClass() |
ClassLoaderReference |
ClassType |
その他 | |||
値の種類 | 例 - ターゲット内での表現 | 次のようにミラー化される | 値の Type
|
null | null |
null |
n/a |
修飾子と型 | メソッドと説明 |
---|---|
Type |
type()
この値の実行時の型を返します。
|
toString, virtualMachine
Copyright © 1999, 2013, Oracle and/or its affiliates. All rights reserved.