org.acm.seguin.summary
Class MethodSummary

java.lang.Object
  extended by org.acm.seguin.summary.Summary
      extended by org.acm.seguin.summary.MethodSummary
All Implemented Interfaces:
java.io.Serializable, net.sourceforge.jrefactory.ast.ModifierHolder

public class MethodSummary
extends Summary

Stores information about a method

Author:
Chris Seguin
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.acm.seguin.summary.Summary
modifiers
 
Fields inherited from interface net.sourceforge.jrefactory.ast.ModifierHolder
ABSTRACT, EXPLICIT, FINAL, INTERFACE, names, NATIVE, PRIVATE, PROTECTED, PUBLIC, STATIC, STRICTFP, SYNCHRONIZED, TRANSIENT, VOLATILE
 
Constructor Summary
MethodSummary(Summary parent)
          Construct a method from a method declaration node
 
Method Summary
 java.lang.Object accept(SummaryVisitor visitor, java.lang.Object data)
          Provide method to visit a node
protected  void add(ParameterSummary param)
          Add the formal parameters
protected  void add(TypeDeclSummary except)
          Add the formal parameters
protected  void addDependency(Summary dependsOn)
          Adds a variable dependency
 void beginBlock()
          Notes to the method summary that there is a block in the code
 boolean checkSignature(MethodSummary other)
          Determines if their signatures are the same
 void endBlock()
          Notes to the method summary that the block in the code is complete
 boolean equals(java.lang.Object other)
          Description of the Method
 int getDeclarationLine()
          Gets the DeclarationLine attribute of the MethodSummary object
 java.util.Iterator getDependencies()
          Return a list of dependencies.
 java.util.Iterator getExceptions()
          Get a list of execeptions
 int getMaxBlockDepth()
          Returns the maximum levels of blocks in a certain code
 java.lang.String getName()
          Return the name
 int getParameterCount()
          Return the number of parameters
 java.util.Iterator getParameters()
          Get a list of parameters
 TypeDeclSummary getReturnType()
          Get the return
 int getStatementCount()
          Get the statement count
 void incrStatementCount()
          Increments the statement count
 boolean isConstructor()
          Determine if this is a constructor
 boolean isInitializer()
          Determines if this is really a method or an initializer
 boolean isNearMiss(MethodSummary other)
          Gets the NearMiss attribute of the MethodSummary object
 void setDeclarationLine(int value)
          Sets the DeclarationLine attribute of the MethodSummary object
 void setName(java.lang.String newName)
          Set the name
 void setReturnType(TypeDeclSummary type)
          Set the return
 java.lang.String toString()
          Convert this to a string
 
Methods inherited from class org.acm.seguin.summary.Summary
addModifier, copyModifiers, getEndLine, getModifiers, getModifiersString, getParent, getStartLine, isAbstract, isExplicit, isFinal, isInterface, isNative, isPackage, isPrivate, isProtected, isPublic, isStatic, isStrictFP, isSynchronized, isTransient, isVolatile, setAbstract, setAbstract, setCode, setEndLine, setFinal, setModifiers, setPrivate, setPrivate, setProtected, setProtected, setPublic, setPublic, setStartLine, setStatic, setStatic, setStrict, setSynchronized, setSynchronized, toStandardOrderString, toStringAlphabetical
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MethodSummary

public MethodSummary(Summary parent)
Construct a method from a method declaration node

Parameters:
parent - Description of Parameter
Method Detail

setName

public void setName(java.lang.String newName)
Set the name

Parameters:
newName - the name of the method

setReturnType

public void setReturnType(TypeDeclSummary type)
Set the return

Parameters:
type - the return type. For a constructor, this value is null.

setDeclarationLine

public void setDeclarationLine(int value)
Sets the DeclarationLine attribute of the MethodSummary object

Parameters:
value - The new DeclarationLine value

getName

public java.lang.String getName()
Return the name

Specified by:
getName in class Summary
Returns:
the name of the method

getReturnType

public TypeDeclSummary getReturnType()
Get the return

Returns:
the return type. For a constructor, this value is null.

getExceptions

public java.util.Iterator getExceptions()
Get a list of execeptions

Returns:
an iterator full of exceptions

getParameters

public java.util.Iterator getParameters()
Get a list of parameters

Returns:
an iterator over the parameters

getParameterCount

public int getParameterCount()
Return the number of parameters

Returns:
the count of parameters to this method

getDependencies

public java.util.Iterator getDependencies()
Return a list of dependencies. This list will contain variable summaries and type decl summaries.

Returns:
a list of dependencies.

getStatementCount

public int getStatementCount()
Get the statement count

Returns:
the number of statements in the method

isNearMiss

public boolean isNearMiss(MethodSummary other)
Gets the NearMiss attribute of the MethodSummary object

Parameters:
other - Description of Parameter
Returns:
The NearMiss value

isInitializer

public boolean isInitializer()
Determines if this is really a method or an initializer

Returns:
true if it is an initializer

getMaxBlockDepth

public int getMaxBlockDepth()
Returns the maximum levels of blocks in a certain code

Returns:
The MaxBlockDepth value

getDeclarationLine

public int getDeclarationLine()
Gets the DeclarationLine attribute of the MethodSummary object

Overrides:
getDeclarationLine in class Summary
Returns:
The DeclarationLine value

isConstructor

public boolean isConstructor()
Determine if this is a constructor

Returns:
The Constructor value

toString

public java.lang.String toString()
Convert this to a string

Overrides:
toString in class java.lang.Object
Returns:
a string representation of this object

accept

public java.lang.Object accept(SummaryVisitor visitor,
                               java.lang.Object data)
Provide method to visit a node

Overrides:
accept in class Summary
Parameters:
visitor - the visitor
data - the data for the visit
Returns:
some new data

incrStatementCount

public void incrStatementCount()
Increments the statement count


equals

public boolean equals(java.lang.Object other)
Description of the Method

Overrides:
equals in class java.lang.Object
Parameters:
other - Description of Parameter
Returns:
Description of the Returned Value

beginBlock

public void beginBlock()
Notes to the method summary that there is a block in the code


endBlock

public void endBlock()
Notes to the method summary that the block in the code is complete


checkSignature

public boolean checkSignature(MethodSummary other)
Determines if their signatures are the same

Parameters:
other - the oether method
Returns:
true if they have the same signatures

add

protected void add(TypeDeclSummary except)
Add the formal parameters

Parameters:
except - Description of Parameter

add

protected void add(ParameterSummary param)
Add the formal parameters

Parameters:
param - the next formal parameter

addDependency

protected void addDependency(Summary dependsOn)
Adds a variable dependency

Parameters:
dependsOn - a variable that this method is depending on - local variable or something in an anonymous class.