author | clanger |
Fri, 16 Jun 2017 14:09:31 +0200 | |
changeset 45564 | 0149773a140c |
parent 45001 | 9526cc76a8ea |
child 46140 | 3abb2959292f |
permissions | -rw-r--r-- |
2 | 1 |
/* |
45001 | 2 |
* Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved. |
2 | 3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 |
* |
|
5 |
* This code is free software; you can redistribute it and/or modify it |
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
|
5506 | 7 |
* published by the Free Software Foundation. Oracle designates this |
2 | 8 |
* particular file as subject to the "Classpath" exception as provided |
5506 | 9 |
* by Oracle in the LICENSE file that accompanied this code. |
2 | 10 |
* |
11 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
|
12 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
13 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
14 |
* version 2 for more details (a copy is included in the LICENSE file that |
|
15 |
* accompanied this code). |
|
16 |
* |
|
17 |
* You should have received a copy of the GNU General Public License version |
|
18 |
* 2 along with this work; if not, write to the Free Software Foundation, |
|
19 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
|
20 |
* |
|
5506 | 21 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
22 |
* or visit www.oracle.com if you need additional information or have any |
|
23 |
* questions. |
|
2 | 24 |
*/ |
25 |
||
26 |
package com.sun.jdi; |
|
27 |
||
45564 | 28 |
import com.sun.jdi.event.ModificationWatchpointEvent; |
29 |
||
2 | 30 |
/** |
31 |
* The mirror for a value in the target VM. |
|
32 |
* This interface is the root of a |
|
33 |
* value hierarchy encompassing primitive values and object values. |
|
34 |
* <P> |
|
35 |
* Some examples of where values may be accessed: |
|
45001 | 36 |
* <BLOCKQUOTE><TABLE><CAPTION style="display:none">layout</CAPTION> |
2 | 37 |
* <TR> |
45564 | 38 |
* <TD>{@link ObjectReference#getValue(Field) |
2 | 39 |
* ObjectReference.getValue(Field)} |
40 |
* <TD>- value of a field |
|
41 |
* <TR> |
|
45564 | 42 |
* <TD>{@link StackFrame#getValue(LocalVariable) |
2 | 43 |
* StackFrame.getValue(LocalVariable)} |
44 |
* <TD>- value of a variable |
|
45 |
* <TR> |
|
46 |
* <TD>{@link VirtualMachine#mirrorOf(double) |
|
47 |
* VirtualMachine.mirrorOf(double)} |
|
48 |
* <TD>- created in the target VM by the JDI client |
|
49 |
* <TR> |
|
45564 | 50 |
* <TD>{@link ModificationWatchpointEvent#valueToBe() |
2 | 51 |
* ModificationWatchpointEvent.valueToBe()} |
52 |
* <TD>- returned with an event |
|
53 |
* </TABLE></BLOCKQUOTE> |
|
54 |
* <P> |
|
55 |
* The following table illustrates which subinterfaces of Value |
|
56 |
* are used to mirror values in the target VM -- |
|
45001 | 57 |
* <TABLE BORDER="1"> |
58 |
* <CAPTION style="display:none">Maps each kind of value to a mirrored |
|
59 |
* instance of a subinterface of Value</CAPTION> |
|
60 |
* <TR style="background-color:#EEEEFF"> |
|
2 | 61 |
* <TH id="primval" colspan=4>Subinterfaces of {@link PrimitiveValue}</TH> |
45001 | 62 |
* <TR style="background-color:#EEEEFF"> |
63 |
* <TH id="kind" style="text-align:left">Kind of value</TH> |
|
64 |
* <TH id="example" style="text-align:left">For example -<br>expression in target</TH> |
|
65 |
* <TH id="mirrored" style="text-align:left">Is mirrored as an<br>instance of</TH> |
|
66 |
* <TH id="type" style="text-align:left">{@link Type} of value<br>{@link #type() Value.type()}</TH> |
|
2 | 67 |
* <TR> |
68 |
* <TD headers="primval kind"> a boolean</TD> |
|
30037 | 69 |
* <TD headers="primval example"> {@code true}</TD> |
2 | 70 |
* <TD headers="primval mirrored"> {@link BooleanValue}</TD> |
71 |
* <TD headers="primval type"> {@link BooleanType}</TD> |
|
72 |
* <TR> |
|
73 |
* <TD headers="primval kind"> a byte</TD> |
|
30037 | 74 |
* <TD headers="primval example"> {@code (byte)4}</TD> |
2 | 75 |
* <TD headers="primval mirrored"> {@link ByteValue}</TD> |
76 |
* <TD headers="primval type"> {@link ByteType}</TD> |
|
77 |
* <TR> |
|
78 |
* <TD headers="primval kind"> a char</TD> |
|
30037 | 79 |
* <TD headers="primval example"> {@code 'a'}</TD> |
2 | 80 |
* <TD headers="primval mirrored"> {@link CharValue}</TD> |
81 |
* <TD headers="primval type"> {@link CharType}</TD> |
|
82 |
* <TR> |
|
83 |
* <TD headers="primval kind"> a double</TD> |
|
30037 | 84 |
* <TD headers="primval example"> {@code 3.1415926}</TD> |
2 | 85 |
* <TD headers="primval mirrored"> {@link DoubleValue}</TD> |
86 |
* <TD headers="primval type"> {@link DoubleType}</TD> |
|
87 |
* <TR> |
|
88 |
* <TD headers="primval kind"> a float</TD> |
|
30037 | 89 |
* <TD headers="primval example"> {@code 2.5f}</TD> |
2 | 90 |
* <TD headers="primval mirrored"> {@link FloatValue}</TD> |
91 |
* <TD headers="primval type"> {@link FloatType}</TD> |
|
92 |
* <TR> |
|
93 |
* <TD headers="primval kind"> an int</TD> |
|
30037 | 94 |
* <TD headers="primval example"> {@code 22}</TD> |
2 | 95 |
* <TD headers="primval mirrored"> {@link IntegerValue}</TD> |
96 |
* <TD headers="primval type"> {@link IntegerType}</TD> |
|
97 |
* <TR> |
|
98 |
* <TD headers="primval kind"> a long</TD> |
|
30037 | 99 |
* <TD headers="primval example"> {@code 1024L}</TD> |
2 | 100 |
* <TD headers="primval mirrored"> {@link LongValue}</TD> |
101 |
* <TD headers="primval type"> {@link LongType}</TD> |
|
102 |
* <TR> |
|
103 |
* <TD headers="primval kind"> a short</TD> |
|
30037 | 104 |
* <TD headers="primval example"> {@code (short)12}</TD> |
2 | 105 |
* <TD headers="primval mirrored"> {@link ShortValue}</TD> |
106 |
* <TD headers="primval type"> {@link ShortType}</TD> |
|
107 |
* <TR> |
|
108 |
* <TD headers="primval kind"> a void</TD> |
|
30037 | 109 |
* <TD headers="primval example"> </TD> |
2 | 110 |
* <TD headers="primval mirrored"> {@link VoidValue}</TD> |
111 |
* <TD headers="primval type"> {@link VoidType}</TD> |
|
45001 | 112 |
* <TR style="background-color:#EEEEFF"> |
2 | 113 |
* <TH id="objref" colspan=4>Subinterfaces of {@link ObjectReference}</TH> |
45001 | 114 |
* <TR style="background-color:#EEEEFF"> |
115 |
* <TH id="kind2" style="text-align:left">Kind of value</TH> |
|
116 |
* <TH id="example2" style="text-align:left">For example -<br>expression in target</TH> |
|
117 |
* <TH id="mirrored2" style="text-align:left">Is mirrored as an<br>instance of</TH> |
|
118 |
* <TH id="type2" style="text-align:left">{@link Type} of value<br>{@link #type() Value.type()}</TH> |
|
2 | 119 |
* <TR> |
120 |
* <TD headers="objref kind2"> a class instance</TD> |
|
30037 | 121 |
* <TD headers="objref example2"> {@code this}</TD> |
2 | 122 |
* <TD headers="objref mirrored2"> {@link ObjectReference}</TD> |
123 |
* <TD headers="objref type2"> {@link ClassType}</TD> |
|
124 |
* <TR> |
|
125 |
* <TD headers="objref kind2"> an array</TD> |
|
30037 | 126 |
* <TD headers="objref example2"> {@code new int[5]}</TD> |
2 | 127 |
* <TD headers="objref mirrored2"> {@link ArrayReference}</TD> |
128 |
* <TD headers="objref type2"> {@link ArrayType}</TD> |
|
129 |
* <TR> |
|
130 |
* <TD headers="objref kind2"> a string</TD> |
|
30037 | 131 |
* <TD headers="objref example2"> {@code "hello"}</TD> |
2 | 132 |
* <TD headers="objref mirrored2"> {@link StringReference}</TD> |
133 |
* <TD headers="objref type2"> {@link ClassType}</TD> |
|
134 |
* <TR> |
|
135 |
* <TD headers="objref kind2"> a thread</TD> |
|
30037 | 136 |
* <TD headers="objref example2"> {@code Thread.currentThread()}</TD> |
2 | 137 |
* <TD headers="objref mirrored2"> {@link ThreadReference}</TD> |
138 |
* <TD headers="objref type2"> {@link ClassType}</TD> |
|
139 |
* <TR> |
|
140 |
* <TD headers="objref kind2"> a thread group</TD> |
|
30037 | 141 |
* <TD headers="objref example2"> {@code Thread.currentThread()}<br> {@code .getThreadGroup()}</TD> |
2 | 142 |
* <TD headers="objref mirrored2"> {@link ThreadGroupReference}</TD> |
143 |
* <TD headers="objref type2"> {@link ClassType}</TD> |
|
144 |
* <TR> |
|
30037 | 145 |
* <TD headers="objref kind2"> a {@code java.lang.Class}<br>instance</TD> |
146 |
* <TD headers="objref example2"> {@code this.getClass()}</TD> |
|
2 | 147 |
* <TD headers="objref mirrored2"> {@link ClassObjectReference}</TD> |
148 |
* <TD headers="objref type2"> {@link ClassType}</TD> |
|
149 |
* <TR> |
|
150 |
* <TD headers="objref kind2"> a class loader</TD> |
|
30037 | 151 |
* <TD headers="objref example2"> {@code this.getClass()}<br> {@code .getClassLoader()}</TD> |
2 | 152 |
* <TD headers="objref mirrored2"> {@link ClassLoaderReference}</TD> |
153 |
* <TD headers="objref type2"> {@link ClassType}</TD> |
|
45001 | 154 |
* <TR style="background-color:#EEEEFF"> |
2 | 155 |
* <TH id="other" colspan=4>Other</TH> |
45001 | 156 |
* <TR style="background-color:#EEEEFF"> |
157 |
* <TD id="kind3" style="text-align:left">Kind of value</TD> |
|
158 |
* <TD id="example3" style="text-align:left">For example -<br>expression in target</TD> |
|
159 |
* <TD id="mirrored3" style="text-align:left">Is mirrored as</TD> |
|
160 |
* <TD id="type3" style="text-align:left">{@link Type} of value</TD> |
|
2 | 161 |
* <TR> |
162 |
* <TD headers="other kind3"> null</TD> |
|
30037 | 163 |
* <TD headers="other example3"> {@code null}</TD> |
164 |
* <TD headers="other mirrored3"> {@code null}</TD> |
|
2 | 165 |
* <TD headers="other type3"> n/a</TD> |
166 |
* </TABLE> |
|
167 |
* |
|
168 |
* @author Robert Field |
|
169 |
* @author Gordon Hirsch |
|
170 |
* @author James McIlree |
|
171 |
* @since 1.3 |
|
172 |
*/ |
|
173 |
||
20742
4ae78e8060d6
8008662: Add @jdk.Exported to JDK-specific/exported APIs
alanb
parents:
5506
diff
changeset
|
174 |
public interface Value extends Mirror { |
45564 | 175 |
|
2 | 176 |
/** |
177 |
* Returns the run-time type of this value. |
|
178 |
* |
|
179 |
* @see Type |
|
180 |
* @return a {@link Type} which mirrors the value's type in the |
|
181 |
* target VM. |
|
182 |
*/ |
|
183 |
Type type(); |
|
184 |
} |