jdk/src/share/classes/com/sun/jdi/Method.java
author jjh
Wed, 13 Apr 2011 12:16:13 -0700
changeset 9266 121fb370f179
parent 5506 202f599c92aa
child 14342 8435a30053c1
permissions -rw-r--r--
7032960: API files in java.awt need to be updated for references to JVM Spec with editions/hyperlinks 7032965: API files in java.io need to updated for references to JVM Spec with editions/hyperlinks 7032958: API files in java.lang need to updated for references to JLS with editions/hyperlinks 7032961: API files in java.lang need to updated for references to JVM with editions/hyperlinks 7032976: API files in javax.lang need to be updated for references to JLS with editions/hyperlinks 7032959: API files in java.util need to updated for references to JLS with editions/hyperlinks 7032962: API files in java.util need to updated for references to JVM Spec with editions/hyperlinks 7032967: API files in java.security need to updated for references to JVM Spec with editions/hyperlinks 7032955: API files in java.math need to updated for references to JLS with editions/hyperlinks Summary: Removed URLs and 'edition' references Reviewed-by: darcy
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
/*
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
     2
 * Copyright (c) 1998, 2005, Oracle and/or its affiliates. All rights reserved.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     4
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
90ce3da70b43 Initial load
duke
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
     7
 * published by the Free Software Foundation.  Oracle designates this
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
     9
 * by Oracle in the LICENSE file that accompanied this code.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    10
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
90ce3da70b43 Initial load
duke
parents:
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
90ce3da70b43 Initial load
duke
parents:
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
90ce3da70b43 Initial load
duke
parents:
diff changeset
    15
 * accompanied this code).
90ce3da70b43 Initial load
duke
parents:
diff changeset
    16
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
90ce3da70b43 Initial load
duke
parents:
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    20
 *
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    22
 * or visit www.oracle.com if you need additional information or have any
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    23
 * questions.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    24
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    25
90ce3da70b43 Initial load
duke
parents:
diff changeset
    26
package com.sun.jdi;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    27
90ce3da70b43 Initial load
duke
parents:
diff changeset
    28
import java.util.List;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    29
90ce3da70b43 Initial load
duke
parents:
diff changeset
    30
/**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    31
 * A static or instance method in the target VM. See {@link TypeComponent}
90ce3da70b43 Initial load
duke
parents:
diff changeset
    32
 * for general information about Field and Method mirrors.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    33
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    34
 * @see ObjectReference
90ce3da70b43 Initial load
duke
parents:
diff changeset
    35
 * @see ReferenceType
90ce3da70b43 Initial load
duke
parents:
diff changeset
    36
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    37
 * @author Robert Field
90ce3da70b43 Initial load
duke
parents:
diff changeset
    38
 * @author Gordon Hirsch
90ce3da70b43 Initial load
duke
parents:
diff changeset
    39
 * @author James McIlree
90ce3da70b43 Initial load
duke
parents:
diff changeset
    40
 * @since  1.3
90ce3da70b43 Initial load
duke
parents:
diff changeset
    41
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    42
public interface Method extends TypeComponent, Locatable, Comparable<Method> {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    43
90ce3da70b43 Initial load
duke
parents:
diff changeset
    44
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    45
     * Returns a text representation of the return type,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    46
     * as specified in the declaration of this method.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    47
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    48
     * This type name is always available even if
90ce3da70b43 Initial load
duke
parents:
diff changeset
    49
     * the type has not yet been created or loaded.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    50
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    51
     * @return a String containing the return type name.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    52
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    53
    String returnTypeName();
90ce3da70b43 Initial load
duke
parents:
diff changeset
    54
90ce3da70b43 Initial load
duke
parents:
diff changeset
    55
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    56
     * Returns the return type,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    57
     * as specified in the declaration of this method.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    58
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    59
     * Note: if the return type of this method is a reference type (class,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    60
     * interface, or array) and it has not been created or loaded
90ce3da70b43 Initial load
duke
parents:
diff changeset
    61
     * by the declaring type's class loader - that is,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    62
     * {@link TypeComponent#declaringType <CODE>declaringType()</CODE>}
90ce3da70b43 Initial load
duke
parents:
diff changeset
    63
     * <CODE>.classLoader()</CODE>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    64
     * then ClassNotLoadedException will be thrown.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    65
     * Also, a reference type may have been loaded but not yet prepared,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    66
     * in which case the type will be returned
90ce3da70b43 Initial load
duke
parents:
diff changeset
    67
     * but attempts to perform some operations on the returned type
90ce3da70b43 Initial load
duke
parents:
diff changeset
    68
     * (e.g. {@link ReferenceType#fields() fields()}) will throw
90ce3da70b43 Initial load
duke
parents:
diff changeset
    69
     * a {@link ClassNotPreparedException}.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    70
     * Use {@link ReferenceType#isPrepared()} to determine if
90ce3da70b43 Initial load
duke
parents:
diff changeset
    71
     * a reference type is prepared.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    72
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    73
     * @see Type
90ce3da70b43 Initial load
duke
parents:
diff changeset
    74
     * @see Field#type() Field.type() - for usage examples
90ce3da70b43 Initial load
duke
parents:
diff changeset
    75
     * @return the return {@link Type} of this method.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    76
     * @throws ClassNotLoadedException if the type has not yet been
90ce3da70b43 Initial load
duke
parents:
diff changeset
    77
     * created or loaded
90ce3da70b43 Initial load
duke
parents:
diff changeset
    78
     * through the appropriate class loader.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    79
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    80
    Type returnType() throws ClassNotLoadedException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    81
90ce3da70b43 Initial load
duke
parents:
diff changeset
    82
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    83
     * Returns a list containing a text representation of the type
90ce3da70b43 Initial load
duke
parents:
diff changeset
    84
     * of each formal parameter of this method.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    85
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    86
     * This list is always available even if
90ce3da70b43 Initial load
duke
parents:
diff changeset
    87
     * the types have not yet been created or loaded.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    88
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    89
     * @return a {@link java.util.List List} of {@link String},
90ce3da70b43 Initial load
duke
parents:
diff changeset
    90
     * one List element for each parameter of this method.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    91
     * Each element represents the type of a formal parameter
90ce3da70b43 Initial load
duke
parents:
diff changeset
    92
     * as specified at compile-time.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    93
     * If the formal parameter was declared with an ellipsis, then
90ce3da70b43 Initial load
duke
parents:
diff changeset
    94
     * it is represented as an array of the type before the ellipsis.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    95
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    96
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    97
    List<String> argumentTypeNames();
90ce3da70b43 Initial load
duke
parents:
diff changeset
    98
90ce3da70b43 Initial load
duke
parents:
diff changeset
    99
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   100
     * Returns a list containing the type
90ce3da70b43 Initial load
duke
parents:
diff changeset
   101
     * of each formal parameter of this method.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   102
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   103
     * Note: if there is any parameter whose type
90ce3da70b43 Initial load
duke
parents:
diff changeset
   104
     * is a reference type (class, interface, or array)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   105
     * and it has not been created or loaded
90ce3da70b43 Initial load
duke
parents:
diff changeset
   106
     * by the declaring type's class loader - that is,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   107
     * {@link TypeComponent#declaringType <CODE>declaringType()</CODE>}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   108
     * <CODE>.classLoader()</CODE>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   109
     * then ClassNotLoadedException will be thrown.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   110
     * Also, a reference type may have been loaded but not yet prepared,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   111
     * in which case the list will be returned
90ce3da70b43 Initial load
duke
parents:
diff changeset
   112
     * but attempts to perform some operations on the type
90ce3da70b43 Initial load
duke
parents:
diff changeset
   113
     * (e.g. {@link ReferenceType#fields() fields()}) will throw
90ce3da70b43 Initial load
duke
parents:
diff changeset
   114
     * a {@link ClassNotPreparedException}.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   115
     * Use {@link ReferenceType#isPrepared()} to determine if
90ce3da70b43 Initial load
duke
parents:
diff changeset
   116
     * a reference type is prepared.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   117
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   118
     * @see Type
90ce3da70b43 Initial load
duke
parents:
diff changeset
   119
     * @return return a {@link java.util.List List} of {@link Type},
90ce3da70b43 Initial load
duke
parents:
diff changeset
   120
     * one List element for each parameter of this method.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   121
     * Each element represents the type of a formal parameter
90ce3da70b43 Initial load
duke
parents:
diff changeset
   122
     * as specified at compile-time.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   123
     * If the formal parameter was declared with an ellipsis, then
90ce3da70b43 Initial load
duke
parents:
diff changeset
   124
     * it is represented as an array of the type before the ellipsis.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   125
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   126
     * @throws ClassNotLoadedException if the type has not yet been loaded
90ce3da70b43 Initial load
duke
parents:
diff changeset
   127
     * through the appropriate class loader.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   128
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   129
    List<Type> argumentTypes() throws ClassNotLoadedException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   130
90ce3da70b43 Initial load
duke
parents:
diff changeset
   131
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   132
     * Determine if this method is abstract.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   133
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   134
     * @return <code>true</code> if the method is declared abstract;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   135
     * false otherwise.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   136
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   137
    boolean isAbstract();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   138
90ce3da70b43 Initial load
duke
parents:
diff changeset
   139
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   140
     * Determine if this method is synchronized.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   141
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   142
     * @return <code>true</code> if the method is declared synchronized;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   143
     * false otherwise.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   144
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   145
    boolean isSynchronized();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   146
90ce3da70b43 Initial load
duke
parents:
diff changeset
   147
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   148
     * Determine if this method is native.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   149
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   150
     * @return <code>true</code> if the method is declared native;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   151
     * false otherwise.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   152
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   153
    boolean isNative();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   154
90ce3da70b43 Initial load
duke
parents:
diff changeset
   155
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   156
     * Determine if this method accepts a variable number of arguments.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   157
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   158
     * @return <code>true</code> if the method accepts a variable number
90ce3da70b43 Initial load
duke
parents:
diff changeset
   159
     * of arguments, false otherwise.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   160
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   161
     * @since 1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
   162
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   163
    boolean isVarArgs();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   164
90ce3da70b43 Initial load
duke
parents:
diff changeset
   165
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   166
     * Determine if this method is a bridge method. Bridge
9266
121fb370f179 7032960: API files in java.awt need to be updated for references to JVM Spec with editions/hyperlinks
jjh
parents: 5506
diff changeset
   167
     * methods are defined in
121fb370f179 7032960: API files in java.awt need to be updated for references to JVM Spec with editions/hyperlinks
jjh
parents: 5506
diff changeset
   168
     * <cite>The Java&trade; Language Specification</cite>.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   169
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   170
     * @return <code>true</code> if the method is a bridge method,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   171
     * false otherwise.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   172
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   173
     * @since 1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
   174
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   175
    boolean isBridge();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   176
90ce3da70b43 Initial load
duke
parents:
diff changeset
   177
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   178
     * Determine if this method is a constructor.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   179
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   180
     * @return <code>true</code> if the method is a constructor;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   181
     * false otherwise.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   182
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   183
    boolean isConstructor();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   184
90ce3da70b43 Initial load
duke
parents:
diff changeset
   185
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   186
     * Determine if this method is a static initializer.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   187
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   188
     * @return <code>true</code> if the method is a static initializer;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   189
     * false otherwise.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   190
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   191
    boolean isStaticInitializer();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   192
90ce3da70b43 Initial load
duke
parents:
diff changeset
   193
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   194
     * Determine if this method is obsolete.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   195
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   196
     * @return <code>true</code> if this method has been made obsolete by a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   197
     * {@link VirtualMachine#redefineClasses} operation.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   198
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   199
     * @since 1.4
90ce3da70b43 Initial load
duke
parents:
diff changeset
   200
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   201
    boolean isObsolete();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   202
90ce3da70b43 Initial load
duke
parents:
diff changeset
   203
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   204
     * Returns a list containing a {@link Location} object for
90ce3da70b43 Initial load
duke
parents:
diff changeset
   205
     * each executable source line in this method.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   206
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   207
     * This method is equivalent to
90ce3da70b43 Initial load
duke
parents:
diff changeset
   208
     * <code>allLineLocations(vm.getDefaultStratum(),null)</code> -
90ce3da70b43 Initial load
duke
parents:
diff changeset
   209
     * see {@link #allLineLocations(String,String)}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   210
     * for more information.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   211
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   212
     * @return a List of all source line {@link Location} objects.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   213
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   214
     * @throws AbsentInformationException if there is no line
90ce3da70b43 Initial load
duke
parents:
diff changeset
   215
     * number information for this (non-native, non-abstract)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   216
     * method.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   217
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   218
    List<Location> allLineLocations() throws AbsentInformationException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   219
90ce3da70b43 Initial load
duke
parents:
diff changeset
   220
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   221
     * Returns a list containing a {@link Location} object for
90ce3da70b43 Initial load
duke
parents:
diff changeset
   222
     * each executable source line in this method.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   223
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   224
     * Each location maps a source line to a range of code
90ce3da70b43 Initial load
duke
parents:
diff changeset
   225
     * indices.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   226
     * The beginning of the range can be determined through
90ce3da70b43 Initial load
duke
parents:
diff changeset
   227
     * {@link Location#codeIndex}.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   228
     * The returned list is ordered by code index
90ce3da70b43 Initial load
duke
parents:
diff changeset
   229
     * (from low to high).
90ce3da70b43 Initial load
duke
parents:
diff changeset
   230
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   231
     * The returned list may contain multiple locations for a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   232
     * particular line number, if the compiler and/or VM has
90ce3da70b43 Initial load
duke
parents:
diff changeset
   233
     * mapped that line to two or more disjoint code index ranges.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   234
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   235
     * If the method is native or abstract, an empty list is
90ce3da70b43 Initial load
duke
parents:
diff changeset
   236
     * returned.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   237
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   238
     * Returned list is for the specified <i>stratum</i>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   239
     * (see {@link Location} for a description of strata).
90ce3da70b43 Initial load
duke
parents:
diff changeset
   240
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   241
     * @param stratum The stratum to retrieve information from
90ce3da70b43 Initial load
duke
parents:
diff changeset
   242
     * or <code>null</code> for the {@link ReferenceType#defaultStratum()}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   243
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   244
     * @param sourceName Return locations only within this
90ce3da70b43 Initial load
duke
parents:
diff changeset
   245
     * source file or <code>null</code> to return locations.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   246
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   247
     * @return a List of all source line {@link Location} objects.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   248
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   249
     * @throws AbsentInformationException if there is no line
90ce3da70b43 Initial load
duke
parents:
diff changeset
   250
     * number information for this (non-native, non-abstract)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   251
     * method.  Or if <i>sourceName</i> is non-<code>null</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   252
     * and source name information is not present.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   253
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   254
     * @since 1.4
90ce3da70b43 Initial load
duke
parents:
diff changeset
   255
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   256
    List<Location> allLineLocations(String stratum, String sourceName)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   257
        throws AbsentInformationException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   258
90ce3da70b43 Initial load
duke
parents:
diff changeset
   259
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   260
     * Returns a List containing all {@link Location} objects
90ce3da70b43 Initial load
duke
parents:
diff changeset
   261
     * that map to the given line number.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   262
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   263
     * This method is equivalent to
90ce3da70b43 Initial load
duke
parents:
diff changeset
   264
     * <code>locationsOfLine(vm.getDefaultStratum(), null,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   265
     * lineNumber)</code> -
90ce3da70b43 Initial load
duke
parents:
diff changeset
   266
     * see {@link
90ce3da70b43 Initial load
duke
parents:
diff changeset
   267
     * #locationsOfLine(java.lang.String,java.lang.String,int)}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   268
     * for more information.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   269
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   270
     * @param lineNumber the line number
90ce3da70b43 Initial load
duke
parents:
diff changeset
   271
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   272
     * @return a List of {@link Location} objects that map to
90ce3da70b43 Initial load
duke
parents:
diff changeset
   273
     * the given line number.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   274
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   275
     * @throws AbsentInformationException if there is no line
90ce3da70b43 Initial load
duke
parents:
diff changeset
   276
     * number information for this method.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   277
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   278
    List<Location> locationsOfLine(int lineNumber) throws AbsentInformationException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   279
90ce3da70b43 Initial load
duke
parents:
diff changeset
   280
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   281
     * Returns a List containing all {@link Location} objects
90ce3da70b43 Initial load
duke
parents:
diff changeset
   282
     * that map to the given line number and source name.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   283
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   284
     * Returns a list containing each {@link Location} that maps
90ce3da70b43 Initial load
duke
parents:
diff changeset
   285
     * to the given line. The returned list will contain a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   286
     * location for each disjoint range of code indices that have
90ce3da70b43 Initial load
duke
parents:
diff changeset
   287
     * been assigned to the given line by the compiler and/or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   288
     * VM. Each returned location corresponds to the beginning of
90ce3da70b43 Initial load
duke
parents:
diff changeset
   289
     * this range.  An empty list will be returned if there is no
90ce3da70b43 Initial load
duke
parents:
diff changeset
   290
     * executable code at the specified line number; specifically,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   291
     * native and abstract methods will always return an empty
90ce3da70b43 Initial load
duke
parents:
diff changeset
   292
     * list.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   293
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   294
     * Returned list is for the specified <i>stratum</i>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   295
     * (see {@link Location} for a description of strata).
90ce3da70b43 Initial load
duke
parents:
diff changeset
   296
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   297
     * @param stratum the stratum to use for comparing line number
90ce3da70b43 Initial load
duke
parents:
diff changeset
   298
     *                and source name, or null to use the default
90ce3da70b43 Initial load
duke
parents:
diff changeset
   299
     *                stratum
90ce3da70b43 Initial load
duke
parents:
diff changeset
   300
     * @param sourceName the source name containing the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   301
     *                   line number, or null to match all
90ce3da70b43 Initial load
duke
parents:
diff changeset
   302
     *                   source names
90ce3da70b43 Initial load
duke
parents:
diff changeset
   303
     * @param lineNumber the line number
90ce3da70b43 Initial load
duke
parents:
diff changeset
   304
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   305
     * @return a List of {@link Location} objects that map to
90ce3da70b43 Initial load
duke
parents:
diff changeset
   306
     * the given line number.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   307
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   308
     * @throws AbsentInformationException if there is no line
90ce3da70b43 Initial load
duke
parents:
diff changeset
   309
     * number information for this method.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   310
     * Or if <i>sourceName</i> is non-<code>null</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   311
     * and source name information is not present.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   312
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   313
     * @since 1.4
90ce3da70b43 Initial load
duke
parents:
diff changeset
   314
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   315
    List<Location> locationsOfLine(String stratum, String sourceName,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   316
                                   int lineNumber)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   317
        throws AbsentInformationException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   318
90ce3da70b43 Initial load
duke
parents:
diff changeset
   319
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   320
     * Returns a {@link Location} for the given code index.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   321
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   322
     * @return the {@link Location} corresponding to the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   323
     * given code index or null if the specified code index is not a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   324
     * valid code index for this method (native and abstract methods
90ce3da70b43 Initial load
duke
parents:
diff changeset
   325
     * will always return null).
90ce3da70b43 Initial load
duke
parents:
diff changeset
   326
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   327
    Location locationOfCodeIndex(long codeIndex);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   328
90ce3da70b43 Initial load
duke
parents:
diff changeset
   329
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   330
     * Returns a list containing each {@link LocalVariable} declared
90ce3da70b43 Initial load
duke
parents:
diff changeset
   331
     * in this method. The list includes any variable declared in any
90ce3da70b43 Initial load
duke
parents:
diff changeset
   332
     * scope within the method. It may contain multiple variables of the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   333
     * same name declared within disjoint scopes. Arguments are considered
90ce3da70b43 Initial load
duke
parents:
diff changeset
   334
     * local variables and will be present in the returned list.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   335
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   336
     * If local variable information is not available, values of
90ce3da70b43 Initial load
duke
parents:
diff changeset
   337
     * actual arguments to method invocations can be obtained
90ce3da70b43 Initial load
duke
parents:
diff changeset
   338
     * by using the method {@link StackFrame#getArgumentValues()}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   339
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   340
     * @return the list of {@link LocalVariable} objects which mirror
90ce3da70b43 Initial load
duke
parents:
diff changeset
   341
     * local variables declared in this method in the target VM.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   342
     * If there are no local variables, a zero-length list is returned.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   343
     * @throws AbsentInformationException if there is no variable
90ce3da70b43 Initial load
duke
parents:
diff changeset
   344
     * information for this method.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   345
     * Generally, local variable information is not available for
90ce3da70b43 Initial load
duke
parents:
diff changeset
   346
     * native or abstract methods (that is, their argument name
90ce3da70b43 Initial load
duke
parents:
diff changeset
   347
     * information is not available), thus they will throw this exception.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   348
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   349
    List<LocalVariable> variables() throws AbsentInformationException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   350
90ce3da70b43 Initial load
duke
parents:
diff changeset
   351
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   352
     * Returns a list containing each {@link LocalVariable} of a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   353
     * given name in this method.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   354
     * Multiple variables can be returned
90ce3da70b43 Initial load
duke
parents:
diff changeset
   355
     * if the same variable name is used in disjoint
90ce3da70b43 Initial load
duke
parents:
diff changeset
   356
     * scopes within the method.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   357
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   358
     * @return the list of {@link LocalVariable} objects of the given
90ce3da70b43 Initial load
duke
parents:
diff changeset
   359
     * name.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   360
     * If there are no matching local variables, a zero-length list
90ce3da70b43 Initial load
duke
parents:
diff changeset
   361
     * is returned.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   362
     * @throws AbsentInformationException if there is no variable
90ce3da70b43 Initial load
duke
parents:
diff changeset
   363
     * information for this method.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   364
     * Generally, local variable information is not available for
90ce3da70b43 Initial load
duke
parents:
diff changeset
   365
     * native or abstract methods (that is, their argument name
90ce3da70b43 Initial load
duke
parents:
diff changeset
   366
     * information is not available), thus they will throw this exception.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   367
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   368
    List<LocalVariable> variablesByName(String name)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   369
        throws AbsentInformationException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   370
90ce3da70b43 Initial load
duke
parents:
diff changeset
   371
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   372
     * Returns a list containing each {@link LocalVariable} that is
90ce3da70b43 Initial load
duke
parents:
diff changeset
   373
     * declared as an argument of this method.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   374
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   375
     * If local variable information is not available, values of
90ce3da70b43 Initial load
duke
parents:
diff changeset
   376
     * actual arguments to method invocations can be obtained
90ce3da70b43 Initial load
duke
parents:
diff changeset
   377
     * by using the method {@link StackFrame#getArgumentValues()}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   378
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   379
     * @return the list of {@link LocalVariable} arguments.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   380
     * If there are no arguments, a zero-length list is returned.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   381
     * @throws AbsentInformationException if there is no variable
90ce3da70b43 Initial load
duke
parents:
diff changeset
   382
     * information for this method.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   383
     * Generally, local variable information is not available for
90ce3da70b43 Initial load
duke
parents:
diff changeset
   384
     * native or abstract methods (that is, their argument name
90ce3da70b43 Initial load
duke
parents:
diff changeset
   385
     * information is not available), thus they will throw this exception.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   386
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   387
    List<LocalVariable> arguments() throws AbsentInformationException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   388
90ce3da70b43 Initial load
duke
parents:
diff changeset
   389
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   390
     * Returns an array containing the bytecodes for this method.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   391
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   392
     * Not all target virtual machines support this operation.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   393
     * Use {@link VirtualMachine#canGetBytecodes()}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   394
     * to determine if the operation is supported.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   395
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   396
     * @return the array of bytecodes; abstract and native methods
90ce3da70b43 Initial load
duke
parents:
diff changeset
   397
     * will return a zero-length array.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   398
     * @throws java.lang.UnsupportedOperationException if
90ce3da70b43 Initial load
duke
parents:
diff changeset
   399
     * the target virtual machine does not support
90ce3da70b43 Initial load
duke
parents:
diff changeset
   400
     * the retrieval of bytecodes.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   401
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   402
    byte[] bytecodes();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   403
90ce3da70b43 Initial load
duke
parents:
diff changeset
   404
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   405
     * Returns the {@link Location} of this method, if there
90ce3da70b43 Initial load
duke
parents:
diff changeset
   406
     * is executable code associated with it.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   407
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   408
     * @return the {@link Location} of this mirror, or null if
90ce3da70b43 Initial load
duke
parents:
diff changeset
   409
     * this is an abstract method; native methods will return a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   410
     * Location object whose codeIndex is -1.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   411
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   412
    Location location();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   413
90ce3da70b43 Initial load
duke
parents:
diff changeset
   414
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   415
     * Compares the specified Object with this method for equality.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   416
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   417
     * @return true if the Object is a method and if both
90ce3da70b43 Initial load
duke
parents:
diff changeset
   418
     * mirror the same method (declared in the same class or interface, in
90ce3da70b43 Initial load
duke
parents:
diff changeset
   419
     * the same VM).
90ce3da70b43 Initial load
duke
parents:
diff changeset
   420
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   421
    boolean equals(Object obj);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   422
90ce3da70b43 Initial load
duke
parents:
diff changeset
   423
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   424
     * Returns the hash code value for this Method.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   425
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   426
     * @return the integer hash code
90ce3da70b43 Initial load
duke
parents:
diff changeset
   427
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   428
    int hashCode();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   429
}