/* * Copyright (c) 1998, 2017, 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: *

* * * * *
layout
{@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 -- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
Maps each kind of value to a mirrored * instance of a subinterface of Value
Subinterfaces of {@link PrimitiveValue}
Kind of valueFor example -
expression in target
Is mirrored as an
instance of
{@link Type} of value
{@link #type() Value.type()}
a boolean {@code true} {@link BooleanValue} {@link BooleanType}
a byte {@code (byte)4} {@link ByteValue} {@link ByteType}
a char {@code 'a'} {@link CharValue} {@link CharType}
a double {@code 3.1415926} {@link DoubleValue} {@link DoubleType}
a float {@code 2.5f} {@link FloatValue} {@link FloatType}
an int {@code 22} {@link IntegerValue} {@link IntegerType}
a long {@code 1024L} {@link LongValue} {@link LongType}
a short {@code (short)12} {@link ShortValue} {@link ShortType}
a void {@link VoidValue} {@link VoidType}
Subinterfaces of {@link ObjectReference}
Kind of valueFor example -
expression in target
Is mirrored as an
instance of
{@link Type} of value
{@link #type() Value.type()}
a class instance {@code this} {@link ObjectReference} {@link ClassType}
an array {@code new int[5]} {@link ArrayReference} {@link ArrayType}
a string {@code "hello"} {@link StringReference} {@link ClassType}
a thread {@code Thread.currentThread()} {@link ThreadReference} {@link ClassType}
a thread group {@code Thread.currentThread()}
  {@code .getThreadGroup()}
{@link ThreadGroupReference} {@link ClassType}
a {@code java.lang.Class}
instance
{@code this.getClass()} {@link ClassObjectReference} {@link ClassType}
a class loader {@code this.getClass()}
  {@code .getClassLoader()}
{@link ClassLoaderReference} {@link ClassType}
Other
Kind of valueFor example -
expression in target
Is mirrored as{@link Type} of value
null {@code null} {@code null} n/a
* * @author Robert Field * @author Gordon Hirsch * @author James McIlree * @since 1.3 */ public interface Value extends Mirror { /** * Returns the run-time type of this value. * * @see Type * @return a {@link Type} which mirrors the value's type in the * target VM. */ Type type(); }