org.acm.seguin.summary
Class TypeDeclSummary

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

public class TypeDeclSummary
extends Summary

Summarize a type declaration. This object is meant to store the name and package of some type. This will be used in variable summaries, as well as for return values and exceptions.

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
TypeDeclSummary(Summary parentSummary)
          Creates a type declaration summary.
TypeDeclSummary(Summary parentSummary, net.sourceforge.jrefactory.ast.ASTName nameNode)
          Creates a type declaration summary from an ASTName object.
TypeDeclSummary(Summary parentSummary, net.sourceforge.jrefactory.ast.ASTPrimitiveType primitiveType)
          Creates a type declaration summary from an ASTPrimitiveType object.
TypeDeclSummary(Summary parentSummary, net.sourceforge.jrefactory.ast.ASTReferenceType refNode)
          Creates a type declaration summary from an ASTReferenceType object.
TypeDeclSummary(Summary parentSummary, java.lang.Class clazz)
           
TypeDeclSummary(Summary parentSummary, java.lang.String initPackage, java.lang.String initType)
          Creates a type declaration summary from an ASTName object.
 
Method Summary
 java.lang.Object accept(SummaryVisitor visitor, java.lang.Object data)
          Provide method to visit a node
 boolean equals(java.lang.Object other)
          Check to see if it is equal
 int getArrayCount()
          Return the number of "[]" pairs
 java.lang.String getLongName()
          Get long name
 java.lang.String getName()
          Gets the name attribute of the TypeDeclSummary object
 java.lang.String getPackage()
          Get the package name
 java.lang.String getType()
          Get the name of the type
static TypeDeclSummary getTypeDeclSummary(Summary parentSummary, net.sourceforge.jrefactory.ast.ASTReferenceType typeNode)
          Factory method.
static TypeDeclSummary getTypeDeclSummary(Summary parentSummary, net.sourceforge.jrefactory.ast.ASTResultType typeNode)
          Factory method.
static TypeDeclSummary getTypeDeclSummary(Summary parentSummary, net.sourceforge.jrefactory.ast.ASTType typeNode)
          Factory method.
 boolean isArray()
          Is this an array?
 boolean isPrimitive()
          Check if this is a primitive node
 boolean isSame(TypeDeclSummary other)
          Gets the same attribute of the TypeDeclSummary object
 void setArrayCount(int count)
          Set the array count
 java.lang.String toString()
          Convert this into a string
 
Methods inherited from class org.acm.seguin.summary.Summary
addModifier, copyModifiers, getDeclarationLine, 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

TypeDeclSummary

public TypeDeclSummary(Summary parentSummary)
Creates a type declaration summary.

Parameters:
parentSummary - the parent summary

TypeDeclSummary

public TypeDeclSummary(Summary parentSummary,
                       net.sourceforge.jrefactory.ast.ASTName nameNode)
Creates a type declaration summary from an ASTName object.

Parameters:
parentSummary - the parent summary
nameNode - the ASTName object

TypeDeclSummary

public TypeDeclSummary(Summary parentSummary,
                       net.sourceforge.jrefactory.ast.ASTReferenceType refNode)
Creates a type declaration summary from an ASTReferenceType object.

Parameters:
parentSummary - the parent summary
nameNode - the ASTName object

TypeDeclSummary

public TypeDeclSummary(Summary parentSummary,
                       net.sourceforge.jrefactory.ast.ASTPrimitiveType primitiveType)
Creates a type declaration summary from an ASTPrimitiveType object.

Parameters:
parentSummary - the parent summary
primitiveType - the ASTPrimitiveType object

TypeDeclSummary

public TypeDeclSummary(Summary parentSummary,
                       java.lang.String initPackage,
                       java.lang.String initType)
Creates a type declaration summary from an ASTName object.

Parameters:
parentSummary - the parent summary
initPackage - the package name
initType - the type name

TypeDeclSummary

public TypeDeclSummary(Summary parentSummary,
                       java.lang.Class clazz)
Method Detail

setArrayCount

public void setArrayCount(int count)
Set the array count

Parameters:
count - the number of "[]" pairs

getArrayCount

public int getArrayCount()
Return the number of "[]" pairs

Returns:
the array count

isArray

public boolean isArray()
Is this an array?

Returns:
true if this is an array

getPackage

public java.lang.String getPackage()
Get the package name

Returns:
a string containing the name of the package

getType

public java.lang.String getType()
Get the name of the type

Returns:
a string containing the name of the type

isPrimitive

public boolean isPrimitive()
Check if this is a primitive node

Returns:
true if this is a primitive value

getLongName

public java.lang.String getLongName()
Get long name

Returns:
the long version of the name (type + package)

toString

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

Overrides:
toString in class java.lang.Object
Returns:
a string representation of the type

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

equals

public boolean equals(java.lang.Object other)
Check to see if it is equal

Overrides:
equals in class java.lang.Object
Parameters:
other - the other item
Returns:
true if they are equal

isSame

public boolean isSame(TypeDeclSummary other)
Gets the same attribute of the TypeDeclSummary object

Parameters:
other - Description of the Parameter
Returns:
The same value

getTypeDeclSummary

public static TypeDeclSummary getTypeDeclSummary(Summary parentSummary,
                                                 net.sourceforge.jrefactory.ast.ASTType typeNode)
Factory method. Creates a type decl summary object from the type node.

Parameters:
parentSummary - the parent summary
typeNode - the AST node containing the type
Returns:
the new node

getTypeDeclSummary

public static TypeDeclSummary getTypeDeclSummary(Summary parentSummary,
                                                 net.sourceforge.jrefactory.ast.ASTReferenceType typeNode)
Factory method. Creates a type decl summary object from the type node.

Parameters:
parentSummary - the parent summary
typeNode - the AST node containing the type
Returns:
the new node

getTypeDeclSummary

public static TypeDeclSummary getTypeDeclSummary(Summary parentSummary,
                                                 net.sourceforge.jrefactory.ast.ASTResultType typeNode)
Factory method. Creates a type decl summary object from the type node.

Parameters:
parentSummary - the parent summary
typeNode - the AST node containing the result type
Returns:
the new node

getName

public java.lang.String getName()
Gets the name attribute of the TypeDeclSummary object

Specified by:
getName in class Summary
Returns:
The name value