Interface LocalVariable
- All Superinterfaces:
- Comparable<LocalVariable>,- Mirror
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:
- 
Method SummaryModifier and TypeMethodDescriptionbooleanCompares the specified Object with this LocalVariable for equality.Gets the generic signature for this variable if there is one.inthashCode()Returns the hash code value for this LocalVariable.booleanDetermines if this variable is an argument to its method.booleanisVisible(StackFrame frame) Determines whether this variable can be accessed from the givenStackFrame.name()Gets the name of the local variable.Gets the type signature of the local variable.type()Returns the type of this variable.typeName()Returns a text representation of the type of this variable.Methods declared in interface java.lang.ComparablecompareToMethods declared in interface com.sun.jdi.MirrortoString, virtualMachine
- 
Method Details- 
name
- 
typeNameString typeName()Returns a text representation of the type of this variable. Where the type is the type specified in the declaration of this local variable.This type name is always available even if the type has not yet been created or loaded. - Returns:
- a String representing the type of this local variable.
 
- 
typeReturns the type of this variable. Where the type is the type specified in the declaration of this local variable.Note: if the type of this variable is a reference type (class, interface, or array) and it has not been created or loaded by the class loader of the enclosing class, then ClassNotLoadedException will be thrown. Also, a reference type may have been loaded but not yet prepared, in which case the type will be returned but attempts to perform some operations on the returned type (e.g. fields()) will throw aClassNotPreparedException. UseReferenceType.isPrepared()to determine if a reference type is prepared.- Returns:
- the Typeof this local variable.
- Throws:
- ClassNotLoadedException- if the type has not yet been loaded through the appropriate class loader.
- See Also:
 
- 
signatureString signature()Gets the type signature of the local variable.- Returns:
- a string containing the signature.
 
- 
genericSignatureString genericSignature()Gets the generic signature for this variable if there is one. Generic signatures are described in the The Java Virtual Machine Specification.- Returns:
- a string containing the generic signature, or nullif there is no generic signature.
- Since:
- 1.5
 
- 
isVisibleDetermines whether this variable can be accessed from the givenStackFrame. SeeStackFrame.visibleVariables()for a complete description variable visibility in this interface.- Parameters:
- frame- the StackFrame querying visibility
- Returns:
- trueif this variable is visible;- falseotherwise.
- Throws:
- IllegalArgumentException- if the stack frame's method does not match this variable's method.
 
- 
isArgumentboolean isArgument()Determines if this variable is an argument to its method.- Returns:
- trueif this variable is an argument;- falseotherwise.
 
- 
equalsCompares the specified Object with this LocalVariable for equality.- Overrides:
- equalsin class- Object
- Parameters:
- obj- the reference object with which to compare.
- 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
- See Also:
 
- 
hashCode
 
-