|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object extended by net.sourceforge.pmd.symboltable.AbstractScope
public abstract class AbstractScope
Constructor Summary | |
---|---|
AbstractScope()
|
Method Summary | ||
---|---|---|
void |
addDeclaration(ClassNameDeclaration classDecl)
Add a class declaration to this scope |
|
void |
addDeclaration(MethodNameDeclaration methodDecl)
Add a method declaration to this scope |
|
boolean |
contains(NameOccurrence occurrence)
Tests whether or not a NameOccurrence is directly contained in the scope Note that this search is just for this scope - it doesn't go diving into any child scopes. |
|
protected abstract NameDeclaration |
findVariableHere(NameOccurrence occurrence)
|
|
java.util.Map<ClassNameDeclaration,java.util.List<NameOccurrence>> |
getClassDeclarations()
Returns a Map (VariableNameDeclaration->List(NameOccurrence,NameOccurrence)) of declarations that exist at this scope |
|
ClassScope |
getEnclosingClassScope()
Goes searching up the tree for this scope's enclosing ClassScope This is handy if you're buried down in a LocalScope and need to hop up to the ClassScope to find a method name. |
|
MethodScope |
getEnclosingMethodScope()
Goes searching up the tree for this scope's enclosing MethodScope This is handy if you're buried down in a LocalScope and need to hop up to the MethodScope to find a method parameter. |
|
SourceFileScope |
getEnclosingSourceFileScope()
Goes searching up the tree for this scope's enclosing SourceFileScope This is handy if you're buried down in a LocalScope and need to hop up to the SourceFileScope to find a class name. |
|
Scope |
getParent()
Retrieves this scope's parent |
|
protected
|
glomNames(java.util.Set<T> s)
|
|
void |
setParent(Scope parent)
Points this scope to its parent |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface net.sourceforge.pmd.symboltable.Scope |
---|
addDeclaration, addVariableNameOccurrence, getVariableDeclarations |
Constructor Detail |
---|
public AbstractScope()
Method Detail |
---|
public java.util.Map<ClassNameDeclaration,java.util.List<NameOccurrence>> getClassDeclarations()
Scope
getClassDeclarations
in interface Scope
public MethodScope getEnclosingMethodScope()
Scope
getEnclosingMethodScope
in interface Scope
public ClassScope getEnclosingClassScope()
Scope
getEnclosingClassScope
in interface Scope
public SourceFileScope getEnclosingSourceFileScope()
Scope
getEnclosingSourceFileScope
in interface Scope
public void setParent(Scope parent)
Scope
public Scope getParent()
Scope
public void addDeclaration(MethodNameDeclaration methodDecl)
Scope
addDeclaration
in interface Scope
public void addDeclaration(ClassNameDeclaration classDecl)
Scope
addDeclaration
in interface Scope
public boolean contains(NameOccurrence occurrence)
Scope
protected abstract NameDeclaration findVariableHere(NameOccurrence occurrence)
protected <T> java.lang.String glomNames(java.util.Set<T> s)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |