org.acm.seguin.summary
Class TypeSummary

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

public class TypeSummary
extends Summary

Stores the summary of a type (either class or interface)

Author:
Chris Seguin, Mike Atkinson
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
TypeSummary(Summary parentSummary, net.sourceforge.jrefactory.ast.SimpleNode typeDecl)
          Creates a TypeSummary object
 
Method Summary
 java.lang.Object accept(SummaryVisitor visitor, java.lang.Object data)
          Provide method to visit a node
protected  void add(FieldSummary fieldSummary)
          Add a field summary
protected  void add(MethodSummary methodSummary)
          Add a method summary
protected  void add(TypeDeclSummary typeDeclSummary)
          Add an interface summary
protected  void add(TypeSummary typeSummary)
          Add a type summary
 FieldSummary getField(java.lang.String name)
          Gets a field by a name
 int getFieldCount()
          Get the total number of fields - class and instance - that are associated with this object.
 java.util.Iterator getFields()
          Return a list of fields
 java.util.Iterator getImplementedInterfaces()
          Return a list of the types that this class/interface implements
 int getMethodCount()
          Get the total number of methods - class and instance - that are associated with this object.
 java.util.Iterator getMethods()
          Return the list of methods
 java.lang.String getName()
          Get the name of this object
 PackageSummary getPackageSummary()
          Finds the package summary associated with this type
 TypeDeclSummary getParentClass()
          Return the parent class
 int getTypeCount()
          Get the total number of nested class and interface declarations that are associated with this object.
 java.util.Iterator getTypes()
          Return the iterator over the types
 boolean isInterface()
          Check to see if this is an interface or a class
 void setName(java.lang.String newName)
          Set the name of this object
 java.lang.String toString()
          Convert this object to a string
 
Methods inherited from class org.acm.seguin.summary.Summary
addModifier, copyModifiers, getDeclarationLine, getEndLine, getModifiers, getModifiersString, getParent, getStartLine, isAbstract, isExplicit, isFinal, 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, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TypeSummary

public TypeSummary(Summary parentSummary,
                   net.sourceforge.jrefactory.ast.SimpleNode typeDecl)
Creates a TypeSummary object

Parameters:
parentSummary - the parent summary
typeDecl - the type declaration
Method Detail

setName

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

Parameters:
newName - the name

isInterface

public boolean isInterface()
Check to see if this is an interface or a class

Specified by:
isInterface in interface net.sourceforge.jrefactory.ast.ModifierHolder
Overrides:
isInterface in class Summary
Returns:
true if this is an interface

getName

public java.lang.String getName()
Get the name of this object

Specified by:
getName in class Summary
Returns:
the name

getMethods

public java.util.Iterator getMethods()
Return the list of methods

Returns:
an iterator of methods

getMethodCount

public int getMethodCount()
Get the total number of methods - class and instance - that are associated with this object.

Returns:
the number of methods

getFields

public java.util.Iterator getFields()
Return a list of fields

Returns:
an iterator of fields

getFieldCount

public int getFieldCount()
Get the total number of fields - class and instance - that are associated with this object.

Returns:
the number of fields

getTypes

public java.util.Iterator getTypes()
Return the iterator over the types

Returns:
an iterator full of types

getTypeCount

public int getTypeCount()
Get the total number of nested class and interface declarations that are associated with this object.

Returns:
the number of nested classes and interfaces

getImplementedInterfaces

public java.util.Iterator getImplementedInterfaces()
Return a list of the types that this class/interface implements

Returns:
an iterator of the types

getParentClass

public TypeDeclSummary getParentClass()
Return the parent class

Returns:
the type declaration representing the parent class

getPackageSummary

public PackageSummary getPackageSummary()
Finds the package summary associated with this type

Returns:
the package summary

getField

public FieldSummary getField(java.lang.String name)
Gets a field by a name

Parameters:
name - the name of the field
Returns:
the field summary

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

toString

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

Overrides:
toString in class java.lang.Object
Returns:
a string

add

protected void add(MethodSummary methodSummary)
Add a method summary

Parameters:
methodSummary - the method summary

add

protected void add(FieldSummary fieldSummary)
Add a field summary

Parameters:
fieldSummary - the field summary

add

protected void add(TypeSummary typeSummary)
Add a type summary

Parameters:
typeSummary - the type summary

add

protected void add(TypeDeclSummary typeDeclSummary)
Add an interface summary

Parameters:
typeDeclSummary - the interface summary