/* * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Oracle designates this * particular file as subject to the "Classpath" exception as provided * by Oracle in the LICENSE file that accompanied this code. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * version 2 for more details (a copy is included in the LICENSE file that * accompanied this code). * * You should have received a copy of the GNU General Public License version * 2 along with this work; if not, write to the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA * or visit www.oracle.com if you need additional information or have any * questions. */ package com.sun.jdi; /** * The mirror for a value in the target VM. * This interface is the root of a * value hierarchy encompassing primitive values and object values. *
* Some examples of where values may be accessed: *
**
* {@link ObjectReference#getValue(com.sun.jdi.Field) * ObjectReference.getValue(Field)} * - value of a field * * {@link StackFrame#getValue(com.sun.jdi.LocalVariable) * StackFrame.getValue(LocalVariable)} * - value of a variable * * {@link VirtualMachine#mirrorOf(double) * VirtualMachine.mirrorOf(double)} * - created in the target VM by the JDI client * * {@link com.sun.jdi.event.ModificationWatchpointEvent#valueToBe() * ModificationWatchpointEvent.valueToBe()} * - returned with an event *
* The following table illustrates which subinterfaces of Value * are used to mirror values in the target VM -- *
Subinterfaces of {@link PrimitiveValue} | *|||
---|---|---|---|
Kind of value | *For example - expression in target |
* Is mirrored as an instance of |
* {@link Type} of value {@link #type() Value.type()} |
*
a boolean | * true |
* {@link BooleanValue} | *{@link BooleanType} | *
a byte | * (byte)4 |
* {@link ByteValue} | *{@link ByteType} | *
a char | * 'a' |
* {@link CharValue} | *{@link CharType} | *
a double | * 3.1415926 |
* {@link DoubleValue} | *{@link DoubleType} | *
a float | * 2.5f |
* {@link FloatValue} | *{@link FloatType} | *
an int | * 22 |
* {@link IntegerValue} | *{@link IntegerType} | *
a long | * 1024L |
* {@link LongValue} | *{@link LongType} | *
a short | * (short)12 |
* {@link ShortValue} | *{@link ShortType} | *
a void | * |
* {@link VoidValue} | *{@link VoidType} | *
Subinterfaces of {@link ObjectReference} | *|||
Kind of value | *For example - expression in target |
* Is mirrored as an instance of |
* {@link Type} of value {@link #type() Value.type()} |
*
a class instance | * this |
* {@link ObjectReference} | *{@link ClassType} | *
an array | * new int[5] |
* {@link ArrayReference} | *{@link ArrayType} | *
a string | * "hello" |
* {@link StringReference} | *{@link ClassType} | *
a thread | * Thread.currentThread() |
* {@link ThreadReference} | *{@link ClassType} | *
a thread group | * Thread.currentThread() |
* {@link ThreadGroupReference} | *{@link ClassType} | *
a java.lang.Class instance |
* this.getClass() |
* {@link ClassObjectReference} | *{@link ClassType} | *
a class loader | * this.getClass() |
* {@link ClassLoaderReference} | *{@link ClassType} | *
Other | *|||
Kind of value * | For example - expression in target * | Is mirrored as * | {@link Type} of value * |
null | * null |
* null |
* n/a | *