Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## net.sourceforge.pmd.symboltable
Class SourceFileScope

    java.lang.Object
      net.sourceforge.pmd.symboltable.AbstractScope
          net.sourceforge.pmd.symboltable.SourceFileScope

All Implemented Interfaces:
  Scope

public class SourceFileScope
extends AbstractScope
implements Scope

Field Summary
`protected java.util.Map` | `classNames`

Constructor Summary
`SourceFileScope()`
`SourceFileScope(java.lang.String image)`

Method Summary
`void` | `addDeclaration(ClassNameDeclaration classDecl)` Add a class declaration to this scope
`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()
`protected NameDeclaration` | `findVariableHere(NameOccurrence occ)`
`java.util.Map` | `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 SourceFileScope 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.
`java.lang.String` | `getPackageName()`
`java.util.Map` | `getVariableDeclarations()` Returns a Map (VariableNameDeclaration->List(NameOccurrence,NameOccurrence)) of declarations that exist at this scope
`java.lang.String` | `toString()`

Methods inherited from class net.sourceforge.pmd.symboltable.AbstractScope
`contains, getParent, 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
`contains, getParent, setParent`

Field Detail

### classNames

    protected java.util.Map classNames

Constructor Detail

### SourceFileScope

    public SourceFileScope()

### SourceFileScope

    public SourceFileScope(java.lang.String image)

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`

### getEnclosingMethodScope

    public MethodScope getEnclosingMethodScope()

  Description copied from interface: `Scope`
  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 MethodScope to find a method parameter.

  Specified by:
    `getEnclosingMethodScope` in interface `Scope`
  Overrides:
    `getEnclosingMethodScope` in class `AbstractScope`

### getPackageName

    public java.lang.String getPackageName()

### getEnclosingSourceFileScope

    public SourceFileScope getEnclosingSourceFileScope()

  Description copied from interface: `Scope`
  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.

  Specified by:
    `getEnclosingSourceFileScope` in interface `Scope`
  Overrides:
    `getEnclosingSourceFileScope` in class `AbstractScope`

### addDeclaration

    public void addDeclaration(ClassNameDeclaration classDecl)

  Description copied from interface: `Scope`
  Add a class declaration to this scope

  Specified by:
    `addDeclaration` in interface `Scope`
  Overrides:
    `addDeclaration` 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`

### addDeclaration

    public void addDeclaration(VariableNameDeclaration decl)

  Description copied from interface: `Scope`
  Add a variable declaration to this scope

  Specified by:
    `addDeclaration` in interface `Scope`

### getClassDeclarations

    public java.util.Map getClassDeclarations()

  Description copied from interface: `Scope`
  Returns a Map (VariableNameDeclaration->List(NameOccurrence,NameOccurrence)) of declarations that exist at this scope

  Specified by:
    `getClassDeclarations` in interface `Scope`
  Overrides:
    `getClassDeclarations` in class `AbstractScope`

### getVariableDeclarations

    public java.util.Map getVariableDeclarations()

  Description copied from interface: `Scope`
  Returns a Map (VariableNameDeclaration->List(NameOccurrence,NameOccurrence)) of declarations that exist at this scope

  Specified by:
    `getVariableDeclarations` in interface `Scope`

### 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`

### toString

    public java.lang.String toString()

### findVariableHere

    protected NameDeclaration findVariableHere(NameOccurrence occ)

  Specified by:
    `findVariableHere` in class `AbstractScope`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2002-2006 InfoEther. All Rights Reserved.