Package org.jtool.cfg
Class JLocalVarReference
java.lang.Object
org.jtool.cfg.JReference
org.jtool.cfg.JVariableReference
org.jtool.cfg.JLocalVarReference
An class that represents a reference to a local variable.
-
Field Summary
Fields inherited from class org.jtool.cfg.JReference
astNode, codeRange, declaringClassName, declaringMethodName, enclosingClassName, enclosingMethodName, fqn, inProject, isPrimitiveType, modifiers, name, referenceForm, type
-
Constructor Summary
ConstructorsConstructorDescriptionJLocalVarReference
(org.eclipse.jdt.core.dom.ASTNode node, org.eclipse.jdt.core.dom.IVariableBinding vbinding) Creates a new object that represents a reference to a local variable. -
Method Summary
Modifier and TypeMethodDescriptionint
Returns the position that indicates where the code fragment for this reference begins.int
Returns the identification number of a referenced variable.boolean
Tests if this is a reference to a local variable.boolean
Tests if this is a reference to a parameter.toString()
Obtains information on this local variable reference.Methods inherited from class org.jtool.cfg.JVariableReference
getPrefix, isFinal, setProperties
Methods inherited from class org.jtool.cfg.JReference
equals, equals, findEnclosingClass, findEnclosingClassName, findEnclosingMethod, findEnclosingMethodName, getASTNode, getCodeRange, getDeclaringClassName, getDeclaringMethodName, getEnclosingClassName, getEnclosingElement, getEnclosingMethodName, getModifiers, getName, getParameterString, getQualifiedClassName, getQualifiedMethodName, getQualifiedName, getReceiverName, getReferenceForm, getSignature, getSignature, getType, getType, hashCode, isAliasReference, isAvailable, isConstructor, isDefault, isEnumConstant, isField, isFieldAccess, isInProject, isLocal, isMethod, isMethodCall, isPrimitiveType, isPrivate, isProtected, isPublic, isReturnValueReference, isUncoveredFieldReference, isUnsupportedReference, isVariableAccess, isVersatileReference, isVoidType
-
Constructor Details
-
JLocalVarReference
public JLocalVarReference(org.eclipse.jdt.core.dom.ASTNode node, org.eclipse.jdt.core.dom.IVariableBinding vbinding) Creates a new object that represents a reference to a local variable. This constructor is not intended to be invoked by clients.- Parameters:
node
- the AST node corresponding to this referencevbinding
- the variable binding information on this reference
-
-
Method Details
-
isLocalAccess
public boolean isLocalAccess()Tests if this is a reference to a local variable.- Overrides:
isLocalAccess
in classJReference
- Returns:
- always
true
that indicates a reference to a local variable
-
isParameter
public boolean isParameter()Tests if this is a reference to a parameter.- Returns:
true
if this is a reference to a parameter, otherwisefalse
-
getVariableId
public int getVariableId()Returns the identification number of a referenced variable.- Returns:
- the identification number
-
getStartPosition
public int getStartPosition()Returns the position that indicates where the code fragment for this reference begins.- Overrides:
getStartPosition
in classJReference
- Returns:
- the index value of the position on the source code
-
toString
Obtains information on this local variable reference.- Overrides:
toString
in classJVariableReference
- Returns:
- the string representing the information
-