0N/A/*
2362N/A * Copyright (c) 1998, 2006, Oracle and/or its affiliates. All rights reserved.
0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
0N/A *
0N/A * This code is free software; you can redistribute it and/or modify it
0N/A * under the terms of the GNU General Public License version 2 only, as
2362N/A * published by the Free Software Foundation. Oracle designates this
0N/A * particular file as subject to the "Classpath" exception as provided
2362N/A * by Oracle in the LICENSE file that accompanied this code.
0N/A *
0N/A * This code is distributed in the hope that it will be useful, but WITHOUT
0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
0N/A * version 2 for more details (a copy is included in the LICENSE file that
0N/A * accompanied this code).
0N/A *
0N/A * You should have received a copy of the GNU General Public License version
0N/A * 2 along with this work; if not, write to the Free Software Foundation,
0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
0N/A *
2362N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
2362N/A * or visit www.oracle.com if you need additional information or have any
2362N/A * questions.
0N/A */
0N/A
0N/Apackage com.sun.jdi;
0N/A
0N/A/**
0N/A * The mirror for a value in the target VM.
0N/A * This interface is the root of a
0N/A * value hierarchy encompassing primitive values and object values.
0N/A * <P>
0N/A * Some examples of where values may be accessed:
0N/A * <BLOCKQUOTE><TABLE SUMMARY="layout">
0N/A * <TR>
0N/A * <TD>{@link ObjectReference#getValue(com.sun.jdi.Field)
0N/A * ObjectReference.getValue(Field)}
0N/A * <TD>- value of a field
0N/A * <TR>
0N/A * <TD>{@link StackFrame#getValue(com.sun.jdi.LocalVariable)
0N/A * StackFrame.getValue(LocalVariable)}
0N/A * <TD>- value of a variable
0N/A * <TR>
0N/A * <TD>{@link VirtualMachine#mirrorOf(double)
0N/A * VirtualMachine.mirrorOf(double)}
0N/A * <TD>- created in the target VM by the JDI client
0N/A * <TR>
0N/A * <TD>{@link com.sun.jdi.event.ModificationWatchpointEvent#valueToBe()
0N/A * ModificationWatchpointEvent.valueToBe()}
0N/A * <TD>- returned with an event
0N/A * </TABLE></BLOCKQUOTE>
0N/A * <P>
0N/A * The following table illustrates which subinterfaces of Value
0N/A * are used to mirror values in the target VM --
0N/A * <TABLE BORDER=1 SUMMARY="Maps each kind of value to a mirrored
0N/A * instance of a subinterface of Value">
0N/A * <TR BGCOLOR="#EEEEFF">
0N/A * <TH id="primval" colspan=4>Subinterfaces of {@link PrimitiveValue}</TH>
0N/A * <TR BGCOLOR="#EEEEFF">
0N/A * <TH id="kind" align="left">Kind of value</TH>
0N/A * <TH id="example" align="left">For example -<br>expression in target</TH>
0N/A * <TH id="mirrored" align="left">Is mirrored as an<br>instance of</TH>
0N/A * <TH id="type" align="left">{@link Type} of value<br>{@link #type() Value.type()}</TH>
0N/A * <TR>
0N/A * <TD headers="primval kind"> a boolean</TD>
0N/A * <TD headers="primval example"> <CODE>true</CODE></TD>
0N/A * <TD headers="primval mirrored"> {@link BooleanValue}</TD>
0N/A * <TD headers="primval type"> {@link BooleanType}</TD>
0N/A * <TR>
0N/A * <TD headers="primval kind"> a byte</TD>
0N/A * <TD headers="primval example"> <CODE>(byte)4</CODE></TD>
0N/A * <TD headers="primval mirrored"> {@link ByteValue}</TD>
0N/A * <TD headers="primval type"> {@link ByteType}</TD>
0N/A * <TR>
0N/A * <TD headers="primval kind"> a char</TD>
0N/A * <TD headers="primval example"> <CODE>'a'</CODE></TD>
0N/A * <TD headers="primval mirrored"> {@link CharValue}</TD>
0N/A * <TD headers="primval type"> {@link CharType}</TD>
0N/A * <TR>
0N/A * <TD headers="primval kind"> a double</TD>
0N/A * <TD headers="primval example"> <CODE>3.1415926</CODE></TD>
0N/A * <TD headers="primval mirrored"> {@link DoubleValue}</TD>
0N/A * <TD headers="primval type"> {@link DoubleType}</TD>
0N/A * <TR>
0N/A * <TD headers="primval kind"> a float</TD>
0N/A * <TD headers="primval example"> <CODE>2.5f</CODE></TD>
0N/A * <TD headers="primval mirrored"> {@link FloatValue}</TD>
0N/A * <TD headers="primval type"> {@link FloatType}</TD>
0N/A * <TR>
0N/A * <TD headers="primval kind"> an int</TD>
0N/A * <TD headers="primval example"> <CODE>22</CODE></TD>
0N/A * <TD headers="primval mirrored"> {@link IntegerValue}</TD>
0N/A * <TD headers="primval type"> {@link IntegerType}</TD>
0N/A * <TR>
0N/A * <TD headers="primval kind"> a long</TD>
0N/A * <TD headers="primval example"> <CODE>1024L</CODE></TD>
0N/A * <TD headers="primval mirrored"> {@link LongValue}</TD>
0N/A * <TD headers="primval type"> {@link LongType}</TD>
0N/A * <TR>
0N/A * <TD headers="primval kind"> a short</TD>
0N/A * <TD headers="primval example"> <CODE>(short)12</CODE></TD>
0N/A * <TD headers="primval mirrored"> {@link ShortValue}</TD>
0N/A * <TD headers="primval type"> {@link ShortType}</TD>
0N/A * <TR>
0N/A * <TD headers="primval kind"> a void</TD>
0N/A * <TD headers="primval example"> <CODE>&nbsp;</CODE></TD>
0N/A * <TD headers="primval mirrored"> {@link VoidValue}</TD>
0N/A * <TD headers="primval type"> {@link VoidType}</TD>
0N/A * <TR BGCOLOR="#EEEEFF">
0N/A * <TH id="objref" colspan=4>Subinterfaces of {@link ObjectReference}</TH>
0N/A * <TR BGCOLOR="#EEEEFF">
0N/A * <TH id="kind2" align="left">Kind of value</TH>
0N/A * <TH id="example2" align="left">For example -<br>expression in target</TH>
0N/A * <TH id="mirrored2" align="left">Is mirrored as an<br>instance of</TH>
0N/A * <TH id="type2" align="left">{@link Type} of value<br>{@link #type() Value.type()}</TH>
0N/A * <TR>
0N/A * <TD headers="objref kind2"> a class instance</TD>
0N/A * <TD headers="objref example2"> <CODE>this</CODE></TD>
0N/A * <TD headers="objref mirrored2"> {@link ObjectReference}</TD>
0N/A * <TD headers="objref type2"> {@link ClassType}</TD>
0N/A * <TR>
0N/A * <TD headers="objref kind2"> an array</TD>
0N/A * <TD headers="objref example2"> <CODE>new int[5]</CODE></TD>
0N/A * <TD headers="objref mirrored2"> {@link ArrayReference}</TD>
0N/A * <TD headers="objref type2"> {@link ArrayType}</TD>
0N/A * <TR>
0N/A * <TD headers="objref kind2"> a string</TD>
0N/A * <TD headers="objref example2"> <CODE>"hello"</CODE></TD>
0N/A * <TD headers="objref mirrored2"> {@link StringReference}</TD>
0N/A * <TD headers="objref type2"> {@link ClassType}</TD>
0N/A * <TR>
0N/A * <TD headers="objref kind2"> a thread</TD>
0N/A * <TD headers="objref example2"> <CODE>Thread.currentThread()</CODE></TD>
0N/A * <TD headers="objref mirrored2"> {@link ThreadReference}</TD>
0N/A * <TD headers="objref type2"> {@link ClassType}</TD>
0N/A * <TR>
0N/A * <TD headers="objref kind2"> a thread group</TD>
0N/A * <TD headers="objref example2"> <CODE>Thread.currentThread()<br>&nbsp;&nbsp;.getThreadGroup()</CODE></TD>
0N/A * <TD headers="objref mirrored2"> {@link ThreadGroupReference}</TD>
0N/A * <TD headers="objref type2"> {@link ClassType}</TD>
0N/A * <TR>
0N/A * <TD headers="objref kind2"> a <CODE>java.lang.Class</CODE><br>instance</TD>
0N/A * <TD headers="objref example2"> <CODE>this.getClass()</CODE></TD>
0N/A * <TD headers="objref mirrored2"> {@link ClassObjectReference}</TD>
0N/A * <TD headers="objref type2"> {@link ClassType}</TD>
0N/A * <TR>
0N/A * <TD headers="objref kind2"> a class loader</TD>
0N/A * <TD headers="objref example2"> <CODE>this.getClass()<br>&nbsp;&nbsp;.getClassLoader() </CODE></TD>
0N/A * <TD headers="objref mirrored2"> {@link ClassLoaderReference}</TD>
0N/A * <TD headers="objref type2"> {@link ClassType}</TD>
0N/A * <TR BGCOLOR="#EEEEFF">
0N/A * <TH id="other" colspan=4>Other</TH>
0N/A * <TR BGCOLOR="#EEEEFF">
0N/A * <TH id="kind3" align="left">Kind of value</TD>
0N/A * <TH id="example3" align="left">For example -<br>expression in target</TD>
0N/A * <TH id="mirrored3" align="left">Is mirrored as</TD>
0N/A * <TH id="type3" align="left">{@link Type} of value</TD>
0N/A * <TR>
0N/A * <TD headers="other kind3"> null</TD>
0N/A * <TD headers="other example3"> <CODE>null</CODE></TD>
0N/A * <TD headers="other mirrored3"> <CODE>null</CODE></TD>
0N/A * <TD headers="other type3"> n/a</TD>
0N/A * </TABLE>
0N/A *
0N/A * @author Robert Field
0N/A * @author Gordon Hirsch
0N/A * @author James McIlree
0N/A * @since 1.3
0N/A */
0N/A
0N/Apublic interface Value extends Mirror
0N/A{
0N/A /**
0N/A * Returns the run-time type of this value.
0N/A *
0N/A * @see Type
0N/A * @return a {@link Type} which mirrors the value's type in the
0N/A * target VM.
0N/A */
0N/A Type type();
0N/A}