Spec-Zone .ru
спецификации, руководства, описания, API
Java Debug Interface

com.sun.jdi
Interface LocalVariable

All Superinterfaces:
Comparable, Mirror

public interface LocalVariable
extends Mirror, Comparable

A local variable in the target VM. Each variable declared within a Method has its own LocalVariable object. Variables of the same name declared in different scopes have different LocalVariable objects. LocalVariables can be used alone to retrieve static information about their declaration, or can be used in conjunction with a StackFrame to set and get values.

Since:
1.3
See Also:
StackFrame, Method

Method Summary
 boolean equals(Object obj)
          Compares the specified Object with this LocalVariable for equality.
 int hashCode()
          Returns the hash code value for this LocalVariable.
 boolean isArgument()
          Determines if this variable is an argument to its method.
 boolean isVisible(StackFrame frame)
          Determines whether this variable can be accessed from the given StackFrame.
 String name()
          Gets the name of the local variable.
 String signature()
          Gets the JNI signature of the local variable.
 Type type()
          Returns the type of the this LocalVariable.
 String typeName()
           
 
Methods inherited from interface com.sun.jdi.Mirror
toString, virtualMachine
 
Methods inherited from interface java.lang.Comparable
compareTo
 

Method Detail

name

public String name()
Gets the name of the local variable.
Returns:
a string containing the name.

typeName

public String typeName()
Returns:
a text representation of the declared type of this variable.

type

public Type type()
          throws ClassNotLoadedException
Returns the type of the this LocalVariable. For primitive variables, an appropriate PrimitiveType is always returned. For object variables, the appropriate ReferenceType is returned if it has been loaded through the enclosing type's class loader.
Returns:
the Type of this local variable.
Throws:
ClassNotLoadedException - if the type has not yet been loaded through the appropriate class loader.

signature

public String signature()
Gets the JNI signature of the local variable.
Returns:
a string containing the signature.
See Also:
Type Signatures

isVisible

public boolean isVisible(StackFrame frame)
Determines whether this variable can be accessed from the given StackFrame. See StackFrame.visibleVariables() for a complete description variable visibility in this interface.
Parameters:
frame - the StackFrame querying visibility
Returns:
true if this variable is visible; false otherwise.
Throws:
IllegalArgumentException - if the stack frame's method does not match this variable's method.
VMMismatchException - if a Mirror argument and this mirror do not belong to the same VirtualMachine.

isArgument

public boolean isArgument()
Determines if this variable is an argument to its method.
Returns:
true if this variable is final; false otherwise.

equals

public boolean equals(Object obj)
Compares the specified Object with this LocalVariable for equality.
Overrides:
equals in class Object
Returns:
true if the Object is a LocalVariable, if both LocalVariables are contained in the same method (as determined by Method.equals(java.lang.Object)), and if both LocalVariables mirror the same declaration within that method

hashCode

public int hashCode()
Returns the hash code value for this LocalVariable.
Overrides:
hashCode in class Object
Returns:
the integer hash code

Java Debug Interface