0N/A/*
2362N/A * Copyright (c) 1998, 2004, 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 * A local variable in the target VM. Each variable declared within a
0N/A * {@link Method} has its own LocalVariable object. Variables of the same
0N/A * name declared in different scopes have different LocalVariable objects.
0N/A * LocalVariables can be used alone to retrieve static information
0N/A * about their declaration, or can be used in conjunction with a
0N/A * {@link StackFrame} to set and get values.
0N/A *
0N/A * @see StackFrame
0N/A * @see Method
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 LocalVariable extends Mirror, Comparable<LocalVariable> {
0N/A
0N/A /**
0N/A * Gets the name of the local variable.
0N/A *
0N/A * @return a string containing the name.
0N/A */
0N/A String name();
0N/A
0N/A /**
0N/A * Returns a text representation of the type
0N/A * of this variable.
0N/A * Where the type is the type specified in the declaration
0N/A * of this local variable.
0N/A * <P>
0N/A * This type name is always available even if
0N/A * the type has not yet been created or loaded.
0N/A *
0N/A * @return a String representing the
0N/A * type of this local variable.
0N/A
0N/A */
0N/A String typeName();
0N/A
0N/A /**
0N/A * Returns the type of this variable.
0N/A * Where the type is the type specified in the declaration
0N/A * of this local variable.
0N/A * <P>
0N/A * Note: if the type of this variable is a reference type (class,
0N/A * interface, or array) and it has not been created or loaded
0N/A * by the class loader of the enclosing class,
0N/A * then ClassNotLoadedException will be thrown.
0N/A * Also, a reference type may have been loaded but not yet prepared,
0N/A * in which case the type will be returned
0N/A * but attempts to perform some operations on the returned type
0N/A * (e.g. {@link ReferenceType#fields() fields()}) will throw
0N/A * a {@link ClassNotPreparedException}.
0N/A * Use {@link ReferenceType#isPrepared()} to determine if
0N/A * a reference type is prepared.
0N/A *
0N/A * @see Type
0N/A * @see Field#type() Field.type() - for usage examples
0N/A * @return the {@link Type} of this local variable.
0N/A * @throws ClassNotLoadedException if the type has not yet been loaded
0N/A * through the appropriate class loader.
0N/A */
0N/A Type type() throws ClassNotLoadedException;
0N/A
0N/A /**
0N/A * Gets the JNI signature of the local variable.
0N/A *
0N/A * @see <a href="doc-files/signature.html">Type Signatures</a>
0N/A * @return a string containing the signature.
0N/A */
0N/A String signature();
0N/A
0N/A /**
0N/A * Gets the generic signature for this variable if there is one.
0N/A * Generic signatures are described in the
4008N/A * <cite>The Java&trade; Virtual Machine Specification</cite>.
0N/A *
0N/A * @return a string containing the generic signature, or <code>null</code>
0N/A * if there is no generic signature.
0N/A *
0N/A * @since 1.5
0N/A */
0N/A String genericSignature();
0N/A
0N/A /**
0N/A * Determines whether this variable can be accessed from the given
0N/A * {@link StackFrame}.
0N/A *
0N/A * See {@link StackFrame#visibleVariables} for a complete description
0N/A * variable visibility in this interface.
0N/A *
0N/A * @param frame the StackFrame querying visibility
0N/A * @return <code>true</code> if this variable is visible;
0N/A * <code>false</code> otherwise.
0N/A * @throws IllegalArgumentException if the stack frame's method
0N/A * does not match this variable's method.
0N/A */
0N/A boolean isVisible(StackFrame frame);
0N/A
0N/A /**
0N/A * Determines if this variable is an argument to its method.
0N/A *
0N/A * @return <code>true</code> if this variable is an argument;
0N/A * <code>false</code> otherwise.
0N/A */
0N/A boolean isArgument();
0N/A
0N/A /**
0N/A * Compares the specified Object with this LocalVariable for equality.
0N/A *
0N/A * @return true if the Object is a LocalVariable, if both LocalVariables
0N/A * are contained in the same method (as determined by
0N/A * {@link Method#equals}), and if both LocalVariables mirror
0N/A * the same declaration within that method
0N/A */
0N/A boolean equals(Object obj);
0N/A
0N/A /**
0N/A * Returns the hash code value for this LocalVariable.
0N/A *
0N/A * @return the integer hash code
0N/A */
0N/A int hashCode();
0N/A}