dpt.symbtab
Class MethodDef

java.lang.Object
  |
  +--dpt.symbtab.Definition
        |
        +--dpt.symbtab.ScopedDef
              |
              +--dpt.symbtab.MethodDef

class MethodDef
extends ScopedDef
implements TypedDef

A definition of a method in a class


Field Summary
private  JavaVector exceptions
          A list of exceptions that can be thrown
private  java.util.Vector modifiers
           
private  JavaVector parameters
          A list of formal parameters to the method
private  Definition type
          The return type of the method
 
Fields inherited from class dpt.symbtab.ScopedDef
elements, iAmDefaultOrBaseScope, unresolvedStuff
 
Fields inherited from class dpt.symbtab.Definition
definition, name, parentScope, references, ST_CL, ST_FU, ST_FU_EXT, ST_IF, ST_IMPL, ST_IMPORT, ST_PAC, ST_SUB, ST_SUPER, ST_VAR
 
Constructor Summary
(package private) MethodDef(java.lang.String name, Occurrence occ, ClassDef type, ScopedDef parentScope)
          Constructor to create a method definition object
(package private) MethodDef(java.lang.String name, Occurrence occ, ClassDef type, ScopedDef parentScope, java.util.Vector modifiers)
          Constructor to create a method definition object
 
Method Summary
(package private)  void add(ClassDef excep)
          Add a thrown exception to the method's exception list
(package private)  void add(VariableDef param)
          Add a parameter to the method's parameter list
 java.lang.String GetItem(int TypID)
           
 java.util.Vector GetItems(int TypID, java.lang.String modifier)
           
 java.lang.String GetLocation(int TypID, java.lang.String sName)
           
(package private)  int getParamCount()
          Find out how many parameters this method has
 Definition getType()
          Return the return type of the method
(package private)  Definition lookup(java.lang.String name, int numParams)
          lookup the name as a local variable or local class in this class
 void report(IndentingPrintWriter out)
          Write information about this method to the report
(package private)  void resolveTypes(SymbolTable symbolTable)
          Resolve references to other symbols for pass 2
(package private)  void setExceptions(JavaVector exceptions)
          set the list of exceptions that this method can throw
 
Methods inherited from class dpt.symbtab.ScopedDef
add, addUnresolved, GetListItems, GetStringItems, GetStringLocation, hasElements, isDefaultOrBaseScope, reportElements, setDefaultOrBaseScope
 
Methods inherited from class dpt.symbtab.Definition
addReference, ExtractClass, ExtractClass, ExtractName, ExtractPackage, ExtractPackage, getDef, getName, getOccurrence, getParentScope, getQualifiedName, GetReferences, isSuperClassOf, listReferences, lookup, setParentScope, toString
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, wait, wait, wait
 

Field Detail

type

private Definition type
The return type of the method

parameters

private JavaVector parameters
A list of formal parameters to the method

exceptions

private JavaVector exceptions
A list of exceptions that can be thrown

modifiers

private java.util.Vector modifiers
Constructor Detail

MethodDef

MethodDef(java.lang.String name,
          Occurrence occ,
          ClassDef type,
          ScopedDef parentScope,
          java.util.Vector modifiers)
Constructor to create a method definition object

MethodDef

MethodDef(java.lang.String name,
          Occurrence occ,
          ClassDef type,
          ScopedDef parentScope)
Constructor to create a method definition object
Method Detail

add

void add(ClassDef excep)
Add a thrown exception to the method's exception list

add

void add(VariableDef param)
Add a parameter to the method's parameter list

getParamCount

int getParamCount()
Find out how many parameters this method has

getType

public Definition getType()
Return the return type of the method
Specified by:
getType in interface TypedDef

lookup

Definition lookup(java.lang.String name,
                  int numParams)
lookup the name as a local variable or local class in this class
Overrides:
lookup in class ScopedDef

GetLocation

public java.lang.String GetLocation(int TypID,
                                    java.lang.String sName)
Overrides:
GetLocation in class Definition

GetItem

public java.lang.String GetItem(int TypID)
Overrides:
GetItem in class Definition

GetItems

public java.util.Vector GetItems(int TypID,
                                 java.lang.String modifier)
Overrides:
GetItems in class Definition

report

public void report(IndentingPrintWriter out)
Write information about this method to the report
Overrides:
report in class Definition

resolveTypes

void resolveTypes(SymbolTable symbolTable)
Resolve references to other symbols for pass 2
Overrides:
resolveTypes in class ScopedDef

setExceptions

void setExceptions(JavaVector exceptions)
set the list of exceptions that this method can throw