private static final class UnusedLocalVariableCheck.VariableDesc extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
private boolean |
instVarOrClassVar
Is an instance variable or a class variable.
|
private java.lang.String |
name
The name of the variable.
|
private DetailAST |
scope
The scope of variable is determined by the ast of type
TokenTypes.SLIST or TokenTypes.LITERAL_FOR
or TokenTypes.OBJBLOCK which is enclosing the variable. |
private DetailAST |
typeAst
Ast of type
TokenTypes.TYPE. |
private boolean |
used
Is the variable used.
|
| Constructor and Description |
|---|
VariableDesc(java.lang.String name,
DetailAST typeAst,
DetailAST scope)
Create a new VariableDesc instance.
|
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
getName()
Get the name of variable.
|
DetailAST |
getScope()
Get ast of type
TokenTypes.SLIST
or TokenTypes.LITERAL_FOR or TokenTypes.OBJBLOCK
which is enclosing the variable i.e. |
DetailAST |
getTypeAst()
Get the associated ast node of type
TokenTypes.TYPE. |
boolean |
isInstVarOrClassVar()
Is an instance variable or a class variable.
|
boolean |
isUsed()
Is the variable used or not.
|
void |
registerAsInstOrClassVar()
Register the variable as an instance variable or
class variable.
|
void |
registerAsUsed()
Register the variable as used.
|
private final java.lang.String name
private final DetailAST typeAst
TokenTypes.TYPE.private final DetailAST scope
TokenTypes.SLIST or TokenTypes.LITERAL_FOR
or TokenTypes.OBJBLOCK which is enclosing the variable.private boolean instVarOrClassVar
private boolean used
VariableDesc(java.lang.String name, DetailAST typeAst, DetailAST scope)
name - name of the variabletypeAst - ast of type TokenTypes.TYPEscope - ast of type TokenTypes.SLIST or
TokenTypes.LITERAL_FOR or TokenTypes.OBJBLOCK
which is enclosing the variablepublic java.lang.String getName()
public DetailAST getTypeAst()
TokenTypes.TYPE.TokenTypes.TYPEpublic DetailAST getScope()
TokenTypes.SLIST
or TokenTypes.LITERAL_FOR or TokenTypes.OBJBLOCK
which is enclosing the variable i.e. its scope.public void registerAsUsed()
public void registerAsInstOrClassVar()
public boolean isUsed()
public boolean isInstVarOrClassVar()
Copyright © 2001-2022. All Rights Reserved.