net.sourceforge.pmd.symboltable
Class GlobalScope

java.lang.Object
  extended bynet.sourceforge.pmd.symboltable.AbstractScope
      extended bynet.sourceforge.pmd.symboltable.GlobalScope
All Implemented Interfaces:
Scope

public class GlobalScope
extends AbstractScope
implements Scope


Field Summary
 
Fields inherited from class net.sourceforge.pmd.symboltable.AbstractScope
methodNames, variableNames
 
Constructor Summary
GlobalScope()
           
 
Method Summary
 void addDeclaration(MethodNameDeclaration decl)
          Add a method declaration to this scope
 void addDeclaration(VariableNameDeclaration decl)
          Add a variable declaration to this scope
 NameDeclaration addVariableNameOccurrence(NameOccurrence occ)
          Adds a NameOccurrence to this scope - only call this after getting a true back from contains()
 boolean contains(NameOccurrence occ)
          Tests whether or not a NameOccurrence is directly contained in the scope Note that if this search is just in this scope - it doesn't go diving into any contained scopes.
protected  NameDeclaration findVariableHere(NameOccurrence occ)
           
 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.
 java.util.Map getUnusedVariableDeclarations()
           
 java.lang.String toString()
           
 
Methods inherited from class net.sourceforge.pmd.symboltable.AbstractScope
getParent, getVariableDeclarations, glomNames, setParent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface net.sourceforge.pmd.symboltable.Scope
getParent, getVariableDeclarations, setParent
 

Constructor Detail

GlobalScope

public GlobalScope()
Method Detail

getEnclosingClassScope

public ClassScope getEnclosingClassScope()
Description copied from interface: Scope
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.

Specified by:
getEnclosingClassScope in interface Scope
Overrides:
getEnclosingClassScope in class AbstractScope

addDeclaration

public void addDeclaration(MethodNameDeclaration decl)
Description copied from interface: Scope
Add a method declaration to this scope

Specified by:
addDeclaration in interface Scope
Overrides:
addDeclaration in class AbstractScope

getUnusedVariableDeclarations

public java.util.Map getUnusedVariableDeclarations()

addDeclaration

public void addDeclaration(VariableNameDeclaration decl)
Description copied from interface: Scope
Add a variable declaration to this scope

Specified by:
addDeclaration in interface Scope
Overrides:
addDeclaration in class AbstractScope

contains

public boolean contains(NameOccurrence occ)
Description copied from interface: Scope
Tests whether or not a NameOccurrence is directly contained in the scope Note that if this search is just in this scope - it doesn't go diving into any contained scopes.

Specified by:
contains in interface Scope
Overrides:
contains in class AbstractScope

addVariableNameOccurrence

public NameDeclaration addVariableNameOccurrence(NameOccurrence occ)
Description copied from interface: Scope
Adds a NameOccurrence to this scope - only call this after getting a true back from contains()

Specified by:
addVariableNameOccurrence in interface Scope
Overrides:
addVariableNameOccurrence in class AbstractScope

toString

public java.lang.String toString()

findVariableHere

protected NameDeclaration findVariableHere(NameOccurrence occ)
Specified by:
findVariableHere in class AbstractScope